diff --git a/BlazeSudio/collisions/generated/collisions.cpython-312-x86_64-linux-gnu.so b/BlazeSudio/collisions/generated/collisions.cpython-312-x86_64-linux-gnu.so index e7da577..6de8130 100755 Binary files a/BlazeSudio/collisions/generated/collisions.cpython-312-x86_64-linux-gnu.so and b/BlazeSudio/collisions/generated/collisions.cpython-312-x86_64-linux-gnu.so differ diff --git a/BlazeSudio/collisions/lib/collisions.c b/BlazeSudio/collisions/lib/collisions.c index 5a41098..cf0e849 100644 --- a/BlazeSudio/collisions/lib/collisions.c +++ b/BlazeSudio/collisions/lib/collisions.c @@ -1492,42 +1492,43 @@ static const char *__pyx_f[] = { /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ -struct __pyx_obj_10collisions___pyx_scope_struct__genexpr; +struct __pyx_obj_10collisions___pyx_scope_struct__closestPointTo; struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr; struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr; struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr; struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr; struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr; -struct __pyx_obj_10collisions___pyx_scope_struct_6_handleCollisionsPos; -struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo; -struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner; -struct __pyx_obj_10collisions___pyx_scope_struct_9__contains; -struct __pyx_obj_10collisions___pyx_scope_struct_10_genexpr; -struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo; -struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos; -struct __pyx_obj_10collisions___pyx_scope_struct_13__collides; -struct __pyx_obj_10collisions___pyx_scope_struct_14_genexpr; -struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo; -struct __pyx_obj_10collisions___pyx_scope_struct_16_tangent; -struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo; -struct __pyx_obj_10collisions___pyx_scope_struct_18__contains; -struct __pyx_obj_10collisions___pyx_scope_struct_19_genexpr; -struct __pyx_obj_10collisions___pyx_scope_struct_20__collides; -struct __pyx_obj_10collisions___pyx_scope_struct_21_genexpr; -struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache; -struct __pyx_obj_10collisions___pyx_scope_struct_23__collides; -struct __pyx_obj_10collisions___pyx_scope_struct_24_genexpr; -struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__; -struct __pyx_obj_10collisions___pyx_scope_struct_26_area; -struct __pyx_obj_10collisions___pyx_scope_struct_27_genexpr; -struct __pyx_obj_10collisions___pyx_scope_struct_28__collides; -struct __pyx_obj_10collisions___pyx_scope_struct_29_genexpr; +struct __pyx_obj_10collisions___pyx_scope_struct_6_genexpr; +struct __pyx_obj_10collisions___pyx_scope_struct_7_handleCollisionsPos; +struct __pyx_obj_10collisions___pyx_scope_struct_8_closestPointTo; +struct __pyx_obj_10collisions___pyx_scope_struct_9_isCorner; +struct __pyx_obj_10collisions___pyx_scope_struct_10__contains; +struct __pyx_obj_10collisions___pyx_scope_struct_11_genexpr; +struct __pyx_obj_10collisions___pyx_scope_struct_12_closestPointTo; +struct __pyx_obj_10collisions___pyx_scope_struct_13_handleCollisionsPos; +struct __pyx_obj_10collisions___pyx_scope_struct_14__collides; +struct __pyx_obj_10collisions___pyx_scope_struct_15_genexpr; +struct __pyx_obj_10collisions___pyx_scope_struct_16_closestPointTo; +struct __pyx_obj_10collisions___pyx_scope_struct_17_tangent; +struct __pyx_obj_10collisions___pyx_scope_struct_18_closestPointTo; +struct __pyx_obj_10collisions___pyx_scope_struct_19__contains; +struct __pyx_obj_10collisions___pyx_scope_struct_20_genexpr; +struct __pyx_obj_10collisions___pyx_scope_struct_21__collides; +struct __pyx_obj_10collisions___pyx_scope_struct_22_genexpr; +struct __pyx_obj_10collisions___pyx_scope_struct_23_getCache; +struct __pyx_obj_10collisions___pyx_scope_struct_24__collides; +struct __pyx_obj_10collisions___pyx_scope_struct_25_genexpr; +struct __pyx_obj_10collisions___pyx_scope_struct_26___setitem__; +struct __pyx_obj_10collisions___pyx_scope_struct_27_area; +struct __pyx_obj_10collisions___pyx_scope_struct_28_genexpr; +struct __pyx_obj_10collisions___pyx_scope_struct_29__collides; struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr; struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr; struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr; struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr; -struct __pyx_obj_10collisions___pyx_scope_struct_34_union; -struct __pyx_obj_10collisions___pyx_scope_struct_35_genexpr; +struct __pyx_obj_10collisions___pyx_scope_struct_34_genexpr; +struct __pyx_obj_10collisions___pyx_scope_struct_35_union; +struct __pyx_obj_10collisions___pyx_scope_struct_36_genexpr; struct __pyx_defaults; typedef struct __pyx_defaults __pyx_defaults; struct __pyx_defaults1; @@ -1578,6 +1579,8 @@ struct __pyx_defaults23; typedef struct __pyx_defaults23 __pyx_defaults23; struct __pyx_defaults24; typedef struct __pyx_defaults24 __pyx_defaults24; +struct __pyx_defaults25; +typedef struct __pyx_defaults25 __pyx_defaults25; struct __pyx_defaults { PyObject *__pyx_arg_width; }; @@ -1591,63 +1594,65 @@ struct __pyx_defaults3 { PyObject *__pyx_arg_vel; }; struct __pyx_defaults4 { - PyObject *__pyx_arg_precision; + double __pyx_arg_bounciness; }; struct __pyx_defaults5 { - double __pyx_arg_bounciness; + PyObject *__pyx_arg_precision; }; struct __pyx_defaults6 { - PyObject *__pyx_arg_vel; - PyObject *__pyx_arg_precision; + double __pyx_arg_bounciness; }; struct __pyx_defaults7 { + PyObject *__pyx_arg_vel; PyObject *__pyx_arg_precision; }; struct __pyx_defaults8 { - double __pyx_arg_bounciness; + PyObject *__pyx_arg_precision; }; struct __pyx_defaults9 { - PyObject *__pyx_arg_precision; + double __pyx_arg_bounciness; }; struct __pyx_defaults10 { - PyObject *__pyx_arg_vel; PyObject *__pyx_arg_precision; }; struct __pyx_defaults11 { + PyObject *__pyx_arg_vel; PyObject *__pyx_arg_precision; }; struct __pyx_defaults12 { - double __pyx_arg_bounciness; + PyObject *__pyx_arg_precision; }; struct __pyx_defaults13 { - PyObject *__pyx_arg_vel; - PyObject *__pyx_arg_precision; + double __pyx_arg_bounciness; }; struct __pyx_defaults14 { + PyObject *__pyx_arg_vel; + PyObject *__pyx_arg_maxTries; PyObject *__pyx_arg_precision; }; struct __pyx_defaults15 { + PyObject *__pyx_arg_maxTries; PyObject *__pyx_arg_precision; }; struct __pyx_defaults16 { PyObject *__pyx_arg_precision; - double __pyx_arg_bounciness; }; struct __pyx_defaults17 { PyObject *__pyx_arg_precision; + double __pyx_arg_bounciness; }; struct __pyx_defaults18 { - PyObject *__pyx_arg_vel; PyObject *__pyx_arg_precision; }; struct __pyx_defaults19 { + PyObject *__pyx_arg_vel; PyObject *__pyx_arg_precision; }; struct __pyx_defaults20 { PyObject *__pyx_arg_precision; }; struct __pyx_defaults21 { - double __pyx_arg_bounciness; + PyObject *__pyx_arg_precision; }; struct __pyx_defaults22 { double __pyx_arg_bounciness; @@ -1658,15 +1663,31 @@ struct __pyx_defaults23 { struct __pyx_defaults24 { double __pyx_arg_bounciness; }; +struct __pyx_defaults25 { + double __pyx_arg_bounciness; +}; + +/* "collisions.py":595 + * return points + * + * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Iterable[pointLike]: # <<<<<<<<<<<<<< + * """ + * Finds the closest point ON ANY of these objects TO the input shape. + */ +struct __pyx_obj_10collisions___pyx_scope_struct__closestPointTo { + PyObject_HEAD + PyObject *__pyx_v_othershape; +}; -/* "collisions.py":669 + +/* "collisions.py":702 * Number: The sum of all the areas of the shapes. * """ * return sum(s.area() for s in self.shapes) # <<<<<<<<<<<<<< * * def rect(self) -> Iterable[Number]: */ -struct __pyx_obj_10collisions___pyx_scope_struct__genexpr { +struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_s; @@ -1676,14 +1697,14 @@ struct __pyx_obj_10collisions___pyx_scope_struct__genexpr { }; -/* "collisions.py":679 +/* "collisions.py":712 * """ * rs = [s.rect() for s in self.shapes] * return min(i[0] for i in rs), min(i[1] for i in rs), max(i[2] for i in rs), max(i[3] for i in rs) # <<<<<<<<<<<<<< * * def copy(self) -> 'Shapes': */ -struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr { +struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_i; @@ -1691,7 +1712,7 @@ struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr { Py_ssize_t __pyx_t_1; }; -struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr { +struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_i; @@ -1699,7 +1720,7 @@ struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr { Py_ssize_t __pyx_t_1; }; -struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr { +struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_i; @@ -1707,7 +1728,7 @@ struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr { Py_ssize_t __pyx_t_1; }; -struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr { +struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_i; @@ -1716,14 +1737,14 @@ struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr { }; -/* "collisions.py":685 +/* "collisions.py":718 * Make a copy of this class with a copy of each shape in it. * """ * return Shapes(s.copy() for s in self.shapes) # <<<<<<<<<<<<<< * * def copy_leave_shapes(self) -> 'Shapes': */ -struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr { +struct __pyx_obj_10collisions___pyx_scope_struct_6_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_s; @@ -1733,302 +1754,305 @@ struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr { }; -/* "collisions.py":788 +/* "collisions.py":821 * return False * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< * oldPoint: Union['Point',pointLike], * newPoint: Union['Point', pointLike], */ -struct __pyx_obj_10collisions___pyx_scope_struct_6_handleCollisionsPos { +struct __pyx_obj_10collisions___pyx_scope_struct_7_handleCollisionsPos { PyObject_HEAD PyObject *__pyx_v_oldPoint; }; -/* "collisions.py":1055 +/* "collisions.py":1088 * return othershape._where(self) * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLike|Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Find the closest point ON this object TO another object. */ -struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo { +struct __pyx_obj_10collisions___pyx_scope_struct_8_closestPointTo { PyObject_HEAD PyObject *__pyx_v_self; }; -/* "collisions.py":1129 +/* "collisions.py":1162 * return tries[0][0] * * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< * """ * Finds whether a point is on a corner of this shape. */ -struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner { +struct __pyx_obj_10collisions___pyx_scope_struct_9_isCorner { PyObject_HEAD PyObject *__pyx_v_precision; }; -/* "collisions.py":1405 +/* "collisions.py":1447 * return math.pi * self.r**2 * * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * if checkShpType(othershape, ShpTyps.Point): * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < self.r**2 */ -struct __pyx_obj_10collisions___pyx_scope_struct_9__contains { +struct __pyx_obj_10collisions___pyx_scope_struct_10__contains { PyObject_HEAD PyObject *__pyx_v_self; }; -/* "collisions.py":1416 +/* "collisions.py":1458 * return self._contains(ps[0]) and self._contains(ps[1]) * if checkShpType(othershape, ShpGroups.CLOSED): * return all(self._contains(Point(*p)) for p in othershape.toPoints()) # <<<<<<<<<<<<<< * * def _collides(self, othershape: Shape) -> bool: */ -struct __pyx_obj_10collisions___pyx_scope_struct_10_genexpr { +struct __pyx_obj_10collisions___pyx_scope_struct_11_genexpr { PyObject_HEAD - struct __pyx_obj_10collisions___pyx_scope_struct_9__contains *__pyx_outer_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_10__contains *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_p; }; -/* "collisions.py":1509 +/* "collisions.py":1551 * return othershape._where(self) * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike,Iterable[pointLike]]: # <<<<<<<<<<<<<< * """ * Find the closest point ON this object TO another object. */ -struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo { +struct __pyx_obj_10collisions___pyx_scope_struct_12_closestPointTo { PyObject_HEAD PyObject *__pyx_v_self; }; -/* "collisions.py":1558 +/* "collisions.py":1600 * return self.closestPointTo(Point(*ps[0])) * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< * oldCir: 'Circle', * newCir: 'Circle', */ -struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos { +struct __pyx_obj_10collisions___pyx_scope_struct_13_handleCollisionsPos { PyObject_HEAD + PyObject *__pyx_v_closestObj; + PyObject *__pyx_v_newCir; PyObject *__pyx_v_oldCir; + PyObject *__pyx_v_velphi; }; -/* "collisions.py":1794 +/* "collisions.py":1880 * return (diff/360) * 2*math.pi * self.r * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * if checkShpType(othershape, ShpTyps.Point): * if round((self.x - othershape.x)**2 + (self.y - othershape.y)**2, self.precision) != round(self.r**2, self.precision): */ -struct __pyx_obj_10collisions___pyx_scope_struct_13__collides { +struct __pyx_obj_10collisions___pyx_scope_struct_14__collides { PyObject_HEAD PyObject *__pyx_v_othershape; }; -/* "collisions.py":1802 +/* "collisions.py":1888 * if checkShpType(othershape, ShpTyps.Line, ShpTyps.Circle): * if checkShpType(othershape, ShpTyps.Circle): * if any(othershape._collides(Point(*i)) for i in self.endPoints()): # <<<<<<<<<<<<<< * return True * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) */ -struct __pyx_obj_10collisions___pyx_scope_struct_14_genexpr { +struct __pyx_obj_10collisions___pyx_scope_struct_15_genexpr { PyObject_HEAD - struct __pyx_obj_10collisions___pyx_scope_struct_13__collides *__pyx_outer_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_14__collides *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_i; }; -/* "collisions.py":1840 +/* "collisions.py":1926 * return othershape._where(self) * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLike|Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Finds the closest point ON THIS OBJECT **TO** the other object */ -struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo { +struct __pyx_obj_10collisions___pyx_scope_struct_16_closestPointTo { PyObject_HEAD PyObject *__pyx_v_othershape; PyObject *__pyx_v_self; }; -/* "collisions.py":2086 +/* "collisions.py":2172 * return points * * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< * """ * Finds the tangent on this surface to a point with a given velocity. */ -struct __pyx_obj_10collisions___pyx_scope_struct_16_tangent { +struct __pyx_obj_10collisions___pyx_scope_struct_17_tangent { PyObject_HEAD PyObject *__pyx_v_point; }; -/* "collisions.py":2120 +/* "collisions.py":2206 * return ps[0][0] * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike, Iterable[pointLike]]: # <<<<<<<<<<<<<< * """ * Find the closest point ON this object TO another object. */ -struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo { +struct __pyx_obj_10collisions___pyx_scope_struct_18_closestPointTo { PyObject_HEAD PyObject *__pyx_v_othershape; PyObject *__pyx_v_self; }; -/* "collisions.py":2390 +/* "collisions.py":2476 * return self._collides(point) and self.whereCollides(point) == [] * * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * if checkShpType(othershape, ShpTyps.Point): * return self._containsPoint(othershape) */ -struct __pyx_obj_10collisions___pyx_scope_struct_18__contains { +struct __pyx_obj_10collisions___pyx_scope_struct_19__contains { PyObject_HEAD PyObject *__pyx_v_self; }; -/* "collisions.py":2398 +/* "collisions.py":2484 * return self._collides(othershape) and self.whereCollides(othershape) == [] * if checkShpType(othershape, ShpGroups.CLOSED): * return all(self._contains(Point(*p)) for p in othershape.toPoints()) # <<<<<<<<<<<<<< * * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: */ -struct __pyx_obj_10collisions___pyx_scope_struct_19_genexpr { +struct __pyx_obj_10collisions___pyx_scope_struct_20_genexpr { PyObject_HEAD - struct __pyx_obj_10collisions___pyx_scope_struct_18__contains *__pyx_outer_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_19__contains *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_p; }; -/* "collisions.py":2476 +/* "collisions.py":2562 * return x < point.x < mx and y < point.y and my > point.y * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * x, y, mx, my = self.rect() * if checkShpType(othershape, ShpTyps.Point): */ -struct __pyx_obj_10collisions___pyx_scope_struct_20__collides { +struct __pyx_obj_10collisions___pyx_scope_struct_21__collides { PyObject_HEAD PyObject *__pyx_v_self; }; -/* "collisions.py":2496 +/* "collisions.py":2582 * ) * if checkShpType(othershape, ShpTyps.Arc): * if any(self._collides(Point(*i)) for i in othershape.endPoints()): # <<<<<<<<<<<<<< * return True * for i in self.toLines(): */ -struct __pyx_obj_10collisions___pyx_scope_struct_21_genexpr { +struct __pyx_obj_10collisions___pyx_scope_struct_22_genexpr { PyObject_HEAD - struct __pyx_obj_10collisions___pyx_scope_struct_20__collides *__pyx_outer_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_21__collides *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_i; }; -/* "collisions.py":2574 +/* "collisions.py":2660 * self.cacheRequirements = [] * * def getCache(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Specifically for the rotatedRect. This is a utility function to cache the rotated points so it doesn't have to re-rotate them every time. */ -struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache { +struct __pyx_obj_10collisions___pyx_scope_struct_23_getCache { PyObject_HEAD PyObject *__pyx_v_cos; PyObject *__pyx_v_sin; }; -/* "collisions.py":2621 +/* "collisions.py":2707 * return self.x < newp[0] < (self.x+self.w) and self.y < newp[1] < (self.y+self.h) * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * if not self.check_rects(othershape): * return False */ -struct __pyx_obj_10collisions___pyx_scope_struct_23__collides { +struct __pyx_obj_10collisions___pyx_scope_struct_24__collides { PyObject_HEAD PyObject *__pyx_v_self; }; -/* "collisions.py":2642 +/* "collisions.py":2728 * return False * if checkShpType(othershape, ShpTyps.Arc): * if any(self._collides(Point(*i)) for i in othershape.endPoints()): # <<<<<<<<<<<<<< * return True * for i in self.toLines(): */ -struct __pyx_obj_10collisions___pyx_scope_struct_24_genexpr { +struct __pyx_obj_10collisions___pyx_scope_struct_25_genexpr { PyObject_HEAD - struct __pyx_obj_10collisions___pyx_scope_struct_23__collides *__pyx_outer_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_24__collides *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_i; }; -/* "collisions.py":2679 +/* "collisions.py":2765 * return RotatedRect(self.x, self.y, self.w, self.h, self.rot, self.bounciness) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< * def rot(x, y): * return rotate([self.x, self.y], [x, y], self.rot) */ -struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__ { +struct __pyx_obj_10collisions___pyx_scope_struct_26___setitem__ { PyObject_HEAD PyObject *__pyx_v_self; }; -/* "collisions.py":2749 +/* "collisions.py":2835 * return min([i[0] for i in self.points]), min([i[1] for i in self.points]), max([i[0] for i in self.points]), max([i[1] for i in self.points]) * * def area(self) -> Number: # <<<<<<<<<<<<<< * """ * Gets the area of the shape. */ -struct __pyx_obj_10collisions___pyx_scope_struct_26_area { +struct __pyx_obj_10collisions___pyx_scope_struct_27_area { PyObject_HEAD PyObject *__pyx_v_self; }; -/* "collisions.py":2757 +/* "collisions.py":2843 * """ * return abs(sum( * (self.points[i][0] * self.points[i+1][1] - self.points[i+1][0] * self.points[i][1]) # <<<<<<<<<<<<<< * for i in range(len(self.points)-1) * ) + (self.points[len(self.points)-1][0] * self.points[0][1] - self.points[0][0] * self.points[len(self.points)-1][1])) / 2 */ -struct __pyx_obj_10collisions___pyx_scope_struct_27_genexpr { +struct __pyx_obj_10collisions___pyx_scope_struct_28_genexpr { PyObject_HEAD - struct __pyx_obj_10collisions___pyx_scope_struct_26_area *__pyx_outer_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_27_area *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_i; PyObject *__pyx_t_0; @@ -2037,42 +2061,42 @@ struct __pyx_obj_10collisions___pyx_scope_struct_27_genexpr { }; -/* "collisions.py":2761 +/* "collisions.py":2847 * ) + (self.points[len(self.points)-1][0] * self.points[0][1] - self.points[0][0] * self.points[len(self.points)-1][1])) / 2 * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * if not self.check_rects(othershape): * return False */ -struct __pyx_obj_10collisions___pyx_scope_struct_28__collides { +struct __pyx_obj_10collisions___pyx_scope_struct_29__collides { PyObject_HEAD PyObject *__pyx_v_self; }; -/* "collisions.py":2789 +/* "collisions.py":2875 * return False * if checkShpType(othershape, ShpTyps.Arc): * if any(self._collides(Point(*i)) for i in othershape.endPoints()): # <<<<<<<<<<<<<< * return True * for i in self.toLines(): */ -struct __pyx_obj_10collisions___pyx_scope_struct_29_genexpr { +struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr { PyObject_HEAD - struct __pyx_obj_10collisions___pyx_scope_struct_28__collides *__pyx_outer_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_29__collides *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_i; }; -/* "collisions.py":2851 +/* "collisions.py":2937 * rs = [s.rect() for s in shapes] * mins, maxs = [ * min(i[0] for i in rs), # <<<<<<<<<<<<<< * min(i[1] for i in rs) * ], [ */ -struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr { +struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_i; @@ -2081,14 +2105,14 @@ struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr { }; -/* "collisions.py":2852 +/* "collisions.py":2938 * mins, maxs = [ * min(i[0] for i in rs), * min(i[1] for i in rs) # <<<<<<<<<<<<<< * ], [ * max(i[2] for i in rs), */ -struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr { +struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_i; @@ -2097,14 +2121,14 @@ struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr { }; -/* "collisions.py":2854 +/* "collisions.py":2940 * min(i[1] for i in rs) * ], [ * max(i[2] for i in rs), # <<<<<<<<<<<<<< * max(i[3] for i in rs) * ] */ -struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr { +struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_i; @@ -2113,14 +2137,14 @@ struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr { }; -/* "collisions.py":2855 +/* "collisions.py":2941 * ], [ * max(i[2] for i in rs), * max(i[3] for i in rs) # <<<<<<<<<<<<<< * ] * return Shapes(Rect( */ -struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr { +struct __pyx_obj_10collisions___pyx_scope_struct_34_genexpr { PyObject_HEAD PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_i; @@ -2129,14 +2153,14 @@ struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr { }; -/* "collisions.py":2917 +/* "collisions.py":3003 * return Shapes(*shapes, *others) * * @staticmethod # <<<<<<<<<<<<<< * def union(*shapes: Shape) -> Shapes: # FIXME * """ */ -struct __pyx_obj_10collisions___pyx_scope_struct_34_union { +struct __pyx_obj_10collisions___pyx_scope_struct_35_union { PyObject_HEAD PyObject *__pyx_9genexpr81__pyx_v_j; PyObject *__pyx_v_p1; @@ -2144,16 +2168,16 @@ struct __pyx_obj_10collisions___pyx_scope_struct_34_union { }; -/* "collisions.py":2949 +/* "collisions.py":3035 * checked = [] * # TODO: When objs are covered * ps = [any(k.collides(Point(*j)) for k in oshps if k != s) for j in s.toPoints()] # <<<<<<<<<<<<<< * j = ps.index(False) * while True: */ -struct __pyx_obj_10collisions___pyx_scope_struct_35_genexpr { +struct __pyx_obj_10collisions___pyx_scope_struct_36_genexpr { PyObject_HEAD - struct __pyx_obj_10collisions___pyx_scope_struct_34_union *__pyx_outer_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_35_union *__pyx_outer_scope; PyObject *__pyx_genexpr_arg_0; PyObject *__pyx_v_k; }; @@ -2548,6 +2572,20 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x) #endif +/* ArgTypeTest.proto */ +#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ + ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ + __Pyx__ArgTypeTest(obj, type, name, exact)) +static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + +/* PyIntBinop.proto */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); +#else +#define __Pyx_PyInt_MultiplyObjC(op1, op2, intval, inplace, zerodivision_check)\ + (inplace ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2)) +#endif + /* PyObjectFormatSimple.proto */ #if CYTHON_COMPILING_IN_PYPY #define __Pyx_PyObject_FormatSimple(s, f) (\ @@ -2570,27 +2608,9 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) { PyObject_Format(s, f)) #endif -/* JoinPyUnicode.proto */ -static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, - Py_UCS4 max_char); - /* PyObjectCallOneArg.proto */ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); -/* ArgTypeTest.proto */ -#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ - ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\ - __Pyx__ArgTypeTest(obj, type, name, exact)) -static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); - -/* PyIntBinop.proto */ -#if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); -#else -#define __Pyx_PyInt_MultiplyObjC(op1, op2, intval, inplace, zerodivision_check)\ - (inplace ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2)) -#endif - /* PyObjectSetAttrStr.proto */ #if CYTHON_USE_TYPE_SLOTS #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL) @@ -2822,38 +2842,6 @@ static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name /* append.proto */ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x); -/* RaiseUnboundLocalError.proto */ -static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); - -/* GetException.proto */ -#if CYTHON_FAST_THREAD_STATE -#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) -static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#else -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); -#endif - -/* pep479.proto */ -static void __Pyx_Generator_Replace_StopIteration(int in_async_gen); - -/* ObjectGetItem.proto */ -#if CYTHON_USE_TYPE_SLOTS -static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); -#else -#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) -#endif - -/* py_abs.proto */ -#if CYTHON_USE_PYLONG_INTERNALS -static PyObject *__Pyx_PyLong_AbsNeg(PyObject *num); -#define __Pyx_PyNumber_Absolute(x)\ - ((likely(PyLong_CheckExact(x))) ?\ - (likely(__Pyx_PyLong_IsNonNeg(x)) ? (Py_INCREF(x), (x)) : __Pyx_PyLong_AbsNeg(x)) :\ - PyNumber_Absolute(x)) -#else -#define __Pyx_PyNumber_Absolute(x) PyNumber_Absolute(x) -#endif - /* RaiseClosureNameError.proto */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname); @@ -3005,6 +2993,42 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, PyObject *module, PyObject *globals, PyObject* code); +/* RaiseUnboundLocalError.proto */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname); + +/* GetException.proto */ +#if CYTHON_FAST_THREAD_STATE +#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); +#endif + +/* pep479.proto */ +static void __Pyx_Generator_Replace_StopIteration(int in_async_gen); + +/* ObjectGetItem.proto */ +#if CYTHON_USE_TYPE_SLOTS +static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key); +#else +#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) +#endif + +/* JoinPyUnicode.proto */ +static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, + Py_UCS4 max_char); + +/* py_abs.proto */ +#if CYTHON_USE_PYLONG_INTERNALS +static PyObject *__Pyx_PyLong_AbsNeg(PyObject *num); +#define __Pyx_PyNumber_Absolute(x)\ + ((likely(PyLong_CheckExact(x))) ?\ + (likely(__Pyx_PyLong_IsNonNeg(x)) ? (Py_INCREF(x), (x)) : __Pyx_PyLong_AbsNeg(x)) :\ + PyNumber_Absolute(x)) +#else +#define __Pyx_PyNumber_Absolute(x) PyNumber_Absolute(x) +#endif + /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); @@ -3056,18 +3080,18 @@ static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, lo /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyInt_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); +static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else -#define __Pyx_PyInt_MultiplyCObj(op1, op2, intval, inplace, zerodivision_check)\ - (inplace ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2)) +#define __Pyx_PyInt_TrueDivideObjC(op1, op2, intval, inplace, zerodivision_check)\ + (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2)) #endif /* PyIntBinop.proto */ #if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); +static PyObject* __Pyx_PyInt_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check); #else -#define __Pyx_PyInt_TrueDivideObjC(op1, op2, intval, inplace, zerodivision_check)\ - (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2)) +#define __Pyx_PyInt_MultiplyCObj(op1, op2, intval, inplace, zerodivision_check)\ + (inplace ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2)) #endif /* CallUnboundCMethod0.proto */ @@ -3407,13 +3431,13 @@ static PyObject *__pyx_builtin_staticmethod; static PyObject *__pyx_builtin_zip; static PyObject *__pyx_builtin_ValueError; static PyObject *__pyx_builtin_super; +static PyObject *__pyx_builtin_sorted; static PyObject *__pyx_builtin_sum; static PyObject *__pyx_builtin_min; static PyObject *__pyx_builtin_max; static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_IndexError; static PyObject *__pyx_builtin_round; -static PyObject *__pyx_builtin_sorted; static PyObject *__pyx_builtin_any; /* #### Code section: string_decls ### */ static const char __pyx_k_A[] = "A"; @@ -3446,11 +3470,11 @@ static const char __pyx_k_Dx[] = "Dx"; static const char __pyx_k_Dy[] = "Dy"; static const char __pyx_k_L1[] = "L1"; static const char __pyx_k_L2[] = "L2"; -static const char __pyx_k__3[] = "'"; -static const char __pyx_k__4[] = ""; -static const char __pyx_k__5[] = ">"; -static const char __pyx_k__6[] = ", "; -static const char __pyx_k__7[] = ")>"; +static const char __pyx_k__5[] = "'"; +static const char __pyx_k__6[] = ""; +static const char __pyx_k__7[] = ">"; +static const char __pyx_k__8[] = ", "; +static const char __pyx_k__9[] = ")>"; static const char __pyx_k_cp[] = "cp"; static const char __pyx_k_cs[] = "cs"; static const char __pyx_k_d1[] = "d1"; @@ -3468,6 +3492,8 @@ static const char __pyx_k_li[] = "li"; static const char __pyx_k_ln[] = "ln"; static const char __pyx_k_mx[] = "mx"; static const char __pyx_k_my[] = "my"; +static const char __pyx_k_nd[] = "nd"; +static const char __pyx_k_np[] = "np"; static const char __pyx_k_op[] = "op"; static const char __pyx_k_ox[] = "ox"; static const char __pyx_k_oy[] = "oy"; @@ -3494,6 +3520,7 @@ static const char __pyx_k_xb[] = "xb"; static const char __pyx_k_xi[] = "xi"; static const char __pyx_k_xj[] = "xj"; static const char __pyx_k_xk[] = "xk"; +static const char __pyx_k_xs[] = "xs"; static const char __pyx_k_xy[] = "xy"; static const char __pyx_k_y1[] = "y1"; static const char __pyx_k_y2[] = "y2"; @@ -3504,12 +3531,13 @@ static const char __pyx_k_yb[] = "yb"; static const char __pyx_k_yi[] = "yi"; static const char __pyx_k_yj[] = "yj"; static const char __pyx_k_yk[] = "yk"; +static const char __pyx_k_ys[] = "ys"; static const char __pyx_k_Any[] = "Any"; static const char __pyx_k_Arc[] = "Arc"; -static const char __pyx_k__24[] = "\302\260-"; -static const char __pyx_k__25[] = "\302\260>"; -static const char __pyx_k__36[] = "*"; -static const char __pyx_k__37[] = "."; +static const char __pyx_k__28[] = "\302\260-"; +static const char __pyx_k__29[] = "\302\260>"; +static const char __pyx_k__40[] = "*"; +static const char __pyx_k__41[] = "."; static const char __pyx_k_all[] = "__all__"; static const char __pyx_k_any[] = "any"; static const char __pyx_k_arc[] = "arc"; @@ -3546,13 +3574,12 @@ static const char __pyx_k_sum[] = "sum"; static const char __pyx_k_vel[] = "vel"; static const char __pyx_k_xpt[] = "xpt"; static const char __pyx_k_zip[] = "zip"; -static const char __pyx_k_Dict[] = "Dict"; static const char __pyx_k_Line[] = "Line"; static const char __pyx_k_None[] = "None"; static const char __pyx_k_Rect[] = "Rect"; static const char __pyx_k_TYPE[] = "TYPE"; -static const char __pyx_k__147[] = "_"; -static const char __pyx_k__324[] = "?"; +static const char __pyx_k__156[] = "_"; +static const char __pyx_k__337[] = "?"; static const char __pyx_k_alls[] = "alls"; static const char __pyx_k_area[] = "area"; static const char __pyx_k_args[] = "args"; @@ -3609,12 +3636,14 @@ static const char __pyx_k_cache[] = "cache"; static const char __pyx_k_check[] = "check"; static const char __pyx_k_class[] = "__class__"; static const char __pyx_k_close[] = "close"; +static const char __pyx_k_collP[] = "collP"; static const char __pyx_k_colls[] = "colls"; static const char __pyx_k_direc[] = "direc"; static const char __pyx_k_float[] = "float"; static const char __pyx_k_geoms[] = "geoms"; static const char __pyx_k_hypot[] = "hypot"; static const char __pyx_k_index[] = "index"; +static const char __pyx_k_lines[] = "lines"; static const char __pyx_k_newp1[] = "newp1"; static const char __pyx_k_newp2[] = "newp2"; static const char __pyx_k_odiff[] = "odiff"; @@ -3662,6 +3691,7 @@ static const char __pyx_k_coords[] = "coords"; static const char __pyx_k_enable[] = "enable"; static const char __pyx_k_endAng[] = "endAng"; static const char __pyx_k_extend[] = "extend"; +static const char __pyx_k_factor[] = "factor"; static const char __pyx_k_import[] = "__import__"; static const char __pyx_k_merged[] = "merged"; static const char __pyx_k_module[] = "__module__"; @@ -3734,6 +3764,7 @@ static const char __pyx_k_Arc_flip[] = "Arc.flip"; static const char __pyx_k_Arc_rect[] = "Arc.rect"; static const char __pyx_k_Circle_2[] = ".genexpr"; static const char __pyx_k_ShapeCombiner_union_locals_lambd[] = "ShapeCombiner.union.."; static const char __pyx_k_ShapeCombiner_union_locals_refor[] = "ShapeCombiner.union..reformat"; +static const char __pyx_k_Shapes_closestPointTo_locals_sor[] = "Shapes.closestPointTo..sortFunc"; static const char __pyx_k_The_base_Shape_class_This_defaul[] = "The base Shape class. This defaults to always collide.\n This class always collides; so *can* be used as an infinite plane, but why?"; static const char __pyx_k_Union_Shape_Shapes_Iterable_Shap[] = "Union['Shape', 'Shapes', Iterable['Shape']]"; static const char __pyx_k_Union_pointLike_Iterable_pointLi[] = "Union[pointLike, Iterable[pointLike]]"; @@ -4135,6 +4168,7 @@ static const char __pyx_k_ClosedShape_handleCollisionsPos_2[] = "ClosedShape.han static const char __pyx_k_List_index_out_of_range_Must_be_2[] = "List index out of range! Must be 0-2, found: "; static const char __pyx_k_List_index_out_of_range_Must_be_3[] = "List index out of range! Must be 0-4, found: "; static const char __pyx_k_List_index_out_of_range_Must_be_4[] = "List index out of range! Must be 0-3, found: "; +static const char __pyx_k_Circle_handleCollisionsPos_local_2[] = "Circle.handleCollisionsPos..calculate"; static const char __pyx_k_ClosedShape_closestPointTo_local_2[] = "ClosedShape.closestPointTo..calculate"; static const char __pyx_k_Union_Shape_Shapes_Iterable_Shap_2[] = "Union[Shape, 'Shapes', Iterable[Shape]]"; /* #### Code section: decls ### */ @@ -4182,35 +4216,39 @@ static PyObject *__pyx_pf_10collisions_7NoShape_6_contains(CYTHON_UNUSED PyObjec static PyObject *__pyx_pf_10collisions_7NoShape_8area(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_7NoShape_10copy(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_7NoShape_12__str__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_6Shapes___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_shapes); /* proto */ +static PyObject *__pyx_pf_10collisions_26__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_10collisions_6Shapes___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, double __pyx_v_bounciness, PyObject *__pyx_v_shapes); /* proto */ static PyObject *__pyx_pf_10collisions_6Shapes_2add_shape(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_shape); /* proto */ static PyObject *__pyx_pf_10collisions_6Shapes_4add_shapes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_shapes); /* proto */ static PyObject *__pyx_pf_10collisions_6Shapes_6remove_shape(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_shape); /* proto */ static PyObject *__pyx_pf_10collisions_6Shapes_8remove_shapes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_shapes); /* proto */ static PyObject *__pyx_pf_10collisions_6Shapes_10collides(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_shapes); /* proto */ static PyObject *__pyx_pf_10collisions_6Shapes_12whereCollides(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_shapes); /* proto */ +static PyObject *__pyx_pf_10collisions_6Shapes_14closestPointTo_sortFunc(PyObject *__pyx_self, PyObject *__pyx_v_p); /* proto */ static PyObject *__pyx_pf_10collisions_6Shapes_14closestPointTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape, PyObject *__pyx_v_returnAll); /* proto */ static PyObject *__pyx_pf_10collisions_6Shapes_16isContaining(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ -static PyObject *__pyx_pf_10collisions_26__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_10collisions_28__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_10collisions_6Shapes_18isCorner(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_precision); /* proto */ static PyObject *__pyx_pf_10collisions_6Shapes_20tangent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_vel); /* proto */ +static PyObject *__pyx_pf_10collisions_6Shapes_22toPoints(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_6Shapes_24toLines(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_6Shapes_4area_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ -static PyObject *__pyx_pf_10collisions_6Shapes_22area(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_6Shapes_26area(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_6Shapes_4rect_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_10collisions_6Shapes_4rect_3genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_10collisions_6Shapes_4rect_6genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_10collisions_6Shapes_4rect_9genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ -static PyObject *__pyx_pf_10collisions_6Shapes_24rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_6Shapes_28rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_6Shapes_4copy_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ -static PyObject *__pyx_pf_10collisions_6Shapes_26copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_6Shapes_28copy_leave_shapes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_6Shapes_30__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_6Shapes_32__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_6Shapes_34__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ -static PyObject *__pyx_pf_10collisions_6Shapes_36__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_new); /* proto */ -static PyObject *__pyx_pf_10collisions_6Shapes_38__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_6Shapes_40__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_28__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_10collisions_6Shapes_30copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_6Shapes_32copy_leave_shapes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_6Shapes_34__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_6Shapes_36__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_6Shapes_38__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_index); /* proto */ +static PyObject *__pyx_pf_10collisions_6Shapes_40__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_new); /* proto */ +static PyObject *__pyx_pf_10collisions_6Shapes_42__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_6Shapes_44__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_30__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_10collisions_5Point___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, double __pyx_v_bounciness); /* proto */ static PyObject *__pyx_pf_10collisions_5Point_2rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_5Point_4area(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ @@ -4220,17 +4258,17 @@ static PyObject *__pyx_pf_10collisions_5Point_10_where(CYTHON_UNUSED PyObject *_ static PyObject *__pyx_pf_10collisions_5Point_12closestPointTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_othershape, PyObject *__pyx_v_returnAll); /* proto */ static PyObject *__pyx_pf_10collisions_5Point_14getTuple(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_5Point_16_contains(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_othershape); /* proto */ -static PyObject *__pyx_pf_10collisions_30__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_10collisions_32__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda6(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_10collisions_5Point_18handleCollisionsPos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_oldPoint, PyObject *__pyx_v_newPoint, PyObject *__pyx_v_objs, PyObject *__pyx_v_vel, PyObject *__pyx_v_replaceSelf, PyObject *__pyx_v_precision, PyObject *__pyx_v_verbose); /* proto */ -static PyObject *__pyx_pf_10collisions_32__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_10collisions_34__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_10collisions_5Point_20handleCollisionsVel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_vel, PyObject *__pyx_v_objs, PyObject *__pyx_v_replaceSelf, PyObject *__pyx_v_precision, PyObject *__pyx_v_verbose); /* proto */ static PyObject *__pyx_pf_10collisions_5Point_22copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_5Point_24__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static PyObject *__pyx_pf_10collisions_5Point_26__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_new); /* proto */ static PyObject *__pyx_pf_10collisions_5Point_28__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_5Point_30__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_34__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_10collisions_36__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_10collisions_4Line___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2, double __pyx_v_bounciness); /* proto */ static PyObject *__pyx_pf_10collisions_4Line_2area(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_4Line_4x(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ @@ -4251,50 +4289,53 @@ static PyObject *__pyx_pf_10collisions_4Line_14closestPointTo_2calculate(PyObjec static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_10collisions_4Line_26closestPointTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape, PyObject *__pyx_v_returnAll); /* proto */ -static PyObject *__pyx_pf_10collisions_36__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_10collisions_38__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_10collisions_4Line_8isCorner_rountTuple(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_10collisions_4Line_28isCorner(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_precision); /* proto */ static PyObject *__pyx_pf_10collisions_4Line_7tangent_fixangle(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_angle); /* proto */ static PyObject *__pyx_pf_10collisions_4Line_30tangent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_vel); /* proto */ -static PyObject *__pyx_pf_10collisions_38__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_10collisions_40__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda9(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda10(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda11(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda12(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_oldLine, PyObject *__pyx_v_newLine, PyObject *__pyx_v_objs, PyObject *__pyx_v_vel, PyObject *__pyx_v_replaceSelf, PyObject *__pyx_v_precision, PyObject *__pyx_v_verbose); /* proto */ -static PyObject *__pyx_pf_10collisions_40__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_10collisions_42__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_10collisions_4Line_34handleCollisionsVel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_vel, PyObject *__pyx_v_objs, PyObject *__pyx_v_replaceSelf, PyObject *__pyx_v_precision, PyObject *__pyx_v_verbose); /* proto */ static PyObject *__pyx_pf_10collisions_4Line_36copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_4Line_38__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static PyObject *__pyx_pf_10collisions_4Line_40__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_new); /* proto */ static PyObject *__pyx_pf_10collisions_4Line_42__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_4Line_44__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_42__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_10collisions_44__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_10collisions_6Circle___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, double __pyx_v_bounciness); /* proto */ -static PyObject *__pyx_pf_10collisions_6Circle_2rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_6Circle_4area(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_6Circle_2d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_6Circle_4d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ +static PyObject *__pyx_pf_10collisions_6Circle_6rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_6Circle_8area(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_6Circle_9_contains_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ -static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ -static PyObject *__pyx_pf_10collisions_6Circle_8_collides(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ +static PyObject *__pyx_pf_10collisions_6Circle_10_contains(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ +static PyObject *__pyx_pf_10collisions_6Circle_12_collides(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ static PyObject *__pyx_pf_10collisions_6Circle_6_where_sign(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ -static PyObject *__pyx_pf_10collisions_6Circle_10_where(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ +static PyObject *__pyx_pf_10collisions_6Circle_14_where(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda14(PyObject *__pyx_self, PyObject *__pyx_v_p); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda15(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ -static PyObject *__pyx_pf_10collisions_6Circle_12closestPointTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape, PyObject *__pyx_v_returnAll); /* proto */ -static PyObject *__pyx_pf_10collisions_44__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_lambda_funcdef_lambda16(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ -static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_oldCir, PyObject *__pyx_v_newCir, PyObject *__pyx_v_objs, PyObject *__pyx_v_vel, PyObject *__pyx_v_replaceSelf, PyObject *__pyx_v_precision, PyObject *__pyx_v_verbose); /* proto */ +static PyObject *__pyx_pf_10collisions_6Circle_16closestPointTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape, PyObject *__pyx_v_returnAll); /* proto */ static PyObject *__pyx_pf_10collisions_46__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_10collisions_6Circle_16handleCollisionsVel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_vel, PyObject *__pyx_v_objs, PyObject *__pyx_v_replaceSelf, PyObject *__pyx_v_precision, PyObject *__pyx_v_verbose); /* proto */ +static PyObject *__pyx_pf_10collisions_6Circle_19handleCollisionsPos_calculate(PyObject *__pyx_self, PyObject *__pyx_v_point); /* proto */ +static PyObject *__pyx_lambda_funcdef_lambda16(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ +static PyObject *__pyx_pf_10collisions_6Circle_18handleCollisionsPos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_oldCir, PyObject *__pyx_v_newCir, PyObject *__pyx_v_objs, PyObject *__pyx_v_vel, PyObject *__pyx_v_unstuckable, PyObject *__pyx_v_maxTries, PyObject *__pyx_v_replaceSelf, PyObject *__pyx_v_precision, PyObject *__pyx_v_verbose); /* proto */ static PyObject *__pyx_pf_10collisions_48__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ -static PyObject *__pyx_pf_10collisions_6Circle_18isCorner(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_point, CYTHON_UNUSED PyObject *__pyx_v_precision); /* proto */ -static PyObject *__pyx_pf_10collisions_6Circle_20tangent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, CYTHON_UNUSED PyObject *__pyx_v_vel); /* proto */ -static PyObject *__pyx_pf_10collisions_6Circle_22copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_6Circle_24__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ -static PyObject *__pyx_pf_10collisions_6Circle_26__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_new); /* proto */ -static PyObject *__pyx_pf_10collisions_6Circle_28__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_6Circle_30__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_6Circle_20handleCollisionsVel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_vel, PyObject *__pyx_v_objs, PyObject *__pyx_v_replaceSelf, PyObject *__pyx_v_unstuckable, PyObject *__pyx_v_maxTries, PyObject *__pyx_v_precision, PyObject *__pyx_v_verbose); /* proto */ static PyObject *__pyx_pf_10collisions_50__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_10collisions_6Circle_22isCorner(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_point, CYTHON_UNUSED PyObject *__pyx_v_precision); /* proto */ +static PyObject *__pyx_pf_10collisions_6Circle_24tangent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, CYTHON_UNUSED PyObject *__pyx_v_vel); /* proto */ +static PyObject *__pyx_pf_10collisions_6Circle_26copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_6Circle_28__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ +static PyObject *__pyx_pf_10collisions_6Circle_30__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_new); /* proto */ +static PyObject *__pyx_pf_10collisions_6Circle_32__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_6Circle_34__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_10collisions_52__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_10collisions_3Arc___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_rad, PyObject *__pyx_v_startAngle, PyObject *__pyx_v_endAngle, PyObject *__pyx_v_precision, double __pyx_v_bounciness); /* proto */ static PyObject *__pyx_pf_10collisions_3Arc_2area(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_3Arc_9_collides_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ @@ -4311,7 +4352,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_14constrainAng(CYTHON_UNUSED PyObjec static PyObject *__pyx_pf_10collisions_3Arc_16angleInRange(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_angle); /* proto */ static PyObject *__pyx_pf_10collisions_3Arc_18endPoints(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_3Arc_20rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_52__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_10collisions_54__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_10collisions_3Arc_22isCorner(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_precision); /* proto */ static PyObject *__pyx_pf_10collisions_3Arc_24toPoints(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_3Arc_26copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ @@ -4330,25 +4371,25 @@ static PyObject *__pyx_lambda_funcdef_lambda22(CYTHON_UNUSED PyObject *__pyx_sel static PyObject *__pyx_lambda_funcdef_lambda23(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda24(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape, PyObject *__pyx_v_returnAll); /* proto */ -static PyObject *__pyx_pf_10collisions_54__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_10collisions_56__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda25(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda26(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda27(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda28(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_oldShp, PyObject *__pyx_v_newShp, PyObject *__pyx_v_objs, PyObject *__pyx_v_vel, PyObject *__pyx_v_replaceSelf, PyObject *__pyx_v_precision, PyObject *__pyx_v_verbose); /* proto */ -static PyObject *__pyx_pf_10collisions_56__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_10collisions_58__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_10collisions_11ClosedShape_8handleCollisionsVel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_vel, PyObject *__pyx_v_objs, PyObject *__pyx_v_replaceSelf, PyObject *__pyx_v_precision, PyObject *__pyx_v_verbose); /* proto */ static PyObject *__pyx_pf_10collisions_11ClosedShape_10_containsPoint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point); /* proto */ static PyObject *__pyx_pf_10collisions_11ClosedShape_9_contains_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape); /* proto */ -static PyObject *__pyx_pf_10collisions_58__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_10collisions_60__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_10collisions_11ClosedShape_14isCorner(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_precision); /* proto */ static PyObject *__pyx_pf_10collisions_11ClosedShape_16toLines(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_11ClosedShape_18toPoints(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_11ClosedShape_20__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item); /* proto */ static PyObject *__pyx_pf_10collisions_11ClosedShape_22__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_11ClosedShape_24__str__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_60__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_10collisions_62__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_10collisions_4Rect___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_w, PyObject *__pyx_v_h, double __pyx_v_bounciness); /* proto */ static PyObject *__pyx_pf_10collisions_4Rect_2rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_4Rect_4area(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ @@ -4360,7 +4401,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_12toPoints(CYTHON_UNUSED PyObject * static PyObject *__pyx_pf_10collisions_4Rect_14copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_4Rect_16__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_new); /* proto */ static PyObject *__pyx_pf_10collisions_4Rect_18__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_62__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_10collisions_64__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_10collisions_11RotatedRect___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_w, PyObject *__pyx_v_h, PyObject *__pyx_v_rotation, double __pyx_v_bounciness); /* proto */ static PyObject *__pyx_pf_10collisions_11RotatedRect_8getCache_rot(PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_10collisions_11RotatedRect_2getCache(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ @@ -4375,7 +4416,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16copy(CYTHON_UNUSED PyObje static PyObject *__pyx_pf_10collisions_11RotatedRect_11__setitem___rot(PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y); /* proto */ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_new); /* proto */ static PyObject *__pyx_pf_10collisions_11RotatedRect_20__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_10collisions_64__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_10collisions_66__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_10collisions_7Polygon___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_errorOnLT3, double __pyx_v_bounciness, PyObject *__pyx_v_points); /* proto */ static PyObject *__pyx_pf_10collisions_7Polygon_2x(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */ static PyObject *__pyx_pf_10collisions_7Polygon_4x(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_new); /* proto */ @@ -4399,50 +4440,51 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_boundingBox(CYTHON_UNUSED static PyObject *__pyx_lambda_funcdef_lambda38(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda39(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_shapes); /* proto */ -static PyObject *__pyx_pf_10collisions_13ShapeCombiner_5union_reformat(PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */ +static PyObject *__pyx_pf_10collisions_13ShapeCombiner_5union_reformat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj); /* proto */ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_5union_9genexpr81_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0); /* proto */ static PyObject *__pyx_lambda_funcdef_lambda41(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_shapes); /* proto */ -static PyObject *__pyx_pf_10collisions_66__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ +static PyObject *__pyx_pf_10collisions_68__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_bounciness, PyObject *__pyx_v_points); /* proto */ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_8pointsToPoly(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_ratio, PyObject *__pyx_v_points); /* proto */ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_10shapelyUnion(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_shapes); /* proto */ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct__closestPointTo(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_2_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_4_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_5_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_6_handleCollisionsPos(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_7_closestPointTo(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_8_isCorner(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_9__contains(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_10_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_11_closestPointTo(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_12_handleCollisionsPos(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_13__collides(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_14_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_15_closestPointTo(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_16_tangent(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_17_closestPointTo(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_18__contains(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_19_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_20__collides(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_21_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_22_getCache(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_23__collides(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_24_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_25___setitem__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_26_area(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_27_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_28__collides(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_29_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_6_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_7_handleCollisionsPos(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_8_closestPointTo(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_9_isCorner(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_10__contains(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_11_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_12_closestPointTo(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_13_handleCollisionsPos(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_14__collides(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_15_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_16_closestPointTo(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_17_tangent(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_18_closestPointTo(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_19__contains(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_20_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_21__collides(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_22_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_23_getCache(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_24__collides(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_25_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_26___setitem__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_27_area(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_28_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_29__collides(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_30_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_31_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_32_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_33_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_34_union(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_35_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_34_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_35_union(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_36_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_copy = {0, 0, 0, 0, 0}; static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_index = {0, 0, 0, 0, 0}; static __Pyx_CachedCFunction __pyx_umethod_PySet_Type_intersection = {0, 0, 0, 0, 0}; @@ -4474,79 +4516,81 @@ typedef struct { PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE - PyObject *__pyx_type_10collisions___pyx_scope_struct__genexpr; + PyObject *__pyx_type_10collisions___pyx_scope_struct__closestPointTo; PyObject *__pyx_type_10collisions___pyx_scope_struct_1_genexpr; PyObject *__pyx_type_10collisions___pyx_scope_struct_2_genexpr; PyObject *__pyx_type_10collisions___pyx_scope_struct_3_genexpr; PyObject *__pyx_type_10collisions___pyx_scope_struct_4_genexpr; PyObject *__pyx_type_10collisions___pyx_scope_struct_5_genexpr; - PyObject *__pyx_type_10collisions___pyx_scope_struct_6_handleCollisionsPos; - PyObject *__pyx_type_10collisions___pyx_scope_struct_7_closestPointTo; - PyObject *__pyx_type_10collisions___pyx_scope_struct_8_isCorner; - PyObject *__pyx_type_10collisions___pyx_scope_struct_9__contains; - PyObject *__pyx_type_10collisions___pyx_scope_struct_10_genexpr; - PyObject *__pyx_type_10collisions___pyx_scope_struct_11_closestPointTo; - PyObject *__pyx_type_10collisions___pyx_scope_struct_12_handleCollisionsPos; - PyObject *__pyx_type_10collisions___pyx_scope_struct_13__collides; - PyObject *__pyx_type_10collisions___pyx_scope_struct_14_genexpr; - PyObject *__pyx_type_10collisions___pyx_scope_struct_15_closestPointTo; - PyObject *__pyx_type_10collisions___pyx_scope_struct_16_tangent; - PyObject *__pyx_type_10collisions___pyx_scope_struct_17_closestPointTo; - PyObject *__pyx_type_10collisions___pyx_scope_struct_18__contains; - PyObject *__pyx_type_10collisions___pyx_scope_struct_19_genexpr; - PyObject *__pyx_type_10collisions___pyx_scope_struct_20__collides; - PyObject *__pyx_type_10collisions___pyx_scope_struct_21_genexpr; - PyObject *__pyx_type_10collisions___pyx_scope_struct_22_getCache; - PyObject *__pyx_type_10collisions___pyx_scope_struct_23__collides; - PyObject *__pyx_type_10collisions___pyx_scope_struct_24_genexpr; - PyObject *__pyx_type_10collisions___pyx_scope_struct_25___setitem__; - PyObject *__pyx_type_10collisions___pyx_scope_struct_26_area; - PyObject *__pyx_type_10collisions___pyx_scope_struct_27_genexpr; - PyObject *__pyx_type_10collisions___pyx_scope_struct_28__collides; - PyObject *__pyx_type_10collisions___pyx_scope_struct_29_genexpr; + PyObject *__pyx_type_10collisions___pyx_scope_struct_6_genexpr; + PyObject *__pyx_type_10collisions___pyx_scope_struct_7_handleCollisionsPos; + PyObject *__pyx_type_10collisions___pyx_scope_struct_8_closestPointTo; + PyObject *__pyx_type_10collisions___pyx_scope_struct_9_isCorner; + PyObject *__pyx_type_10collisions___pyx_scope_struct_10__contains; + PyObject *__pyx_type_10collisions___pyx_scope_struct_11_genexpr; + PyObject *__pyx_type_10collisions___pyx_scope_struct_12_closestPointTo; + PyObject *__pyx_type_10collisions___pyx_scope_struct_13_handleCollisionsPos; + PyObject *__pyx_type_10collisions___pyx_scope_struct_14__collides; + PyObject *__pyx_type_10collisions___pyx_scope_struct_15_genexpr; + PyObject *__pyx_type_10collisions___pyx_scope_struct_16_closestPointTo; + PyObject *__pyx_type_10collisions___pyx_scope_struct_17_tangent; + PyObject *__pyx_type_10collisions___pyx_scope_struct_18_closestPointTo; + PyObject *__pyx_type_10collisions___pyx_scope_struct_19__contains; + PyObject *__pyx_type_10collisions___pyx_scope_struct_20_genexpr; + PyObject *__pyx_type_10collisions___pyx_scope_struct_21__collides; + PyObject *__pyx_type_10collisions___pyx_scope_struct_22_genexpr; + PyObject *__pyx_type_10collisions___pyx_scope_struct_23_getCache; + PyObject *__pyx_type_10collisions___pyx_scope_struct_24__collides; + PyObject *__pyx_type_10collisions___pyx_scope_struct_25_genexpr; + PyObject *__pyx_type_10collisions___pyx_scope_struct_26___setitem__; + PyObject *__pyx_type_10collisions___pyx_scope_struct_27_area; + PyObject *__pyx_type_10collisions___pyx_scope_struct_28_genexpr; + PyObject *__pyx_type_10collisions___pyx_scope_struct_29__collides; PyObject *__pyx_type_10collisions___pyx_scope_struct_30_genexpr; PyObject *__pyx_type_10collisions___pyx_scope_struct_31_genexpr; PyObject *__pyx_type_10collisions___pyx_scope_struct_32_genexpr; PyObject *__pyx_type_10collisions___pyx_scope_struct_33_genexpr; - PyObject *__pyx_type_10collisions___pyx_scope_struct_34_union; - PyObject *__pyx_type_10collisions___pyx_scope_struct_35_genexpr; + PyObject *__pyx_type_10collisions___pyx_scope_struct_34_genexpr; + PyObject *__pyx_type_10collisions___pyx_scope_struct_35_union; + PyObject *__pyx_type_10collisions___pyx_scope_struct_36_genexpr; #endif - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct__genexpr; + PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct__closestPointTo; PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_1_genexpr; PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_2_genexpr; PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_3_genexpr; PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_4_genexpr; PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_5_genexpr; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_6_handleCollisionsPos; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_7_closestPointTo; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_8_isCorner; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_9__contains; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_10_genexpr; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_11_closestPointTo; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_12_handleCollisionsPos; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_13__collides; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_14_genexpr; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_15_closestPointTo; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_16_tangent; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_17_closestPointTo; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_18__contains; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_19_genexpr; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_20__collides; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_21_genexpr; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_22_getCache; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_23__collides; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_24_genexpr; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_25___setitem__; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_26_area; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_27_genexpr; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_28__collides; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_29_genexpr; + PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_6_genexpr; + PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_7_handleCollisionsPos; + PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_8_closestPointTo; + PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_9_isCorner; + PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_10__contains; + PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_11_genexpr; + PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_12_closestPointTo; + PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_13_handleCollisionsPos; + PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_14__collides; + PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_15_genexpr; + PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_16_closestPointTo; + PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_17_tangent; + PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_18_closestPointTo; + PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_19__contains; + PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_20_genexpr; + PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_21__collides; + PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_22_genexpr; + PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_23_getCache; + PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_24__collides; + PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_25_genexpr; + PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_26___setitem__; + PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_27_area; + PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_28_genexpr; + PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_29__collides; PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_30_genexpr; PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_31_genexpr; PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_32_genexpr; PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_33_genexpr; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_34_union; - PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_35_genexpr; + PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_34_genexpr; + PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_35_union; + PyTypeObject *__pyx_ptype_10collisions___pyx_scope_struct_36_genexpr; PyObject *__pyx_n_s_A; PyObject *__pyx_n_s_AVERYSMALLNUMBER; PyObject *__pyx_kp_s_A_Rectangle_It_is_defined_with_a; @@ -4592,8 +4636,6 @@ typedef struct { PyObject *__pyx_n_s_BASEPRECISION; PyObject *__pyx_n_s_C; PyObject *__pyx_n_s_CLOSED; - PyObject *__pyx_kp_u_Cannot_convert_BlazeSudio_shape; - PyObject *__pyx_kp_u_Cannot_convert_shapely_shape_of; PyObject *__pyx_kp_u_Cannot_draw_BlazeSudio_shape_of; PyObject *__pyx_kp_u_Cannot_have_a_Polygon_with_less; PyObject *__pyx_n_s_Circle; @@ -4614,8 +4656,10 @@ typedef struct { PyObject *__pyx_n_s_Circle_closestPointTo; PyObject *__pyx_n_s_Circle_closestPointTo_locals_lam; PyObject *__pyx_n_s_Circle_copy; + PyObject *__pyx_n_s_Circle_d; PyObject *__pyx_n_s_Circle_handleCollisionsPos; PyObject *__pyx_n_s_Circle_handleCollisionsPos_local; + PyObject *__pyx_n_s_Circle_handleCollisionsPos_local_2; PyObject *__pyx_n_s_Circle_handleCollisionsVel; PyObject *__pyx_n_s_Circle_isCorner; PyObject *__pyx_n_s_Circle_rect; @@ -4644,8 +4688,6 @@ typedef struct { PyObject *__pyx_n_s_ClosedShape_toPoints; PyObject *__pyx_kp_u_Closed_Shape; PyObject *__pyx_n_s_D; - PyObject *__pyx_n_s_Dict; - PyObject *__pyx_kp_s_Dict_Union_Shape_Shapes_bool; PyObject *__pyx_n_s_Dx; PyObject *__pyx_n_s_Dy; PyObject *__pyx_n_s_E; @@ -4793,6 +4835,7 @@ typedef struct { PyObject *__pyx_n_s_RotatedRect_toLines; PyObject *__pyx_n_s_RotatedRect_toPoints; PyObject *__pyx_n_s_S; + PyObject *__pyx_n_s_SPLITTABLE; PyObject *__pyx_n_s_Shape; PyObject *__pyx_n_u_Shape; PyObject *__pyx_n_s_ShapeCombiner; @@ -4849,6 +4892,7 @@ typedef struct { PyObject *__pyx_n_s_Shapes_area; PyObject *__pyx_n_s_Shapes_area_locals_genexpr; PyObject *__pyx_n_s_Shapes_closestPointTo; + PyObject *__pyx_n_s_Shapes_closestPointTo_locals_sor; PyObject *__pyx_n_s_Shapes_collides; PyObject *__pyx_n_s_Shapes_copy; PyObject *__pyx_n_s_Shapes_copy_leave_shapes; @@ -4860,6 +4904,8 @@ typedef struct { PyObject *__pyx_n_s_Shapes_remove_shape; PyObject *__pyx_n_s_Shapes_remove_shapes; PyObject *__pyx_n_s_Shapes_tangent; + PyObject *__pyx_n_s_Shapes_toLines; + PyObject *__pyx_n_s_Shapes_toPoints; PyObject *__pyx_n_s_Shapes_whereCollides; PyObject *__pyx_kp_u_Shapes_with_shapes; PyObject *__pyx_n_s_ShpGroups; @@ -4884,17 +4930,17 @@ typedef struct { PyObject *__pyx_kp_s_Union_pointLike_Iterable_pointLi; PyObject *__pyx_n_s_ValueError; PyObject *__pyx_n_s_W; - PyObject *__pyx_n_s__147; - PyObject *__pyx_kp_u__24; - PyObject *__pyx_kp_u__25; - PyObject *__pyx_kp_u__3; - PyObject *__pyx_n_s__324; - PyObject *__pyx_n_s__36; - PyObject *__pyx_kp_u__37; - PyObject *__pyx_kp_u__4; + PyObject *__pyx_n_s__156; + PyObject *__pyx_kp_u__28; + PyObject *__pyx_kp_u__29; + PyObject *__pyx_n_s__337; + PyObject *__pyx_n_s__40; + PyObject *__pyx_kp_u__41; PyObject *__pyx_kp_u__5; PyObject *__pyx_kp_u__6; PyObject *__pyx_kp_u__7; + PyObject *__pyx_kp_u__8; + PyObject *__pyx_kp_u__9; PyObject *__pyx_n_s_a; PyObject *__pyx_n_s_add_shape; PyObject *__pyx_n_s_add_shapes; @@ -4945,6 +4991,7 @@ typedef struct { PyObject *__pyx_n_s_closestP; PyObject *__pyx_n_s_closestPointTo; PyObject *__pyx_n_s_closests; + PyObject *__pyx_n_s_collP; PyObject *__pyx_n_s_collShape; PyObject *__pyx_n_s_collToShapely; PyObject *__pyx_n_u_collToShapely; @@ -5006,6 +5053,7 @@ typedef struct { PyObject *__pyx_n_s_errorOnLT3; PyObject *__pyx_n_s_extend; PyObject *__pyx_n_s_exterior; + PyObject *__pyx_n_s_factor; PyObject *__pyx_n_s_fixangle; PyObject *__pyx_n_s_flip; PyObject *__pyx_n_s_float; @@ -5052,12 +5100,14 @@ typedef struct { PyObject *__pyx_kp_s_lib_collisions_py; PyObject *__pyx_n_s_line; PyObject *__pyx_n_s_line_mag; + PyObject *__pyx_n_s_lines; PyObject *__pyx_kp_s_list_Point; PyObject *__pyx_n_s_ln; PyObject *__pyx_n_s_lns; PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_math; PyObject *__pyx_n_s_max; + PyObject *__pyx_n_s_maxTries; PyObject *__pyx_n_s_maxs; PyObject *__pyx_n_s_merged; PyObject *__pyx_n_s_metaclass; @@ -5071,6 +5121,7 @@ typedef struct { PyObject *__pyx_n_s_mycp; PyObject *__pyx_n_s_n; PyObject *__pyx_n_s_name; + PyObject *__pyx_n_s_nd; PyObject *__pyx_n_s_new; PyObject *__pyx_n_s_newCir; PyObject *__pyx_n_s_newLine; @@ -5083,6 +5134,7 @@ typedef struct { PyObject *__pyx_n_s_newp2; PyObject *__pyx_n_s_newpts; PyObject *__pyx_n_s_normal; + PyObject *__pyx_n_s_np; PyObject *__pyx_n_s_o; PyObject *__pyx_n_s_obj; PyObject *__pyx_n_s_objs; @@ -5201,6 +5253,7 @@ typedef struct { PyObject *__pyx_n_s_smallness; PyObject *__pyx_n_s_snd; PyObject *__pyx_n_s_sort; + PyObject *__pyx_n_s_sortFunc; PyObject *__pyx_n_s_sorted; PyObject *__pyx_n_s_sortedOtherLn; PyObject *__pyx_n_s_spec; @@ -5229,9 +5282,7 @@ typedef struct { PyObject *__pyx_n_s_toLines; PyObject *__pyx_n_s_toPoint; PyObject *__pyx_n_s_toPoints; - PyObject *__pyx_kp_u_to_BlazeSudio_Shape; PyObject *__pyx_kp_u_to_have_points; - PyObject *__pyx_kp_u_to_shapely_shape; PyObject *__pyx_n_s_tries; PyObject *__pyx_kp_s_tuple_Circle_pointLike_verboseOu; PyObject *__pyx_kp_s_tuple_ClosedShape_pointLike_verb; @@ -5246,6 +5297,7 @@ typedef struct { PyObject *__pyx_n_s_u; PyObject *__pyx_n_s_unary_union; PyObject *__pyx_n_s_union; + PyObject *__pyx_n_s_unstuckable; PyObject *__pyx_n_s_value; PyObject *__pyx_n_s_vel; PyObject *__pyx_n_s_velDiff; @@ -5276,6 +5328,7 @@ typedef struct { PyObject *__pyx_n_s_xj; PyObject *__pyx_n_s_xk; PyObject *__pyx_n_s_xpt; + PyObject *__pyx_n_s_xs; PyObject *__pyx_n_s_xy; PyObject *__pyx_n_s_y; PyObject *__pyx_n_s_y1; @@ -5290,6 +5343,7 @@ typedef struct { PyObject *__pyx_n_s_yi; PyObject *__pyx_n_s_yj; PyObject *__pyx_n_s_yk; + PyObject *__pyx_n_s_ys; PyObject *__pyx_n_s_zip; PyObject *__pyx_float_0_0; PyObject *__pyx_float_0_1; @@ -5301,6 +5355,8 @@ typedef struct { PyObject *__pyx_int_3; PyObject *__pyx_int_4; PyObject *__pyx_int_5; + PyObject *__pyx_int_10; + PyObject *__pyx_int_50; PyObject *__pyx_int_90; PyObject *__pyx_int_180; PyObject *__pyx_int_270; @@ -5316,279 +5372,282 @@ typedef struct { PyObject *__pyx_int_neg_9; PyObject *__pyx_tuple_; PyObject *__pyx_tuple__2; - PyObject *__pyx_tuple__8; + PyObject *__pyx_tuple__3; PyObject *__pyx_tuple__10; PyObject *__pyx_tuple__12; - PyObject *__pyx_tuple__15; + PyObject *__pyx_tuple__14; PyObject *__pyx_tuple__17; - PyObject *__pyx_tuple__20; + PyObject *__pyx_tuple__19; PyObject *__pyx_tuple__22; + PyObject *__pyx_tuple__24; PyObject *__pyx_tuple__26; - PyObject *__pyx_tuple__28; - PyObject *__pyx_tuple__31; - PyObject *__pyx_tuple__34; + PyObject *__pyx_tuple__30; + PyObject *__pyx_tuple__32; + PyObject *__pyx_tuple__35; PyObject *__pyx_tuple__38; - PyObject *__pyx_tuple__39; - PyObject *__pyx_tuple__41; + PyObject *__pyx_tuple__42; PyObject *__pyx_tuple__43; PyObject *__pyx_tuple__45; PyObject *__pyx_tuple__47; PyObject *__pyx_tuple__49; - PyObject *__pyx_tuple__50; - PyObject *__pyx_tuple__52; + PyObject *__pyx_tuple__51; + PyObject *__pyx_tuple__53; PyObject *__pyx_tuple__54; PyObject *__pyx_tuple__56; PyObject *__pyx_tuple__58; PyObject *__pyx_tuple__60; PyObject *__pyx_tuple__62; - PyObject *__pyx_tuple__65; - PyObject *__pyx_tuple__67; + PyObject *__pyx_tuple__64; + PyObject *__pyx_tuple__66; PyObject *__pyx_tuple__69; PyObject *__pyx_tuple__71; + PyObject *__pyx_tuple__73; PyObject *__pyx_tuple__75; - PyObject *__pyx_tuple__77; - PyObject *__pyx_tuple__78; - PyObject *__pyx_tuple__80; - PyObject *__pyx_tuple__86; - PyObject *__pyx_tuple__88; - PyObject *__pyx_tuple__91; - PyObject *__pyx_tuple__93; - PyObject *__pyx_codeobj__9; - PyObject *__pyx_tuple__104; - PyObject *__pyx_tuple__106; + PyObject *__pyx_tuple__79; + PyObject *__pyx_tuple__81; + PyObject *__pyx_tuple__82; + PyObject *__pyx_tuple__84; + PyObject *__pyx_tuple__90; + PyObject *__pyx_tuple__92; + PyObject *__pyx_tuple__95; + PyObject *__pyx_tuple__97; + PyObject *__pyx_codeobj__4; + PyObject *__pyx_tuple__108; PyObject *__pyx_tuple__110; - PyObject *__pyx_tuple__113; + PyObject *__pyx_tuple__112; PyObject *__pyx_tuple__115; PyObject *__pyx_tuple__118; PyObject *__pyx_tuple__120; - PyObject *__pyx_tuple__122; - PyObject *__pyx_tuple__124; - PyObject *__pyx_tuple__130; - PyObject *__pyx_tuple__132; - PyObject *__pyx_tuple__135; - PyObject *__pyx_tuple__137; - PyObject *__pyx_tuple__148; - PyObject *__pyx_tuple__150; - PyObject *__pyx_tuple__153; - PyObject *__pyx_tuple__155; + PyObject *__pyx_tuple__123; + PyObject *__pyx_tuple__125; + PyObject *__pyx_tuple__127; + PyObject *__pyx_tuple__129; + PyObject *__pyx_tuple__131; + PyObject *__pyx_tuple__133; + PyObject *__pyx_tuple__139; + PyObject *__pyx_tuple__141; + PyObject *__pyx_tuple__144; + PyObject *__pyx_tuple__146; + PyObject *__pyx_tuple__157; PyObject *__pyx_tuple__159; - PyObject *__pyx_tuple__163; - PyObject *__pyx_tuple__167; - PyObject *__pyx_tuple__173; - PyObject *__pyx_tuple__175; - PyObject *__pyx_tuple__177; - PyObject *__pyx_tuple__179; - PyObject *__pyx_tuple__181; - PyObject *__pyx_tuple__183; - PyObject *__pyx_tuple__185; + PyObject *__pyx_tuple__162; + PyObject *__pyx_tuple__164; + PyObject *__pyx_tuple__168; + PyObject *__pyx_tuple__172; + PyObject *__pyx_tuple__176; + PyObject *__pyx_tuple__182; + PyObject *__pyx_tuple__184; + PyObject *__pyx_tuple__186; + PyObject *__pyx_tuple__188; + PyObject *__pyx_tuple__190; PyObject *__pyx_tuple__192; - PyObject *__pyx_tuple__196; - PyObject *__pyx_tuple__198; - PyObject *__pyx_tuple__200; - PyObject *__pyx_tuple__202; + PyObject *__pyx_tuple__194; + PyObject *__pyx_tuple__201; PyObject *__pyx_tuple__204; + PyObject *__pyx_tuple__208; + PyObject *__pyx_tuple__210; + PyObject *__pyx_tuple__212; PyObject *__pyx_tuple__214; PyObject *__pyx_tuple__216; PyObject *__pyx_tuple__218; - PyObject *__pyx_tuple__222; - PyObject *__pyx_tuple__224; - PyObject *__pyx_tuple__226; - PyObject *__pyx_tuple__228; - PyObject *__pyx_tuple__230; - PyObject *__pyx_tuple__232; - PyObject *__pyx_tuple__234; - PyObject *__pyx_tuple__242; - PyObject *__pyx_tuple__244; - PyObject *__pyx_tuple__246; - PyObject *__pyx_tuple__248; - PyObject *__pyx_tuple__250; - PyObject *__pyx_tuple__252; - PyObject *__pyx_tuple__254; - PyObject *__pyx_tuple__256; + PyObject *__pyx_tuple__227; + PyObject *__pyx_tuple__229; + PyObject *__pyx_tuple__231; + PyObject *__pyx_tuple__235; + PyObject *__pyx_tuple__237; + PyObject *__pyx_tuple__239; + PyObject *__pyx_tuple__241; + PyObject *__pyx_tuple__243; + PyObject *__pyx_tuple__245; + PyObject *__pyx_tuple__247; + PyObject *__pyx_tuple__255; + PyObject *__pyx_tuple__257; + PyObject *__pyx_tuple__259; + PyObject *__pyx_tuple__261; PyObject *__pyx_tuple__263; + PyObject *__pyx_tuple__265; PyObject *__pyx_tuple__267; PyObject *__pyx_tuple__269; PyObject *__pyx_tuple__276; - PyObject *__pyx_tuple__278; PyObject *__pyx_tuple__280; - PyObject *__pyx_tuple__283; - PyObject *__pyx_tuple__285; - PyObject *__pyx_tuple__288; + PyObject *__pyx_tuple__282; + PyObject *__pyx_tuple__289; PyObject *__pyx_tuple__291; - PyObject *__pyx_tuple__294; + PyObject *__pyx_tuple__293; PyObject *__pyx_tuple__296; PyObject *__pyx_tuple__298; - PyObject *__pyx_tuple__302; - PyObject *__pyx_tuple__305; - PyObject *__pyx_tuple__312; - PyObject *__pyx_tuple__314; - PyObject *__pyx_tuple__316; + PyObject *__pyx_tuple__301; + PyObject *__pyx_tuple__304; + PyObject *__pyx_tuple__307; + PyObject *__pyx_tuple__309; + PyObject *__pyx_tuple__311; + PyObject *__pyx_tuple__315; PyObject *__pyx_tuple__318; - PyObject *__pyx_tuple__320; - PyObject *__pyx_tuple__322; + PyObject *__pyx_tuple__325; + PyObject *__pyx_tuple__327; + PyObject *__pyx_tuple__329; + PyObject *__pyx_tuple__331; + PyObject *__pyx_tuple__333; + PyObject *__pyx_tuple__335; PyObject *__pyx_codeobj__11; PyObject *__pyx_codeobj__13; - PyObject *__pyx_codeobj__14; + PyObject *__pyx_codeobj__15; PyObject *__pyx_codeobj__16; PyObject *__pyx_codeobj__18; - PyObject *__pyx_codeobj__19; + PyObject *__pyx_codeobj__20; PyObject *__pyx_codeobj__21; PyObject *__pyx_codeobj__23; + PyObject *__pyx_codeobj__25; PyObject *__pyx_codeobj__27; - PyObject *__pyx_codeobj__29; - PyObject *__pyx_codeobj__30; - PyObject *__pyx_codeobj__32; + PyObject *__pyx_codeobj__31; PyObject *__pyx_codeobj__33; - PyObject *__pyx_codeobj__35; - PyObject *__pyx_codeobj__40; - PyObject *__pyx_codeobj__42; + PyObject *__pyx_codeobj__34; + PyObject *__pyx_codeobj__36; + PyObject *__pyx_codeobj__37; + PyObject *__pyx_codeobj__39; PyObject *__pyx_codeobj__44; PyObject *__pyx_codeobj__46; PyObject *__pyx_codeobj__48; - PyObject *__pyx_codeobj__51; - PyObject *__pyx_codeobj__53; + PyObject *__pyx_codeobj__50; + PyObject *__pyx_codeobj__52; PyObject *__pyx_codeobj__55; PyObject *__pyx_codeobj__57; PyObject *__pyx_codeobj__59; PyObject *__pyx_codeobj__61; PyObject *__pyx_codeobj__63; - PyObject *__pyx_codeobj__64; - PyObject *__pyx_codeobj__66; + PyObject *__pyx_codeobj__65; + PyObject *__pyx_codeobj__67; PyObject *__pyx_codeobj__68; PyObject *__pyx_codeobj__70; PyObject *__pyx_codeobj__72; - PyObject *__pyx_codeobj__73; PyObject *__pyx_codeobj__74; PyObject *__pyx_codeobj__76; - PyObject *__pyx_codeobj__79; - PyObject *__pyx_codeobj__81; - PyObject *__pyx_codeobj__82; + PyObject *__pyx_codeobj__77; + PyObject *__pyx_codeobj__78; + PyObject *__pyx_codeobj__80; PyObject *__pyx_codeobj__83; - PyObject *__pyx_codeobj__84; PyObject *__pyx_codeobj__85; + PyObject *__pyx_codeobj__86; PyObject *__pyx_codeobj__87; + PyObject *__pyx_codeobj__88; PyObject *__pyx_codeobj__89; - PyObject *__pyx_codeobj__90; - PyObject *__pyx_codeobj__92; + PyObject *__pyx_codeobj__91; + PyObject *__pyx_codeobj__93; PyObject *__pyx_codeobj__94; - PyObject *__pyx_codeobj__95; PyObject *__pyx_codeobj__96; - PyObject *__pyx_codeobj__97; PyObject *__pyx_codeobj__98; PyObject *__pyx_codeobj__99; PyObject *__pyx_codeobj__100; PyObject *__pyx_codeobj__101; PyObject *__pyx_codeobj__102; PyObject *__pyx_codeobj__103; + PyObject *__pyx_codeobj__104; PyObject *__pyx_codeobj__105; + PyObject *__pyx_codeobj__106; PyObject *__pyx_codeobj__107; - PyObject *__pyx_codeobj__108; PyObject *__pyx_codeobj__109; PyObject *__pyx_codeobj__111; - PyObject *__pyx_codeobj__112; + PyObject *__pyx_codeobj__113; PyObject *__pyx_codeobj__114; PyObject *__pyx_codeobj__116; PyObject *__pyx_codeobj__117; PyObject *__pyx_codeobj__119; PyObject *__pyx_codeobj__121; - PyObject *__pyx_codeobj__123; - PyObject *__pyx_codeobj__125; + PyObject *__pyx_codeobj__122; + PyObject *__pyx_codeobj__124; PyObject *__pyx_codeobj__126; - PyObject *__pyx_codeobj__127; PyObject *__pyx_codeobj__128; - PyObject *__pyx_codeobj__129; - PyObject *__pyx_codeobj__131; - PyObject *__pyx_codeobj__133; + PyObject *__pyx_codeobj__130; + PyObject *__pyx_codeobj__132; PyObject *__pyx_codeobj__134; + PyObject *__pyx_codeobj__135; PyObject *__pyx_codeobj__136; + PyObject *__pyx_codeobj__137; PyObject *__pyx_codeobj__138; - PyObject *__pyx_codeobj__139; PyObject *__pyx_codeobj__140; - PyObject *__pyx_codeobj__141; PyObject *__pyx_codeobj__142; PyObject *__pyx_codeobj__143; - PyObject *__pyx_codeobj__144; PyObject *__pyx_codeobj__145; - PyObject *__pyx_codeobj__146; + PyObject *__pyx_codeobj__147; + PyObject *__pyx_codeobj__148; PyObject *__pyx_codeobj__149; + PyObject *__pyx_codeobj__150; PyObject *__pyx_codeobj__151; PyObject *__pyx_codeobj__152; + PyObject *__pyx_codeobj__153; PyObject *__pyx_codeobj__154; - PyObject *__pyx_codeobj__156; - PyObject *__pyx_codeobj__157; + PyObject *__pyx_codeobj__155; PyObject *__pyx_codeobj__158; PyObject *__pyx_codeobj__160; PyObject *__pyx_codeobj__161; - PyObject *__pyx_codeobj__162; - PyObject *__pyx_codeobj__164; + PyObject *__pyx_codeobj__163; PyObject *__pyx_codeobj__165; PyObject *__pyx_codeobj__166; - PyObject *__pyx_codeobj__168; + PyObject *__pyx_codeobj__167; PyObject *__pyx_codeobj__169; PyObject *__pyx_codeobj__170; PyObject *__pyx_codeobj__171; - PyObject *__pyx_codeobj__172; + PyObject *__pyx_codeobj__173; PyObject *__pyx_codeobj__174; - PyObject *__pyx_codeobj__176; + PyObject *__pyx_codeobj__175; + PyObject *__pyx_codeobj__177; PyObject *__pyx_codeobj__178; + PyObject *__pyx_codeobj__179; PyObject *__pyx_codeobj__180; - PyObject *__pyx_codeobj__182; - PyObject *__pyx_codeobj__184; - PyObject *__pyx_codeobj__186; + PyObject *__pyx_codeobj__181; + PyObject *__pyx_codeobj__183; + PyObject *__pyx_codeobj__185; PyObject *__pyx_codeobj__187; - PyObject *__pyx_codeobj__188; PyObject *__pyx_codeobj__189; - PyObject *__pyx_codeobj__190; PyObject *__pyx_codeobj__191; PyObject *__pyx_codeobj__193; - PyObject *__pyx_codeobj__194; PyObject *__pyx_codeobj__195; + PyObject *__pyx_codeobj__196; PyObject *__pyx_codeobj__197; + PyObject *__pyx_codeobj__198; PyObject *__pyx_codeobj__199; - PyObject *__pyx_codeobj__201; + PyObject *__pyx_codeobj__200; + PyObject *__pyx_codeobj__202; PyObject *__pyx_codeobj__203; PyObject *__pyx_codeobj__205; PyObject *__pyx_codeobj__206; PyObject *__pyx_codeobj__207; - PyObject *__pyx_codeobj__208; PyObject *__pyx_codeobj__209; - PyObject *__pyx_codeobj__210; PyObject *__pyx_codeobj__211; - PyObject *__pyx_codeobj__212; PyObject *__pyx_codeobj__213; PyObject *__pyx_codeobj__215; PyObject *__pyx_codeobj__217; PyObject *__pyx_codeobj__219; PyObject *__pyx_codeobj__220; PyObject *__pyx_codeobj__221; + PyObject *__pyx_codeobj__222; PyObject *__pyx_codeobj__223; + PyObject *__pyx_codeobj__224; PyObject *__pyx_codeobj__225; - PyObject *__pyx_codeobj__227; - PyObject *__pyx_codeobj__229; - PyObject *__pyx_codeobj__231; + PyObject *__pyx_codeobj__226; + PyObject *__pyx_codeobj__228; + PyObject *__pyx_codeobj__230; + PyObject *__pyx_codeobj__232; PyObject *__pyx_codeobj__233; - PyObject *__pyx_codeobj__235; + PyObject *__pyx_codeobj__234; PyObject *__pyx_codeobj__236; - PyObject *__pyx_codeobj__237; PyObject *__pyx_codeobj__238; - PyObject *__pyx_codeobj__239; PyObject *__pyx_codeobj__240; - PyObject *__pyx_codeobj__241; - PyObject *__pyx_codeobj__243; - PyObject *__pyx_codeobj__245; - PyObject *__pyx_codeobj__247; + PyObject *__pyx_codeobj__242; + PyObject *__pyx_codeobj__244; + PyObject *__pyx_codeobj__246; + PyObject *__pyx_codeobj__248; PyObject *__pyx_codeobj__249; + PyObject *__pyx_codeobj__250; PyObject *__pyx_codeobj__251; + PyObject *__pyx_codeobj__252; PyObject *__pyx_codeobj__253; - PyObject *__pyx_codeobj__255; - PyObject *__pyx_codeobj__257; + PyObject *__pyx_codeobj__254; + PyObject *__pyx_codeobj__256; PyObject *__pyx_codeobj__258; - PyObject *__pyx_codeobj__259; PyObject *__pyx_codeobj__260; - PyObject *__pyx_codeobj__261; PyObject *__pyx_codeobj__262; PyObject *__pyx_codeobj__264; - PyObject *__pyx_codeobj__265; PyObject *__pyx_codeobj__266; PyObject *__pyx_codeobj__268; PyObject *__pyx_codeobj__270; @@ -5598,35 +5657,45 @@ typedef struct { PyObject *__pyx_codeobj__274; PyObject *__pyx_codeobj__275; PyObject *__pyx_codeobj__277; + PyObject *__pyx_codeobj__278; PyObject *__pyx_codeobj__279; PyObject *__pyx_codeobj__281; - PyObject *__pyx_codeobj__282; + PyObject *__pyx_codeobj__283; PyObject *__pyx_codeobj__284; + PyObject *__pyx_codeobj__285; PyObject *__pyx_codeobj__286; PyObject *__pyx_codeobj__287; - PyObject *__pyx_codeobj__289; + PyObject *__pyx_codeobj__288; PyObject *__pyx_codeobj__290; PyObject *__pyx_codeobj__292; - PyObject *__pyx_codeobj__293; + PyObject *__pyx_codeobj__294; PyObject *__pyx_codeobj__295; PyObject *__pyx_codeobj__297; PyObject *__pyx_codeobj__299; PyObject *__pyx_codeobj__300; - PyObject *__pyx_codeobj__301; + PyObject *__pyx_codeobj__302; PyObject *__pyx_codeobj__303; - PyObject *__pyx_codeobj__304; + PyObject *__pyx_codeobj__305; PyObject *__pyx_codeobj__306; - PyObject *__pyx_codeobj__307; PyObject *__pyx_codeobj__308; - PyObject *__pyx_codeobj__309; PyObject *__pyx_codeobj__310; - PyObject *__pyx_codeobj__311; + PyObject *__pyx_codeobj__312; PyObject *__pyx_codeobj__313; - PyObject *__pyx_codeobj__315; + PyObject *__pyx_codeobj__314; + PyObject *__pyx_codeobj__316; PyObject *__pyx_codeobj__317; PyObject *__pyx_codeobj__319; + PyObject *__pyx_codeobj__320; PyObject *__pyx_codeobj__321; + PyObject *__pyx_codeobj__322; PyObject *__pyx_codeobj__323; + PyObject *__pyx_codeobj__324; + PyObject *__pyx_codeobj__326; + PyObject *__pyx_codeobj__328; + PyObject *__pyx_codeobj__330; + PyObject *__pyx_codeobj__332; + PyObject *__pyx_codeobj__334; + PyObject *__pyx_codeobj__336; } __pyx_mstate; #if CYTHON_USE_MODULE_STATE @@ -5669,8 +5738,8 @@ static int __pyx_m_clear(PyObject *m) { #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct__genexpr); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct__genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct__closestPointTo); + Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct__closestPointTo); Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_1_genexpr); Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_1_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_2_genexpr); @@ -5681,54 +5750,54 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_4_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_5_genexpr); Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_5_genexpr); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_6_handleCollisionsPos); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_6_handleCollisionsPos); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_7_closestPointTo); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_7_closestPointTo); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_8_isCorner); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_8_isCorner); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_9__contains); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_9__contains); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_10_genexpr); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_10_genexpr); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_11_closestPointTo); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_11_closestPointTo); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_12_handleCollisionsPos); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_12_handleCollisionsPos); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_13__collides); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_13__collides); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_14_genexpr); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_14_genexpr); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_15_closestPointTo); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_15_closestPointTo); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_16_tangent); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_16_tangent); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_17_closestPointTo); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_17_closestPointTo); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_18__contains); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_18__contains); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_19_genexpr); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_19_genexpr); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_20__collides); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_20__collides); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_21_genexpr); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_21_genexpr); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_22_getCache); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_22_getCache); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_23__collides); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_23__collides); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_24_genexpr); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_24_genexpr); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_25___setitem__); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_25___setitem__); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_26_area); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_26_area); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_27_genexpr); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_27_genexpr); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_28__collides); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_28__collides); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_29_genexpr); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_29_genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_6_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_6_genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_7_handleCollisionsPos); + Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_7_handleCollisionsPos); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_8_closestPointTo); + Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_8_closestPointTo); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_9_isCorner); + Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_9_isCorner); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_10__contains); + Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_10__contains); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_11_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_11_genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_12_closestPointTo); + Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_12_closestPointTo); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_13_handleCollisionsPos); + Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_13_handleCollisionsPos); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_14__collides); + Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_14__collides); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_15_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_15_genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_16_closestPointTo); + Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_16_closestPointTo); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_17_tangent); + Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_17_tangent); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_18_closestPointTo); + Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_18_closestPointTo); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_19__contains); + Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_19__contains); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_20_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_20_genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_21__collides); + Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_21__collides); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_22_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_22_genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_23_getCache); + Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_23_getCache); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_24__collides); + Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_24__collides); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_25_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_25_genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_26___setitem__); + Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_26___setitem__); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_27_area); + Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_27_area); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_28_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_28_genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_29__collides); + Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_29__collides); Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_30_genexpr); Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_30_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_31_genexpr); @@ -5737,10 +5806,12 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_32_genexpr); Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_33_genexpr); Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_33_genexpr); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_34_union); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_34_union); - Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_35_genexpr); - Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_35_genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_34_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_34_genexpr); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_35_union); + Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_35_union); + Py_CLEAR(clear_module_state->__pyx_ptype_10collisions___pyx_scope_struct_36_genexpr); + Py_CLEAR(clear_module_state->__pyx_type_10collisions___pyx_scope_struct_36_genexpr); Py_CLEAR(clear_module_state->__pyx_n_s_A); Py_CLEAR(clear_module_state->__pyx_n_s_AVERYSMALLNUMBER); Py_CLEAR(clear_module_state->__pyx_kp_s_A_Rectangle_It_is_defined_with_a); @@ -5786,8 +5857,6 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_BASEPRECISION); Py_CLEAR(clear_module_state->__pyx_n_s_C); Py_CLEAR(clear_module_state->__pyx_n_s_CLOSED); - Py_CLEAR(clear_module_state->__pyx_kp_u_Cannot_convert_BlazeSudio_shape); - Py_CLEAR(clear_module_state->__pyx_kp_u_Cannot_convert_shapely_shape_of); Py_CLEAR(clear_module_state->__pyx_kp_u_Cannot_draw_BlazeSudio_shape_of); Py_CLEAR(clear_module_state->__pyx_kp_u_Cannot_have_a_Polygon_with_less); Py_CLEAR(clear_module_state->__pyx_n_s_Circle); @@ -5808,8 +5877,10 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_Circle_closestPointTo); Py_CLEAR(clear_module_state->__pyx_n_s_Circle_closestPointTo_locals_lam); Py_CLEAR(clear_module_state->__pyx_n_s_Circle_copy); + Py_CLEAR(clear_module_state->__pyx_n_s_Circle_d); Py_CLEAR(clear_module_state->__pyx_n_s_Circle_handleCollisionsPos); Py_CLEAR(clear_module_state->__pyx_n_s_Circle_handleCollisionsPos_local); + Py_CLEAR(clear_module_state->__pyx_n_s_Circle_handleCollisionsPos_local_2); Py_CLEAR(clear_module_state->__pyx_n_s_Circle_handleCollisionsVel); Py_CLEAR(clear_module_state->__pyx_n_s_Circle_isCorner); Py_CLEAR(clear_module_state->__pyx_n_s_Circle_rect); @@ -5838,8 +5909,6 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_ClosedShape_toPoints); Py_CLEAR(clear_module_state->__pyx_kp_u_Closed_Shape); Py_CLEAR(clear_module_state->__pyx_n_s_D); - Py_CLEAR(clear_module_state->__pyx_n_s_Dict); - Py_CLEAR(clear_module_state->__pyx_kp_s_Dict_Union_Shape_Shapes_bool); Py_CLEAR(clear_module_state->__pyx_n_s_Dx); Py_CLEAR(clear_module_state->__pyx_n_s_Dy); Py_CLEAR(clear_module_state->__pyx_n_s_E); @@ -5987,6 +6056,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_RotatedRect_toLines); Py_CLEAR(clear_module_state->__pyx_n_s_RotatedRect_toPoints); Py_CLEAR(clear_module_state->__pyx_n_s_S); + Py_CLEAR(clear_module_state->__pyx_n_s_SPLITTABLE); Py_CLEAR(clear_module_state->__pyx_n_s_Shape); Py_CLEAR(clear_module_state->__pyx_n_u_Shape); Py_CLEAR(clear_module_state->__pyx_n_s_ShapeCombiner); @@ -6043,6 +6113,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_Shapes_area); Py_CLEAR(clear_module_state->__pyx_n_s_Shapes_area_locals_genexpr); Py_CLEAR(clear_module_state->__pyx_n_s_Shapes_closestPointTo); + Py_CLEAR(clear_module_state->__pyx_n_s_Shapes_closestPointTo_locals_sor); Py_CLEAR(clear_module_state->__pyx_n_s_Shapes_collides); Py_CLEAR(clear_module_state->__pyx_n_s_Shapes_copy); Py_CLEAR(clear_module_state->__pyx_n_s_Shapes_copy_leave_shapes); @@ -6054,6 +6125,8 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_Shapes_remove_shape); Py_CLEAR(clear_module_state->__pyx_n_s_Shapes_remove_shapes); Py_CLEAR(clear_module_state->__pyx_n_s_Shapes_tangent); + Py_CLEAR(clear_module_state->__pyx_n_s_Shapes_toLines); + Py_CLEAR(clear_module_state->__pyx_n_s_Shapes_toPoints); Py_CLEAR(clear_module_state->__pyx_n_s_Shapes_whereCollides); Py_CLEAR(clear_module_state->__pyx_kp_u_Shapes_with_shapes); Py_CLEAR(clear_module_state->__pyx_n_s_ShpGroups); @@ -6078,17 +6151,17 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_kp_s_Union_pointLike_Iterable_pointLi); Py_CLEAR(clear_module_state->__pyx_n_s_ValueError); Py_CLEAR(clear_module_state->__pyx_n_s_W); - Py_CLEAR(clear_module_state->__pyx_n_s__147); - Py_CLEAR(clear_module_state->__pyx_kp_u__24); - Py_CLEAR(clear_module_state->__pyx_kp_u__25); - Py_CLEAR(clear_module_state->__pyx_kp_u__3); - Py_CLEAR(clear_module_state->__pyx_n_s__324); - Py_CLEAR(clear_module_state->__pyx_n_s__36); - Py_CLEAR(clear_module_state->__pyx_kp_u__37); - Py_CLEAR(clear_module_state->__pyx_kp_u__4); + Py_CLEAR(clear_module_state->__pyx_n_s__156); + Py_CLEAR(clear_module_state->__pyx_kp_u__28); + Py_CLEAR(clear_module_state->__pyx_kp_u__29); + Py_CLEAR(clear_module_state->__pyx_n_s__337); + Py_CLEAR(clear_module_state->__pyx_n_s__40); + Py_CLEAR(clear_module_state->__pyx_kp_u__41); Py_CLEAR(clear_module_state->__pyx_kp_u__5); Py_CLEAR(clear_module_state->__pyx_kp_u__6); Py_CLEAR(clear_module_state->__pyx_kp_u__7); + Py_CLEAR(clear_module_state->__pyx_kp_u__8); + Py_CLEAR(clear_module_state->__pyx_kp_u__9); Py_CLEAR(clear_module_state->__pyx_n_s_a); Py_CLEAR(clear_module_state->__pyx_n_s_add_shape); Py_CLEAR(clear_module_state->__pyx_n_s_add_shapes); @@ -6139,6 +6212,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_closestP); Py_CLEAR(clear_module_state->__pyx_n_s_closestPointTo); Py_CLEAR(clear_module_state->__pyx_n_s_closests); + Py_CLEAR(clear_module_state->__pyx_n_s_collP); Py_CLEAR(clear_module_state->__pyx_n_s_collShape); Py_CLEAR(clear_module_state->__pyx_n_s_collToShapely); Py_CLEAR(clear_module_state->__pyx_n_u_collToShapely); @@ -6200,6 +6274,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_errorOnLT3); Py_CLEAR(clear_module_state->__pyx_n_s_extend); Py_CLEAR(clear_module_state->__pyx_n_s_exterior); + Py_CLEAR(clear_module_state->__pyx_n_s_factor); Py_CLEAR(clear_module_state->__pyx_n_s_fixangle); Py_CLEAR(clear_module_state->__pyx_n_s_flip); Py_CLEAR(clear_module_state->__pyx_n_s_float); @@ -6246,12 +6321,14 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_kp_s_lib_collisions_py); Py_CLEAR(clear_module_state->__pyx_n_s_line); Py_CLEAR(clear_module_state->__pyx_n_s_line_mag); + Py_CLEAR(clear_module_state->__pyx_n_s_lines); Py_CLEAR(clear_module_state->__pyx_kp_s_list_Point); Py_CLEAR(clear_module_state->__pyx_n_s_ln); Py_CLEAR(clear_module_state->__pyx_n_s_lns); Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_math); Py_CLEAR(clear_module_state->__pyx_n_s_max); + Py_CLEAR(clear_module_state->__pyx_n_s_maxTries); Py_CLEAR(clear_module_state->__pyx_n_s_maxs); Py_CLEAR(clear_module_state->__pyx_n_s_merged); Py_CLEAR(clear_module_state->__pyx_n_s_metaclass); @@ -6265,6 +6342,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_mycp); Py_CLEAR(clear_module_state->__pyx_n_s_n); Py_CLEAR(clear_module_state->__pyx_n_s_name); + Py_CLEAR(clear_module_state->__pyx_n_s_nd); Py_CLEAR(clear_module_state->__pyx_n_s_new); Py_CLEAR(clear_module_state->__pyx_n_s_newCir); Py_CLEAR(clear_module_state->__pyx_n_s_newLine); @@ -6277,6 +6355,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_newp2); Py_CLEAR(clear_module_state->__pyx_n_s_newpts); Py_CLEAR(clear_module_state->__pyx_n_s_normal); + Py_CLEAR(clear_module_state->__pyx_n_s_np); Py_CLEAR(clear_module_state->__pyx_n_s_o); Py_CLEAR(clear_module_state->__pyx_n_s_obj); Py_CLEAR(clear_module_state->__pyx_n_s_objs); @@ -6395,6 +6474,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_smallness); Py_CLEAR(clear_module_state->__pyx_n_s_snd); Py_CLEAR(clear_module_state->__pyx_n_s_sort); + Py_CLEAR(clear_module_state->__pyx_n_s_sortFunc); Py_CLEAR(clear_module_state->__pyx_n_s_sorted); Py_CLEAR(clear_module_state->__pyx_n_s_sortedOtherLn); Py_CLEAR(clear_module_state->__pyx_n_s_spec); @@ -6423,9 +6503,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_toLines); Py_CLEAR(clear_module_state->__pyx_n_s_toPoint); Py_CLEAR(clear_module_state->__pyx_n_s_toPoints); - Py_CLEAR(clear_module_state->__pyx_kp_u_to_BlazeSudio_Shape); Py_CLEAR(clear_module_state->__pyx_kp_u_to_have_points); - Py_CLEAR(clear_module_state->__pyx_kp_u_to_shapely_shape); Py_CLEAR(clear_module_state->__pyx_n_s_tries); Py_CLEAR(clear_module_state->__pyx_kp_s_tuple_Circle_pointLike_verboseOu); Py_CLEAR(clear_module_state->__pyx_kp_s_tuple_ClosedShape_pointLike_verb); @@ -6440,6 +6518,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_u); Py_CLEAR(clear_module_state->__pyx_n_s_unary_union); Py_CLEAR(clear_module_state->__pyx_n_s_union); + Py_CLEAR(clear_module_state->__pyx_n_s_unstuckable); Py_CLEAR(clear_module_state->__pyx_n_s_value); Py_CLEAR(clear_module_state->__pyx_n_s_vel); Py_CLEAR(clear_module_state->__pyx_n_s_velDiff); @@ -6470,6 +6549,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_xj); Py_CLEAR(clear_module_state->__pyx_n_s_xk); Py_CLEAR(clear_module_state->__pyx_n_s_xpt); + Py_CLEAR(clear_module_state->__pyx_n_s_xs); Py_CLEAR(clear_module_state->__pyx_n_s_xy); Py_CLEAR(clear_module_state->__pyx_n_s_y); Py_CLEAR(clear_module_state->__pyx_n_s_y1); @@ -6484,6 +6564,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_yi); Py_CLEAR(clear_module_state->__pyx_n_s_yj); Py_CLEAR(clear_module_state->__pyx_n_s_yk); + Py_CLEAR(clear_module_state->__pyx_n_s_ys); Py_CLEAR(clear_module_state->__pyx_n_s_zip); Py_CLEAR(clear_module_state->__pyx_float_0_0); Py_CLEAR(clear_module_state->__pyx_float_0_1); @@ -6495,6 +6576,8 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_int_3); Py_CLEAR(clear_module_state->__pyx_int_4); Py_CLEAR(clear_module_state->__pyx_int_5); + Py_CLEAR(clear_module_state->__pyx_int_10); + Py_CLEAR(clear_module_state->__pyx_int_50); Py_CLEAR(clear_module_state->__pyx_int_90); Py_CLEAR(clear_module_state->__pyx_int_180); Py_CLEAR(clear_module_state->__pyx_int_270); @@ -6510,279 +6593,282 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_int_neg_9); Py_CLEAR(clear_module_state->__pyx_tuple_); Py_CLEAR(clear_module_state->__pyx_tuple__2); - Py_CLEAR(clear_module_state->__pyx_tuple__8); + Py_CLEAR(clear_module_state->__pyx_tuple__3); Py_CLEAR(clear_module_state->__pyx_tuple__10); Py_CLEAR(clear_module_state->__pyx_tuple__12); - Py_CLEAR(clear_module_state->__pyx_tuple__15); + Py_CLEAR(clear_module_state->__pyx_tuple__14); Py_CLEAR(clear_module_state->__pyx_tuple__17); - Py_CLEAR(clear_module_state->__pyx_tuple__20); + Py_CLEAR(clear_module_state->__pyx_tuple__19); Py_CLEAR(clear_module_state->__pyx_tuple__22); + Py_CLEAR(clear_module_state->__pyx_tuple__24); Py_CLEAR(clear_module_state->__pyx_tuple__26); - Py_CLEAR(clear_module_state->__pyx_tuple__28); - Py_CLEAR(clear_module_state->__pyx_tuple__31); - Py_CLEAR(clear_module_state->__pyx_tuple__34); + Py_CLEAR(clear_module_state->__pyx_tuple__30); + Py_CLEAR(clear_module_state->__pyx_tuple__32); + Py_CLEAR(clear_module_state->__pyx_tuple__35); Py_CLEAR(clear_module_state->__pyx_tuple__38); - Py_CLEAR(clear_module_state->__pyx_tuple__39); - Py_CLEAR(clear_module_state->__pyx_tuple__41); + Py_CLEAR(clear_module_state->__pyx_tuple__42); Py_CLEAR(clear_module_state->__pyx_tuple__43); Py_CLEAR(clear_module_state->__pyx_tuple__45); Py_CLEAR(clear_module_state->__pyx_tuple__47); Py_CLEAR(clear_module_state->__pyx_tuple__49); - Py_CLEAR(clear_module_state->__pyx_tuple__50); - Py_CLEAR(clear_module_state->__pyx_tuple__52); + Py_CLEAR(clear_module_state->__pyx_tuple__51); + Py_CLEAR(clear_module_state->__pyx_tuple__53); Py_CLEAR(clear_module_state->__pyx_tuple__54); Py_CLEAR(clear_module_state->__pyx_tuple__56); Py_CLEAR(clear_module_state->__pyx_tuple__58); Py_CLEAR(clear_module_state->__pyx_tuple__60); Py_CLEAR(clear_module_state->__pyx_tuple__62); - Py_CLEAR(clear_module_state->__pyx_tuple__65); - Py_CLEAR(clear_module_state->__pyx_tuple__67); + Py_CLEAR(clear_module_state->__pyx_tuple__64); + Py_CLEAR(clear_module_state->__pyx_tuple__66); Py_CLEAR(clear_module_state->__pyx_tuple__69); Py_CLEAR(clear_module_state->__pyx_tuple__71); + Py_CLEAR(clear_module_state->__pyx_tuple__73); Py_CLEAR(clear_module_state->__pyx_tuple__75); - Py_CLEAR(clear_module_state->__pyx_tuple__77); - Py_CLEAR(clear_module_state->__pyx_tuple__78); - Py_CLEAR(clear_module_state->__pyx_tuple__80); - Py_CLEAR(clear_module_state->__pyx_tuple__86); - Py_CLEAR(clear_module_state->__pyx_tuple__88); - Py_CLEAR(clear_module_state->__pyx_tuple__91); - Py_CLEAR(clear_module_state->__pyx_tuple__93); - Py_CLEAR(clear_module_state->__pyx_codeobj__9); - Py_CLEAR(clear_module_state->__pyx_tuple__104); - Py_CLEAR(clear_module_state->__pyx_tuple__106); + Py_CLEAR(clear_module_state->__pyx_tuple__79); + Py_CLEAR(clear_module_state->__pyx_tuple__81); + Py_CLEAR(clear_module_state->__pyx_tuple__82); + Py_CLEAR(clear_module_state->__pyx_tuple__84); + Py_CLEAR(clear_module_state->__pyx_tuple__90); + Py_CLEAR(clear_module_state->__pyx_tuple__92); + Py_CLEAR(clear_module_state->__pyx_tuple__95); + Py_CLEAR(clear_module_state->__pyx_tuple__97); + Py_CLEAR(clear_module_state->__pyx_codeobj__4); + Py_CLEAR(clear_module_state->__pyx_tuple__108); Py_CLEAR(clear_module_state->__pyx_tuple__110); - Py_CLEAR(clear_module_state->__pyx_tuple__113); + Py_CLEAR(clear_module_state->__pyx_tuple__112); Py_CLEAR(clear_module_state->__pyx_tuple__115); Py_CLEAR(clear_module_state->__pyx_tuple__118); Py_CLEAR(clear_module_state->__pyx_tuple__120); - Py_CLEAR(clear_module_state->__pyx_tuple__122); - Py_CLEAR(clear_module_state->__pyx_tuple__124); - Py_CLEAR(clear_module_state->__pyx_tuple__130); - Py_CLEAR(clear_module_state->__pyx_tuple__132); - Py_CLEAR(clear_module_state->__pyx_tuple__135); - Py_CLEAR(clear_module_state->__pyx_tuple__137); - Py_CLEAR(clear_module_state->__pyx_tuple__148); - Py_CLEAR(clear_module_state->__pyx_tuple__150); - Py_CLEAR(clear_module_state->__pyx_tuple__153); - Py_CLEAR(clear_module_state->__pyx_tuple__155); + Py_CLEAR(clear_module_state->__pyx_tuple__123); + Py_CLEAR(clear_module_state->__pyx_tuple__125); + Py_CLEAR(clear_module_state->__pyx_tuple__127); + Py_CLEAR(clear_module_state->__pyx_tuple__129); + Py_CLEAR(clear_module_state->__pyx_tuple__131); + Py_CLEAR(clear_module_state->__pyx_tuple__133); + Py_CLEAR(clear_module_state->__pyx_tuple__139); + Py_CLEAR(clear_module_state->__pyx_tuple__141); + Py_CLEAR(clear_module_state->__pyx_tuple__144); + Py_CLEAR(clear_module_state->__pyx_tuple__146); + Py_CLEAR(clear_module_state->__pyx_tuple__157); Py_CLEAR(clear_module_state->__pyx_tuple__159); - Py_CLEAR(clear_module_state->__pyx_tuple__163); - Py_CLEAR(clear_module_state->__pyx_tuple__167); - Py_CLEAR(clear_module_state->__pyx_tuple__173); - Py_CLEAR(clear_module_state->__pyx_tuple__175); - Py_CLEAR(clear_module_state->__pyx_tuple__177); - Py_CLEAR(clear_module_state->__pyx_tuple__179); - Py_CLEAR(clear_module_state->__pyx_tuple__181); - Py_CLEAR(clear_module_state->__pyx_tuple__183); - Py_CLEAR(clear_module_state->__pyx_tuple__185); + Py_CLEAR(clear_module_state->__pyx_tuple__162); + Py_CLEAR(clear_module_state->__pyx_tuple__164); + Py_CLEAR(clear_module_state->__pyx_tuple__168); + Py_CLEAR(clear_module_state->__pyx_tuple__172); + Py_CLEAR(clear_module_state->__pyx_tuple__176); + Py_CLEAR(clear_module_state->__pyx_tuple__182); + Py_CLEAR(clear_module_state->__pyx_tuple__184); + Py_CLEAR(clear_module_state->__pyx_tuple__186); + Py_CLEAR(clear_module_state->__pyx_tuple__188); + Py_CLEAR(clear_module_state->__pyx_tuple__190); Py_CLEAR(clear_module_state->__pyx_tuple__192); - Py_CLEAR(clear_module_state->__pyx_tuple__196); - Py_CLEAR(clear_module_state->__pyx_tuple__198); - Py_CLEAR(clear_module_state->__pyx_tuple__200); - Py_CLEAR(clear_module_state->__pyx_tuple__202); + Py_CLEAR(clear_module_state->__pyx_tuple__194); + Py_CLEAR(clear_module_state->__pyx_tuple__201); Py_CLEAR(clear_module_state->__pyx_tuple__204); + Py_CLEAR(clear_module_state->__pyx_tuple__208); + Py_CLEAR(clear_module_state->__pyx_tuple__210); + Py_CLEAR(clear_module_state->__pyx_tuple__212); Py_CLEAR(clear_module_state->__pyx_tuple__214); Py_CLEAR(clear_module_state->__pyx_tuple__216); Py_CLEAR(clear_module_state->__pyx_tuple__218); - Py_CLEAR(clear_module_state->__pyx_tuple__222); - Py_CLEAR(clear_module_state->__pyx_tuple__224); - Py_CLEAR(clear_module_state->__pyx_tuple__226); - Py_CLEAR(clear_module_state->__pyx_tuple__228); - Py_CLEAR(clear_module_state->__pyx_tuple__230); - Py_CLEAR(clear_module_state->__pyx_tuple__232); - Py_CLEAR(clear_module_state->__pyx_tuple__234); - Py_CLEAR(clear_module_state->__pyx_tuple__242); - Py_CLEAR(clear_module_state->__pyx_tuple__244); - Py_CLEAR(clear_module_state->__pyx_tuple__246); - Py_CLEAR(clear_module_state->__pyx_tuple__248); - Py_CLEAR(clear_module_state->__pyx_tuple__250); - Py_CLEAR(clear_module_state->__pyx_tuple__252); - Py_CLEAR(clear_module_state->__pyx_tuple__254); - Py_CLEAR(clear_module_state->__pyx_tuple__256); + Py_CLEAR(clear_module_state->__pyx_tuple__227); + Py_CLEAR(clear_module_state->__pyx_tuple__229); + Py_CLEAR(clear_module_state->__pyx_tuple__231); + Py_CLEAR(clear_module_state->__pyx_tuple__235); + Py_CLEAR(clear_module_state->__pyx_tuple__237); + Py_CLEAR(clear_module_state->__pyx_tuple__239); + Py_CLEAR(clear_module_state->__pyx_tuple__241); + Py_CLEAR(clear_module_state->__pyx_tuple__243); + Py_CLEAR(clear_module_state->__pyx_tuple__245); + Py_CLEAR(clear_module_state->__pyx_tuple__247); + Py_CLEAR(clear_module_state->__pyx_tuple__255); + Py_CLEAR(clear_module_state->__pyx_tuple__257); + Py_CLEAR(clear_module_state->__pyx_tuple__259); + Py_CLEAR(clear_module_state->__pyx_tuple__261); Py_CLEAR(clear_module_state->__pyx_tuple__263); + Py_CLEAR(clear_module_state->__pyx_tuple__265); Py_CLEAR(clear_module_state->__pyx_tuple__267); Py_CLEAR(clear_module_state->__pyx_tuple__269); Py_CLEAR(clear_module_state->__pyx_tuple__276); - Py_CLEAR(clear_module_state->__pyx_tuple__278); Py_CLEAR(clear_module_state->__pyx_tuple__280); - Py_CLEAR(clear_module_state->__pyx_tuple__283); - Py_CLEAR(clear_module_state->__pyx_tuple__285); - Py_CLEAR(clear_module_state->__pyx_tuple__288); + Py_CLEAR(clear_module_state->__pyx_tuple__282); + Py_CLEAR(clear_module_state->__pyx_tuple__289); Py_CLEAR(clear_module_state->__pyx_tuple__291); - Py_CLEAR(clear_module_state->__pyx_tuple__294); + Py_CLEAR(clear_module_state->__pyx_tuple__293); Py_CLEAR(clear_module_state->__pyx_tuple__296); Py_CLEAR(clear_module_state->__pyx_tuple__298); - Py_CLEAR(clear_module_state->__pyx_tuple__302); - Py_CLEAR(clear_module_state->__pyx_tuple__305); - Py_CLEAR(clear_module_state->__pyx_tuple__312); - Py_CLEAR(clear_module_state->__pyx_tuple__314); - Py_CLEAR(clear_module_state->__pyx_tuple__316); + Py_CLEAR(clear_module_state->__pyx_tuple__301); + Py_CLEAR(clear_module_state->__pyx_tuple__304); + Py_CLEAR(clear_module_state->__pyx_tuple__307); + Py_CLEAR(clear_module_state->__pyx_tuple__309); + Py_CLEAR(clear_module_state->__pyx_tuple__311); + Py_CLEAR(clear_module_state->__pyx_tuple__315); Py_CLEAR(clear_module_state->__pyx_tuple__318); - Py_CLEAR(clear_module_state->__pyx_tuple__320); - Py_CLEAR(clear_module_state->__pyx_tuple__322); + Py_CLEAR(clear_module_state->__pyx_tuple__325); + Py_CLEAR(clear_module_state->__pyx_tuple__327); + Py_CLEAR(clear_module_state->__pyx_tuple__329); + Py_CLEAR(clear_module_state->__pyx_tuple__331); + Py_CLEAR(clear_module_state->__pyx_tuple__333); + Py_CLEAR(clear_module_state->__pyx_tuple__335); Py_CLEAR(clear_module_state->__pyx_codeobj__11); Py_CLEAR(clear_module_state->__pyx_codeobj__13); - Py_CLEAR(clear_module_state->__pyx_codeobj__14); + Py_CLEAR(clear_module_state->__pyx_codeobj__15); Py_CLEAR(clear_module_state->__pyx_codeobj__16); Py_CLEAR(clear_module_state->__pyx_codeobj__18); - Py_CLEAR(clear_module_state->__pyx_codeobj__19); + Py_CLEAR(clear_module_state->__pyx_codeobj__20); Py_CLEAR(clear_module_state->__pyx_codeobj__21); Py_CLEAR(clear_module_state->__pyx_codeobj__23); + Py_CLEAR(clear_module_state->__pyx_codeobj__25); Py_CLEAR(clear_module_state->__pyx_codeobj__27); - Py_CLEAR(clear_module_state->__pyx_codeobj__29); - Py_CLEAR(clear_module_state->__pyx_codeobj__30); - Py_CLEAR(clear_module_state->__pyx_codeobj__32); + Py_CLEAR(clear_module_state->__pyx_codeobj__31); Py_CLEAR(clear_module_state->__pyx_codeobj__33); - Py_CLEAR(clear_module_state->__pyx_codeobj__35); - Py_CLEAR(clear_module_state->__pyx_codeobj__40); - Py_CLEAR(clear_module_state->__pyx_codeobj__42); + Py_CLEAR(clear_module_state->__pyx_codeobj__34); + Py_CLEAR(clear_module_state->__pyx_codeobj__36); + Py_CLEAR(clear_module_state->__pyx_codeobj__37); + Py_CLEAR(clear_module_state->__pyx_codeobj__39); Py_CLEAR(clear_module_state->__pyx_codeobj__44); Py_CLEAR(clear_module_state->__pyx_codeobj__46); Py_CLEAR(clear_module_state->__pyx_codeobj__48); - Py_CLEAR(clear_module_state->__pyx_codeobj__51); - Py_CLEAR(clear_module_state->__pyx_codeobj__53); + Py_CLEAR(clear_module_state->__pyx_codeobj__50); + Py_CLEAR(clear_module_state->__pyx_codeobj__52); Py_CLEAR(clear_module_state->__pyx_codeobj__55); Py_CLEAR(clear_module_state->__pyx_codeobj__57); Py_CLEAR(clear_module_state->__pyx_codeobj__59); Py_CLEAR(clear_module_state->__pyx_codeobj__61); Py_CLEAR(clear_module_state->__pyx_codeobj__63); - Py_CLEAR(clear_module_state->__pyx_codeobj__64); - Py_CLEAR(clear_module_state->__pyx_codeobj__66); + Py_CLEAR(clear_module_state->__pyx_codeobj__65); + Py_CLEAR(clear_module_state->__pyx_codeobj__67); Py_CLEAR(clear_module_state->__pyx_codeobj__68); Py_CLEAR(clear_module_state->__pyx_codeobj__70); Py_CLEAR(clear_module_state->__pyx_codeobj__72); - Py_CLEAR(clear_module_state->__pyx_codeobj__73); Py_CLEAR(clear_module_state->__pyx_codeobj__74); Py_CLEAR(clear_module_state->__pyx_codeobj__76); - Py_CLEAR(clear_module_state->__pyx_codeobj__79); - Py_CLEAR(clear_module_state->__pyx_codeobj__81); - Py_CLEAR(clear_module_state->__pyx_codeobj__82); + Py_CLEAR(clear_module_state->__pyx_codeobj__77); + Py_CLEAR(clear_module_state->__pyx_codeobj__78); + Py_CLEAR(clear_module_state->__pyx_codeobj__80); Py_CLEAR(clear_module_state->__pyx_codeobj__83); - Py_CLEAR(clear_module_state->__pyx_codeobj__84); Py_CLEAR(clear_module_state->__pyx_codeobj__85); + Py_CLEAR(clear_module_state->__pyx_codeobj__86); Py_CLEAR(clear_module_state->__pyx_codeobj__87); + Py_CLEAR(clear_module_state->__pyx_codeobj__88); Py_CLEAR(clear_module_state->__pyx_codeobj__89); - Py_CLEAR(clear_module_state->__pyx_codeobj__90); - Py_CLEAR(clear_module_state->__pyx_codeobj__92); + Py_CLEAR(clear_module_state->__pyx_codeobj__91); + Py_CLEAR(clear_module_state->__pyx_codeobj__93); Py_CLEAR(clear_module_state->__pyx_codeobj__94); - Py_CLEAR(clear_module_state->__pyx_codeobj__95); Py_CLEAR(clear_module_state->__pyx_codeobj__96); - Py_CLEAR(clear_module_state->__pyx_codeobj__97); Py_CLEAR(clear_module_state->__pyx_codeobj__98); Py_CLEAR(clear_module_state->__pyx_codeobj__99); Py_CLEAR(clear_module_state->__pyx_codeobj__100); Py_CLEAR(clear_module_state->__pyx_codeobj__101); Py_CLEAR(clear_module_state->__pyx_codeobj__102); Py_CLEAR(clear_module_state->__pyx_codeobj__103); + Py_CLEAR(clear_module_state->__pyx_codeobj__104); Py_CLEAR(clear_module_state->__pyx_codeobj__105); + Py_CLEAR(clear_module_state->__pyx_codeobj__106); Py_CLEAR(clear_module_state->__pyx_codeobj__107); - Py_CLEAR(clear_module_state->__pyx_codeobj__108); Py_CLEAR(clear_module_state->__pyx_codeobj__109); Py_CLEAR(clear_module_state->__pyx_codeobj__111); - Py_CLEAR(clear_module_state->__pyx_codeobj__112); + Py_CLEAR(clear_module_state->__pyx_codeobj__113); Py_CLEAR(clear_module_state->__pyx_codeobj__114); Py_CLEAR(clear_module_state->__pyx_codeobj__116); Py_CLEAR(clear_module_state->__pyx_codeobj__117); Py_CLEAR(clear_module_state->__pyx_codeobj__119); Py_CLEAR(clear_module_state->__pyx_codeobj__121); - Py_CLEAR(clear_module_state->__pyx_codeobj__123); - Py_CLEAR(clear_module_state->__pyx_codeobj__125); + Py_CLEAR(clear_module_state->__pyx_codeobj__122); + Py_CLEAR(clear_module_state->__pyx_codeobj__124); Py_CLEAR(clear_module_state->__pyx_codeobj__126); - Py_CLEAR(clear_module_state->__pyx_codeobj__127); Py_CLEAR(clear_module_state->__pyx_codeobj__128); - Py_CLEAR(clear_module_state->__pyx_codeobj__129); - Py_CLEAR(clear_module_state->__pyx_codeobj__131); - Py_CLEAR(clear_module_state->__pyx_codeobj__133); + Py_CLEAR(clear_module_state->__pyx_codeobj__130); + Py_CLEAR(clear_module_state->__pyx_codeobj__132); Py_CLEAR(clear_module_state->__pyx_codeobj__134); + Py_CLEAR(clear_module_state->__pyx_codeobj__135); Py_CLEAR(clear_module_state->__pyx_codeobj__136); + Py_CLEAR(clear_module_state->__pyx_codeobj__137); Py_CLEAR(clear_module_state->__pyx_codeobj__138); - Py_CLEAR(clear_module_state->__pyx_codeobj__139); Py_CLEAR(clear_module_state->__pyx_codeobj__140); - Py_CLEAR(clear_module_state->__pyx_codeobj__141); Py_CLEAR(clear_module_state->__pyx_codeobj__142); Py_CLEAR(clear_module_state->__pyx_codeobj__143); - Py_CLEAR(clear_module_state->__pyx_codeobj__144); Py_CLEAR(clear_module_state->__pyx_codeobj__145); - Py_CLEAR(clear_module_state->__pyx_codeobj__146); + Py_CLEAR(clear_module_state->__pyx_codeobj__147); + Py_CLEAR(clear_module_state->__pyx_codeobj__148); Py_CLEAR(clear_module_state->__pyx_codeobj__149); + Py_CLEAR(clear_module_state->__pyx_codeobj__150); Py_CLEAR(clear_module_state->__pyx_codeobj__151); Py_CLEAR(clear_module_state->__pyx_codeobj__152); + Py_CLEAR(clear_module_state->__pyx_codeobj__153); Py_CLEAR(clear_module_state->__pyx_codeobj__154); - Py_CLEAR(clear_module_state->__pyx_codeobj__156); - Py_CLEAR(clear_module_state->__pyx_codeobj__157); + Py_CLEAR(clear_module_state->__pyx_codeobj__155); Py_CLEAR(clear_module_state->__pyx_codeobj__158); Py_CLEAR(clear_module_state->__pyx_codeobj__160); Py_CLEAR(clear_module_state->__pyx_codeobj__161); - Py_CLEAR(clear_module_state->__pyx_codeobj__162); - Py_CLEAR(clear_module_state->__pyx_codeobj__164); + Py_CLEAR(clear_module_state->__pyx_codeobj__163); Py_CLEAR(clear_module_state->__pyx_codeobj__165); Py_CLEAR(clear_module_state->__pyx_codeobj__166); - Py_CLEAR(clear_module_state->__pyx_codeobj__168); + Py_CLEAR(clear_module_state->__pyx_codeobj__167); Py_CLEAR(clear_module_state->__pyx_codeobj__169); Py_CLEAR(clear_module_state->__pyx_codeobj__170); Py_CLEAR(clear_module_state->__pyx_codeobj__171); - Py_CLEAR(clear_module_state->__pyx_codeobj__172); + Py_CLEAR(clear_module_state->__pyx_codeobj__173); Py_CLEAR(clear_module_state->__pyx_codeobj__174); - Py_CLEAR(clear_module_state->__pyx_codeobj__176); + Py_CLEAR(clear_module_state->__pyx_codeobj__175); + Py_CLEAR(clear_module_state->__pyx_codeobj__177); Py_CLEAR(clear_module_state->__pyx_codeobj__178); + Py_CLEAR(clear_module_state->__pyx_codeobj__179); Py_CLEAR(clear_module_state->__pyx_codeobj__180); - Py_CLEAR(clear_module_state->__pyx_codeobj__182); - Py_CLEAR(clear_module_state->__pyx_codeobj__184); - Py_CLEAR(clear_module_state->__pyx_codeobj__186); + Py_CLEAR(clear_module_state->__pyx_codeobj__181); + Py_CLEAR(clear_module_state->__pyx_codeobj__183); + Py_CLEAR(clear_module_state->__pyx_codeobj__185); Py_CLEAR(clear_module_state->__pyx_codeobj__187); - Py_CLEAR(clear_module_state->__pyx_codeobj__188); Py_CLEAR(clear_module_state->__pyx_codeobj__189); - Py_CLEAR(clear_module_state->__pyx_codeobj__190); Py_CLEAR(clear_module_state->__pyx_codeobj__191); Py_CLEAR(clear_module_state->__pyx_codeobj__193); - Py_CLEAR(clear_module_state->__pyx_codeobj__194); Py_CLEAR(clear_module_state->__pyx_codeobj__195); + Py_CLEAR(clear_module_state->__pyx_codeobj__196); Py_CLEAR(clear_module_state->__pyx_codeobj__197); + Py_CLEAR(clear_module_state->__pyx_codeobj__198); Py_CLEAR(clear_module_state->__pyx_codeobj__199); - Py_CLEAR(clear_module_state->__pyx_codeobj__201); + Py_CLEAR(clear_module_state->__pyx_codeobj__200); + Py_CLEAR(clear_module_state->__pyx_codeobj__202); Py_CLEAR(clear_module_state->__pyx_codeobj__203); Py_CLEAR(clear_module_state->__pyx_codeobj__205); Py_CLEAR(clear_module_state->__pyx_codeobj__206); Py_CLEAR(clear_module_state->__pyx_codeobj__207); - Py_CLEAR(clear_module_state->__pyx_codeobj__208); Py_CLEAR(clear_module_state->__pyx_codeobj__209); - Py_CLEAR(clear_module_state->__pyx_codeobj__210); Py_CLEAR(clear_module_state->__pyx_codeobj__211); - Py_CLEAR(clear_module_state->__pyx_codeobj__212); Py_CLEAR(clear_module_state->__pyx_codeobj__213); Py_CLEAR(clear_module_state->__pyx_codeobj__215); Py_CLEAR(clear_module_state->__pyx_codeobj__217); Py_CLEAR(clear_module_state->__pyx_codeobj__219); Py_CLEAR(clear_module_state->__pyx_codeobj__220); Py_CLEAR(clear_module_state->__pyx_codeobj__221); + Py_CLEAR(clear_module_state->__pyx_codeobj__222); Py_CLEAR(clear_module_state->__pyx_codeobj__223); + Py_CLEAR(clear_module_state->__pyx_codeobj__224); Py_CLEAR(clear_module_state->__pyx_codeobj__225); - Py_CLEAR(clear_module_state->__pyx_codeobj__227); - Py_CLEAR(clear_module_state->__pyx_codeobj__229); - Py_CLEAR(clear_module_state->__pyx_codeobj__231); + Py_CLEAR(clear_module_state->__pyx_codeobj__226); + Py_CLEAR(clear_module_state->__pyx_codeobj__228); + Py_CLEAR(clear_module_state->__pyx_codeobj__230); + Py_CLEAR(clear_module_state->__pyx_codeobj__232); Py_CLEAR(clear_module_state->__pyx_codeobj__233); - Py_CLEAR(clear_module_state->__pyx_codeobj__235); + Py_CLEAR(clear_module_state->__pyx_codeobj__234); Py_CLEAR(clear_module_state->__pyx_codeobj__236); - Py_CLEAR(clear_module_state->__pyx_codeobj__237); Py_CLEAR(clear_module_state->__pyx_codeobj__238); - Py_CLEAR(clear_module_state->__pyx_codeobj__239); Py_CLEAR(clear_module_state->__pyx_codeobj__240); - Py_CLEAR(clear_module_state->__pyx_codeobj__241); - Py_CLEAR(clear_module_state->__pyx_codeobj__243); - Py_CLEAR(clear_module_state->__pyx_codeobj__245); - Py_CLEAR(clear_module_state->__pyx_codeobj__247); + Py_CLEAR(clear_module_state->__pyx_codeobj__242); + Py_CLEAR(clear_module_state->__pyx_codeobj__244); + Py_CLEAR(clear_module_state->__pyx_codeobj__246); + Py_CLEAR(clear_module_state->__pyx_codeobj__248); Py_CLEAR(clear_module_state->__pyx_codeobj__249); + Py_CLEAR(clear_module_state->__pyx_codeobj__250); Py_CLEAR(clear_module_state->__pyx_codeobj__251); + Py_CLEAR(clear_module_state->__pyx_codeobj__252); Py_CLEAR(clear_module_state->__pyx_codeobj__253); - Py_CLEAR(clear_module_state->__pyx_codeobj__255); - Py_CLEAR(clear_module_state->__pyx_codeobj__257); + Py_CLEAR(clear_module_state->__pyx_codeobj__254); + Py_CLEAR(clear_module_state->__pyx_codeobj__256); Py_CLEAR(clear_module_state->__pyx_codeobj__258); - Py_CLEAR(clear_module_state->__pyx_codeobj__259); Py_CLEAR(clear_module_state->__pyx_codeobj__260); - Py_CLEAR(clear_module_state->__pyx_codeobj__261); Py_CLEAR(clear_module_state->__pyx_codeobj__262); Py_CLEAR(clear_module_state->__pyx_codeobj__264); - Py_CLEAR(clear_module_state->__pyx_codeobj__265); Py_CLEAR(clear_module_state->__pyx_codeobj__266); Py_CLEAR(clear_module_state->__pyx_codeobj__268); Py_CLEAR(clear_module_state->__pyx_codeobj__270); @@ -6792,35 +6878,45 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_codeobj__274); Py_CLEAR(clear_module_state->__pyx_codeobj__275); Py_CLEAR(clear_module_state->__pyx_codeobj__277); + Py_CLEAR(clear_module_state->__pyx_codeobj__278); Py_CLEAR(clear_module_state->__pyx_codeobj__279); Py_CLEAR(clear_module_state->__pyx_codeobj__281); - Py_CLEAR(clear_module_state->__pyx_codeobj__282); + Py_CLEAR(clear_module_state->__pyx_codeobj__283); Py_CLEAR(clear_module_state->__pyx_codeobj__284); + Py_CLEAR(clear_module_state->__pyx_codeobj__285); Py_CLEAR(clear_module_state->__pyx_codeobj__286); Py_CLEAR(clear_module_state->__pyx_codeobj__287); - Py_CLEAR(clear_module_state->__pyx_codeobj__289); + Py_CLEAR(clear_module_state->__pyx_codeobj__288); Py_CLEAR(clear_module_state->__pyx_codeobj__290); Py_CLEAR(clear_module_state->__pyx_codeobj__292); - Py_CLEAR(clear_module_state->__pyx_codeobj__293); + Py_CLEAR(clear_module_state->__pyx_codeobj__294); Py_CLEAR(clear_module_state->__pyx_codeobj__295); Py_CLEAR(clear_module_state->__pyx_codeobj__297); Py_CLEAR(clear_module_state->__pyx_codeobj__299); Py_CLEAR(clear_module_state->__pyx_codeobj__300); - Py_CLEAR(clear_module_state->__pyx_codeobj__301); + Py_CLEAR(clear_module_state->__pyx_codeobj__302); Py_CLEAR(clear_module_state->__pyx_codeobj__303); - Py_CLEAR(clear_module_state->__pyx_codeobj__304); + Py_CLEAR(clear_module_state->__pyx_codeobj__305); Py_CLEAR(clear_module_state->__pyx_codeobj__306); - Py_CLEAR(clear_module_state->__pyx_codeobj__307); Py_CLEAR(clear_module_state->__pyx_codeobj__308); - Py_CLEAR(clear_module_state->__pyx_codeobj__309); Py_CLEAR(clear_module_state->__pyx_codeobj__310); - Py_CLEAR(clear_module_state->__pyx_codeobj__311); + Py_CLEAR(clear_module_state->__pyx_codeobj__312); Py_CLEAR(clear_module_state->__pyx_codeobj__313); - Py_CLEAR(clear_module_state->__pyx_codeobj__315); + Py_CLEAR(clear_module_state->__pyx_codeobj__314); + Py_CLEAR(clear_module_state->__pyx_codeobj__316); Py_CLEAR(clear_module_state->__pyx_codeobj__317); Py_CLEAR(clear_module_state->__pyx_codeobj__319); + Py_CLEAR(clear_module_state->__pyx_codeobj__320); Py_CLEAR(clear_module_state->__pyx_codeobj__321); + Py_CLEAR(clear_module_state->__pyx_codeobj__322); Py_CLEAR(clear_module_state->__pyx_codeobj__323); + Py_CLEAR(clear_module_state->__pyx_codeobj__324); + Py_CLEAR(clear_module_state->__pyx_codeobj__326); + Py_CLEAR(clear_module_state->__pyx_codeobj__328); + Py_CLEAR(clear_module_state->__pyx_codeobj__330); + Py_CLEAR(clear_module_state->__pyx_codeobj__332); + Py_CLEAR(clear_module_state->__pyx_codeobj__334); + Py_CLEAR(clear_module_state->__pyx_codeobj__336); return 0; } #endif @@ -6841,8 +6937,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct__genexpr); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct__genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct__closestPointTo); + Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct__closestPointTo); Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_1_genexpr); Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_1_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_2_genexpr); @@ -6853,54 +6949,54 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_4_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_5_genexpr); Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_5_genexpr); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_6_handleCollisionsPos); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_6_handleCollisionsPos); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_7_closestPointTo); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_7_closestPointTo); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_8_isCorner); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_8_isCorner); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_9__contains); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_9__contains); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_10_genexpr); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_10_genexpr); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_11_closestPointTo); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_11_closestPointTo); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_12_handleCollisionsPos); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_12_handleCollisionsPos); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_13__collides); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_13__collides); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_14_genexpr); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_14_genexpr); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_15_closestPointTo); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_15_closestPointTo); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_16_tangent); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_16_tangent); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_17_closestPointTo); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_17_closestPointTo); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_18__contains); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_18__contains); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_19_genexpr); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_19_genexpr); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_20__collides); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_20__collides); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_21_genexpr); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_21_genexpr); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_22_getCache); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_22_getCache); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_23__collides); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_23__collides); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_24_genexpr); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_24_genexpr); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_25___setitem__); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_25___setitem__); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_26_area); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_26_area); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_27_genexpr); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_27_genexpr); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_28__collides); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_28__collides); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_29_genexpr); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_29_genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_6_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_6_genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_7_handleCollisionsPos); + Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_7_handleCollisionsPos); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_8_closestPointTo); + Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_8_closestPointTo); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_9_isCorner); + Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_9_isCorner); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_10__contains); + Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_10__contains); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_11_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_11_genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_12_closestPointTo); + Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_12_closestPointTo); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_13_handleCollisionsPos); + Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_13_handleCollisionsPos); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_14__collides); + Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_14__collides); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_15_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_15_genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_16_closestPointTo); + Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_16_closestPointTo); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_17_tangent); + Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_17_tangent); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_18_closestPointTo); + Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_18_closestPointTo); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_19__contains); + Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_19__contains); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_20_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_20_genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_21__collides); + Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_21__collides); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_22_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_22_genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_23_getCache); + Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_23_getCache); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_24__collides); + Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_24__collides); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_25_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_25_genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_26___setitem__); + Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_26___setitem__); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_27_area); + Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_27_area); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_28_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_28_genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_29__collides); + Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_29__collides); Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_30_genexpr); Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_30_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_31_genexpr); @@ -6909,10 +7005,12 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_32_genexpr); Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_33_genexpr); Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_33_genexpr); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_34_union); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_34_union); - Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_35_genexpr); - Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_35_genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_34_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_34_genexpr); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_35_union); + Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_35_union); + Py_VISIT(traverse_module_state->__pyx_ptype_10collisions___pyx_scope_struct_36_genexpr); + Py_VISIT(traverse_module_state->__pyx_type_10collisions___pyx_scope_struct_36_genexpr); Py_VISIT(traverse_module_state->__pyx_n_s_A); Py_VISIT(traverse_module_state->__pyx_n_s_AVERYSMALLNUMBER); Py_VISIT(traverse_module_state->__pyx_kp_s_A_Rectangle_It_is_defined_with_a); @@ -6958,8 +7056,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_BASEPRECISION); Py_VISIT(traverse_module_state->__pyx_n_s_C); Py_VISIT(traverse_module_state->__pyx_n_s_CLOSED); - Py_VISIT(traverse_module_state->__pyx_kp_u_Cannot_convert_BlazeSudio_shape); - Py_VISIT(traverse_module_state->__pyx_kp_u_Cannot_convert_shapely_shape_of); Py_VISIT(traverse_module_state->__pyx_kp_u_Cannot_draw_BlazeSudio_shape_of); Py_VISIT(traverse_module_state->__pyx_kp_u_Cannot_have_a_Polygon_with_less); Py_VISIT(traverse_module_state->__pyx_n_s_Circle); @@ -6980,8 +7076,10 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_Circle_closestPointTo); Py_VISIT(traverse_module_state->__pyx_n_s_Circle_closestPointTo_locals_lam); Py_VISIT(traverse_module_state->__pyx_n_s_Circle_copy); + Py_VISIT(traverse_module_state->__pyx_n_s_Circle_d); Py_VISIT(traverse_module_state->__pyx_n_s_Circle_handleCollisionsPos); Py_VISIT(traverse_module_state->__pyx_n_s_Circle_handleCollisionsPos_local); + Py_VISIT(traverse_module_state->__pyx_n_s_Circle_handleCollisionsPos_local_2); Py_VISIT(traverse_module_state->__pyx_n_s_Circle_handleCollisionsVel); Py_VISIT(traverse_module_state->__pyx_n_s_Circle_isCorner); Py_VISIT(traverse_module_state->__pyx_n_s_Circle_rect); @@ -7010,8 +7108,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_ClosedShape_toPoints); Py_VISIT(traverse_module_state->__pyx_kp_u_Closed_Shape); Py_VISIT(traverse_module_state->__pyx_n_s_D); - Py_VISIT(traverse_module_state->__pyx_n_s_Dict); - Py_VISIT(traverse_module_state->__pyx_kp_s_Dict_Union_Shape_Shapes_bool); Py_VISIT(traverse_module_state->__pyx_n_s_Dx); Py_VISIT(traverse_module_state->__pyx_n_s_Dy); Py_VISIT(traverse_module_state->__pyx_n_s_E); @@ -7159,6 +7255,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_RotatedRect_toLines); Py_VISIT(traverse_module_state->__pyx_n_s_RotatedRect_toPoints); Py_VISIT(traverse_module_state->__pyx_n_s_S); + Py_VISIT(traverse_module_state->__pyx_n_s_SPLITTABLE); Py_VISIT(traverse_module_state->__pyx_n_s_Shape); Py_VISIT(traverse_module_state->__pyx_n_u_Shape); Py_VISIT(traverse_module_state->__pyx_n_s_ShapeCombiner); @@ -7215,6 +7312,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_Shapes_area); Py_VISIT(traverse_module_state->__pyx_n_s_Shapes_area_locals_genexpr); Py_VISIT(traverse_module_state->__pyx_n_s_Shapes_closestPointTo); + Py_VISIT(traverse_module_state->__pyx_n_s_Shapes_closestPointTo_locals_sor); Py_VISIT(traverse_module_state->__pyx_n_s_Shapes_collides); Py_VISIT(traverse_module_state->__pyx_n_s_Shapes_copy); Py_VISIT(traverse_module_state->__pyx_n_s_Shapes_copy_leave_shapes); @@ -7226,6 +7324,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_Shapes_remove_shape); Py_VISIT(traverse_module_state->__pyx_n_s_Shapes_remove_shapes); Py_VISIT(traverse_module_state->__pyx_n_s_Shapes_tangent); + Py_VISIT(traverse_module_state->__pyx_n_s_Shapes_toLines); + Py_VISIT(traverse_module_state->__pyx_n_s_Shapes_toPoints); Py_VISIT(traverse_module_state->__pyx_n_s_Shapes_whereCollides); Py_VISIT(traverse_module_state->__pyx_kp_u_Shapes_with_shapes); Py_VISIT(traverse_module_state->__pyx_n_s_ShpGroups); @@ -7250,17 +7350,17 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_kp_s_Union_pointLike_Iterable_pointLi); Py_VISIT(traverse_module_state->__pyx_n_s_ValueError); Py_VISIT(traverse_module_state->__pyx_n_s_W); - Py_VISIT(traverse_module_state->__pyx_n_s__147); - Py_VISIT(traverse_module_state->__pyx_kp_u__24); - Py_VISIT(traverse_module_state->__pyx_kp_u__25); - Py_VISIT(traverse_module_state->__pyx_kp_u__3); - Py_VISIT(traverse_module_state->__pyx_n_s__324); - Py_VISIT(traverse_module_state->__pyx_n_s__36); - Py_VISIT(traverse_module_state->__pyx_kp_u__37); - Py_VISIT(traverse_module_state->__pyx_kp_u__4); + Py_VISIT(traverse_module_state->__pyx_n_s__156); + Py_VISIT(traverse_module_state->__pyx_kp_u__28); + Py_VISIT(traverse_module_state->__pyx_kp_u__29); + Py_VISIT(traverse_module_state->__pyx_n_s__337); + Py_VISIT(traverse_module_state->__pyx_n_s__40); + Py_VISIT(traverse_module_state->__pyx_kp_u__41); Py_VISIT(traverse_module_state->__pyx_kp_u__5); Py_VISIT(traverse_module_state->__pyx_kp_u__6); Py_VISIT(traverse_module_state->__pyx_kp_u__7); + Py_VISIT(traverse_module_state->__pyx_kp_u__8); + Py_VISIT(traverse_module_state->__pyx_kp_u__9); Py_VISIT(traverse_module_state->__pyx_n_s_a); Py_VISIT(traverse_module_state->__pyx_n_s_add_shape); Py_VISIT(traverse_module_state->__pyx_n_s_add_shapes); @@ -7311,6 +7411,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_closestP); Py_VISIT(traverse_module_state->__pyx_n_s_closestPointTo); Py_VISIT(traverse_module_state->__pyx_n_s_closests); + Py_VISIT(traverse_module_state->__pyx_n_s_collP); Py_VISIT(traverse_module_state->__pyx_n_s_collShape); Py_VISIT(traverse_module_state->__pyx_n_s_collToShapely); Py_VISIT(traverse_module_state->__pyx_n_u_collToShapely); @@ -7372,6 +7473,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_errorOnLT3); Py_VISIT(traverse_module_state->__pyx_n_s_extend); Py_VISIT(traverse_module_state->__pyx_n_s_exterior); + Py_VISIT(traverse_module_state->__pyx_n_s_factor); Py_VISIT(traverse_module_state->__pyx_n_s_fixangle); Py_VISIT(traverse_module_state->__pyx_n_s_flip); Py_VISIT(traverse_module_state->__pyx_n_s_float); @@ -7418,12 +7520,14 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_kp_s_lib_collisions_py); Py_VISIT(traverse_module_state->__pyx_n_s_line); Py_VISIT(traverse_module_state->__pyx_n_s_line_mag); + Py_VISIT(traverse_module_state->__pyx_n_s_lines); Py_VISIT(traverse_module_state->__pyx_kp_s_list_Point); Py_VISIT(traverse_module_state->__pyx_n_s_ln); Py_VISIT(traverse_module_state->__pyx_n_s_lns); Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_math); Py_VISIT(traverse_module_state->__pyx_n_s_max); + Py_VISIT(traverse_module_state->__pyx_n_s_maxTries); Py_VISIT(traverse_module_state->__pyx_n_s_maxs); Py_VISIT(traverse_module_state->__pyx_n_s_merged); Py_VISIT(traverse_module_state->__pyx_n_s_metaclass); @@ -7437,6 +7541,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_mycp); Py_VISIT(traverse_module_state->__pyx_n_s_n); Py_VISIT(traverse_module_state->__pyx_n_s_name); + Py_VISIT(traverse_module_state->__pyx_n_s_nd); Py_VISIT(traverse_module_state->__pyx_n_s_new); Py_VISIT(traverse_module_state->__pyx_n_s_newCir); Py_VISIT(traverse_module_state->__pyx_n_s_newLine); @@ -7449,6 +7554,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_newp2); Py_VISIT(traverse_module_state->__pyx_n_s_newpts); Py_VISIT(traverse_module_state->__pyx_n_s_normal); + Py_VISIT(traverse_module_state->__pyx_n_s_np); Py_VISIT(traverse_module_state->__pyx_n_s_o); Py_VISIT(traverse_module_state->__pyx_n_s_obj); Py_VISIT(traverse_module_state->__pyx_n_s_objs); @@ -7567,6 +7673,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_smallness); Py_VISIT(traverse_module_state->__pyx_n_s_snd); Py_VISIT(traverse_module_state->__pyx_n_s_sort); + Py_VISIT(traverse_module_state->__pyx_n_s_sortFunc); Py_VISIT(traverse_module_state->__pyx_n_s_sorted); Py_VISIT(traverse_module_state->__pyx_n_s_sortedOtherLn); Py_VISIT(traverse_module_state->__pyx_n_s_spec); @@ -7595,9 +7702,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_toLines); Py_VISIT(traverse_module_state->__pyx_n_s_toPoint); Py_VISIT(traverse_module_state->__pyx_n_s_toPoints); - Py_VISIT(traverse_module_state->__pyx_kp_u_to_BlazeSudio_Shape); Py_VISIT(traverse_module_state->__pyx_kp_u_to_have_points); - Py_VISIT(traverse_module_state->__pyx_kp_u_to_shapely_shape); Py_VISIT(traverse_module_state->__pyx_n_s_tries); Py_VISIT(traverse_module_state->__pyx_kp_s_tuple_Circle_pointLike_verboseOu); Py_VISIT(traverse_module_state->__pyx_kp_s_tuple_ClosedShape_pointLike_verb); @@ -7612,6 +7717,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_u); Py_VISIT(traverse_module_state->__pyx_n_s_unary_union); Py_VISIT(traverse_module_state->__pyx_n_s_union); + Py_VISIT(traverse_module_state->__pyx_n_s_unstuckable); Py_VISIT(traverse_module_state->__pyx_n_s_value); Py_VISIT(traverse_module_state->__pyx_n_s_vel); Py_VISIT(traverse_module_state->__pyx_n_s_velDiff); @@ -7642,6 +7748,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_xj); Py_VISIT(traverse_module_state->__pyx_n_s_xk); Py_VISIT(traverse_module_state->__pyx_n_s_xpt); + Py_VISIT(traverse_module_state->__pyx_n_s_xs); Py_VISIT(traverse_module_state->__pyx_n_s_xy); Py_VISIT(traverse_module_state->__pyx_n_s_y); Py_VISIT(traverse_module_state->__pyx_n_s_y1); @@ -7656,6 +7763,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_yi); Py_VISIT(traverse_module_state->__pyx_n_s_yj); Py_VISIT(traverse_module_state->__pyx_n_s_yk); + Py_VISIT(traverse_module_state->__pyx_n_s_ys); Py_VISIT(traverse_module_state->__pyx_n_s_zip); Py_VISIT(traverse_module_state->__pyx_float_0_0); Py_VISIT(traverse_module_state->__pyx_float_0_1); @@ -7667,6 +7775,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_int_3); Py_VISIT(traverse_module_state->__pyx_int_4); Py_VISIT(traverse_module_state->__pyx_int_5); + Py_VISIT(traverse_module_state->__pyx_int_10); + Py_VISIT(traverse_module_state->__pyx_int_50); Py_VISIT(traverse_module_state->__pyx_int_90); Py_VISIT(traverse_module_state->__pyx_int_180); Py_VISIT(traverse_module_state->__pyx_int_270); @@ -7682,279 +7792,282 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_int_neg_9); Py_VISIT(traverse_module_state->__pyx_tuple_); Py_VISIT(traverse_module_state->__pyx_tuple__2); - Py_VISIT(traverse_module_state->__pyx_tuple__8); + Py_VISIT(traverse_module_state->__pyx_tuple__3); Py_VISIT(traverse_module_state->__pyx_tuple__10); Py_VISIT(traverse_module_state->__pyx_tuple__12); - Py_VISIT(traverse_module_state->__pyx_tuple__15); + Py_VISIT(traverse_module_state->__pyx_tuple__14); Py_VISIT(traverse_module_state->__pyx_tuple__17); - Py_VISIT(traverse_module_state->__pyx_tuple__20); + Py_VISIT(traverse_module_state->__pyx_tuple__19); Py_VISIT(traverse_module_state->__pyx_tuple__22); + Py_VISIT(traverse_module_state->__pyx_tuple__24); Py_VISIT(traverse_module_state->__pyx_tuple__26); - Py_VISIT(traverse_module_state->__pyx_tuple__28); - Py_VISIT(traverse_module_state->__pyx_tuple__31); - Py_VISIT(traverse_module_state->__pyx_tuple__34); + Py_VISIT(traverse_module_state->__pyx_tuple__30); + Py_VISIT(traverse_module_state->__pyx_tuple__32); + Py_VISIT(traverse_module_state->__pyx_tuple__35); Py_VISIT(traverse_module_state->__pyx_tuple__38); - Py_VISIT(traverse_module_state->__pyx_tuple__39); - Py_VISIT(traverse_module_state->__pyx_tuple__41); + Py_VISIT(traverse_module_state->__pyx_tuple__42); Py_VISIT(traverse_module_state->__pyx_tuple__43); Py_VISIT(traverse_module_state->__pyx_tuple__45); Py_VISIT(traverse_module_state->__pyx_tuple__47); Py_VISIT(traverse_module_state->__pyx_tuple__49); - Py_VISIT(traverse_module_state->__pyx_tuple__50); - Py_VISIT(traverse_module_state->__pyx_tuple__52); + Py_VISIT(traverse_module_state->__pyx_tuple__51); + Py_VISIT(traverse_module_state->__pyx_tuple__53); Py_VISIT(traverse_module_state->__pyx_tuple__54); Py_VISIT(traverse_module_state->__pyx_tuple__56); Py_VISIT(traverse_module_state->__pyx_tuple__58); Py_VISIT(traverse_module_state->__pyx_tuple__60); Py_VISIT(traverse_module_state->__pyx_tuple__62); - Py_VISIT(traverse_module_state->__pyx_tuple__65); - Py_VISIT(traverse_module_state->__pyx_tuple__67); + Py_VISIT(traverse_module_state->__pyx_tuple__64); + Py_VISIT(traverse_module_state->__pyx_tuple__66); Py_VISIT(traverse_module_state->__pyx_tuple__69); Py_VISIT(traverse_module_state->__pyx_tuple__71); + Py_VISIT(traverse_module_state->__pyx_tuple__73); Py_VISIT(traverse_module_state->__pyx_tuple__75); - Py_VISIT(traverse_module_state->__pyx_tuple__77); - Py_VISIT(traverse_module_state->__pyx_tuple__78); - Py_VISIT(traverse_module_state->__pyx_tuple__80); - Py_VISIT(traverse_module_state->__pyx_tuple__86); - Py_VISIT(traverse_module_state->__pyx_tuple__88); - Py_VISIT(traverse_module_state->__pyx_tuple__91); - Py_VISIT(traverse_module_state->__pyx_tuple__93); - Py_VISIT(traverse_module_state->__pyx_codeobj__9); - Py_VISIT(traverse_module_state->__pyx_tuple__104); - Py_VISIT(traverse_module_state->__pyx_tuple__106); + Py_VISIT(traverse_module_state->__pyx_tuple__79); + Py_VISIT(traverse_module_state->__pyx_tuple__81); + Py_VISIT(traverse_module_state->__pyx_tuple__82); + Py_VISIT(traverse_module_state->__pyx_tuple__84); + Py_VISIT(traverse_module_state->__pyx_tuple__90); + Py_VISIT(traverse_module_state->__pyx_tuple__92); + Py_VISIT(traverse_module_state->__pyx_tuple__95); + Py_VISIT(traverse_module_state->__pyx_tuple__97); + Py_VISIT(traverse_module_state->__pyx_codeobj__4); + Py_VISIT(traverse_module_state->__pyx_tuple__108); Py_VISIT(traverse_module_state->__pyx_tuple__110); - Py_VISIT(traverse_module_state->__pyx_tuple__113); + Py_VISIT(traverse_module_state->__pyx_tuple__112); Py_VISIT(traverse_module_state->__pyx_tuple__115); Py_VISIT(traverse_module_state->__pyx_tuple__118); Py_VISIT(traverse_module_state->__pyx_tuple__120); - Py_VISIT(traverse_module_state->__pyx_tuple__122); - Py_VISIT(traverse_module_state->__pyx_tuple__124); - Py_VISIT(traverse_module_state->__pyx_tuple__130); - Py_VISIT(traverse_module_state->__pyx_tuple__132); - Py_VISIT(traverse_module_state->__pyx_tuple__135); - Py_VISIT(traverse_module_state->__pyx_tuple__137); - Py_VISIT(traverse_module_state->__pyx_tuple__148); - Py_VISIT(traverse_module_state->__pyx_tuple__150); - Py_VISIT(traverse_module_state->__pyx_tuple__153); - Py_VISIT(traverse_module_state->__pyx_tuple__155); + Py_VISIT(traverse_module_state->__pyx_tuple__123); + Py_VISIT(traverse_module_state->__pyx_tuple__125); + Py_VISIT(traverse_module_state->__pyx_tuple__127); + Py_VISIT(traverse_module_state->__pyx_tuple__129); + Py_VISIT(traverse_module_state->__pyx_tuple__131); + Py_VISIT(traverse_module_state->__pyx_tuple__133); + Py_VISIT(traverse_module_state->__pyx_tuple__139); + Py_VISIT(traverse_module_state->__pyx_tuple__141); + Py_VISIT(traverse_module_state->__pyx_tuple__144); + Py_VISIT(traverse_module_state->__pyx_tuple__146); + Py_VISIT(traverse_module_state->__pyx_tuple__157); Py_VISIT(traverse_module_state->__pyx_tuple__159); - Py_VISIT(traverse_module_state->__pyx_tuple__163); - Py_VISIT(traverse_module_state->__pyx_tuple__167); - Py_VISIT(traverse_module_state->__pyx_tuple__173); - Py_VISIT(traverse_module_state->__pyx_tuple__175); - Py_VISIT(traverse_module_state->__pyx_tuple__177); - Py_VISIT(traverse_module_state->__pyx_tuple__179); - Py_VISIT(traverse_module_state->__pyx_tuple__181); - Py_VISIT(traverse_module_state->__pyx_tuple__183); - Py_VISIT(traverse_module_state->__pyx_tuple__185); + Py_VISIT(traverse_module_state->__pyx_tuple__162); + Py_VISIT(traverse_module_state->__pyx_tuple__164); + Py_VISIT(traverse_module_state->__pyx_tuple__168); + Py_VISIT(traverse_module_state->__pyx_tuple__172); + Py_VISIT(traverse_module_state->__pyx_tuple__176); + Py_VISIT(traverse_module_state->__pyx_tuple__182); + Py_VISIT(traverse_module_state->__pyx_tuple__184); + Py_VISIT(traverse_module_state->__pyx_tuple__186); + Py_VISIT(traverse_module_state->__pyx_tuple__188); + Py_VISIT(traverse_module_state->__pyx_tuple__190); Py_VISIT(traverse_module_state->__pyx_tuple__192); - Py_VISIT(traverse_module_state->__pyx_tuple__196); - Py_VISIT(traverse_module_state->__pyx_tuple__198); - Py_VISIT(traverse_module_state->__pyx_tuple__200); - Py_VISIT(traverse_module_state->__pyx_tuple__202); + Py_VISIT(traverse_module_state->__pyx_tuple__194); + Py_VISIT(traverse_module_state->__pyx_tuple__201); Py_VISIT(traverse_module_state->__pyx_tuple__204); + Py_VISIT(traverse_module_state->__pyx_tuple__208); + Py_VISIT(traverse_module_state->__pyx_tuple__210); + Py_VISIT(traverse_module_state->__pyx_tuple__212); Py_VISIT(traverse_module_state->__pyx_tuple__214); Py_VISIT(traverse_module_state->__pyx_tuple__216); Py_VISIT(traverse_module_state->__pyx_tuple__218); - Py_VISIT(traverse_module_state->__pyx_tuple__222); - Py_VISIT(traverse_module_state->__pyx_tuple__224); - Py_VISIT(traverse_module_state->__pyx_tuple__226); - Py_VISIT(traverse_module_state->__pyx_tuple__228); - Py_VISIT(traverse_module_state->__pyx_tuple__230); - Py_VISIT(traverse_module_state->__pyx_tuple__232); - Py_VISIT(traverse_module_state->__pyx_tuple__234); - Py_VISIT(traverse_module_state->__pyx_tuple__242); - Py_VISIT(traverse_module_state->__pyx_tuple__244); - Py_VISIT(traverse_module_state->__pyx_tuple__246); - Py_VISIT(traverse_module_state->__pyx_tuple__248); - Py_VISIT(traverse_module_state->__pyx_tuple__250); - Py_VISIT(traverse_module_state->__pyx_tuple__252); - Py_VISIT(traverse_module_state->__pyx_tuple__254); - Py_VISIT(traverse_module_state->__pyx_tuple__256); + Py_VISIT(traverse_module_state->__pyx_tuple__227); + Py_VISIT(traverse_module_state->__pyx_tuple__229); + Py_VISIT(traverse_module_state->__pyx_tuple__231); + Py_VISIT(traverse_module_state->__pyx_tuple__235); + Py_VISIT(traverse_module_state->__pyx_tuple__237); + Py_VISIT(traverse_module_state->__pyx_tuple__239); + Py_VISIT(traverse_module_state->__pyx_tuple__241); + Py_VISIT(traverse_module_state->__pyx_tuple__243); + Py_VISIT(traverse_module_state->__pyx_tuple__245); + Py_VISIT(traverse_module_state->__pyx_tuple__247); + Py_VISIT(traverse_module_state->__pyx_tuple__255); + Py_VISIT(traverse_module_state->__pyx_tuple__257); + Py_VISIT(traverse_module_state->__pyx_tuple__259); + Py_VISIT(traverse_module_state->__pyx_tuple__261); Py_VISIT(traverse_module_state->__pyx_tuple__263); + Py_VISIT(traverse_module_state->__pyx_tuple__265); Py_VISIT(traverse_module_state->__pyx_tuple__267); Py_VISIT(traverse_module_state->__pyx_tuple__269); Py_VISIT(traverse_module_state->__pyx_tuple__276); - Py_VISIT(traverse_module_state->__pyx_tuple__278); Py_VISIT(traverse_module_state->__pyx_tuple__280); - Py_VISIT(traverse_module_state->__pyx_tuple__283); - Py_VISIT(traverse_module_state->__pyx_tuple__285); - Py_VISIT(traverse_module_state->__pyx_tuple__288); + Py_VISIT(traverse_module_state->__pyx_tuple__282); + Py_VISIT(traverse_module_state->__pyx_tuple__289); Py_VISIT(traverse_module_state->__pyx_tuple__291); - Py_VISIT(traverse_module_state->__pyx_tuple__294); + Py_VISIT(traverse_module_state->__pyx_tuple__293); Py_VISIT(traverse_module_state->__pyx_tuple__296); Py_VISIT(traverse_module_state->__pyx_tuple__298); - Py_VISIT(traverse_module_state->__pyx_tuple__302); - Py_VISIT(traverse_module_state->__pyx_tuple__305); - Py_VISIT(traverse_module_state->__pyx_tuple__312); - Py_VISIT(traverse_module_state->__pyx_tuple__314); - Py_VISIT(traverse_module_state->__pyx_tuple__316); + Py_VISIT(traverse_module_state->__pyx_tuple__301); + Py_VISIT(traverse_module_state->__pyx_tuple__304); + Py_VISIT(traverse_module_state->__pyx_tuple__307); + Py_VISIT(traverse_module_state->__pyx_tuple__309); + Py_VISIT(traverse_module_state->__pyx_tuple__311); + Py_VISIT(traverse_module_state->__pyx_tuple__315); Py_VISIT(traverse_module_state->__pyx_tuple__318); - Py_VISIT(traverse_module_state->__pyx_tuple__320); - Py_VISIT(traverse_module_state->__pyx_tuple__322); + Py_VISIT(traverse_module_state->__pyx_tuple__325); + Py_VISIT(traverse_module_state->__pyx_tuple__327); + Py_VISIT(traverse_module_state->__pyx_tuple__329); + Py_VISIT(traverse_module_state->__pyx_tuple__331); + Py_VISIT(traverse_module_state->__pyx_tuple__333); + Py_VISIT(traverse_module_state->__pyx_tuple__335); Py_VISIT(traverse_module_state->__pyx_codeobj__11); Py_VISIT(traverse_module_state->__pyx_codeobj__13); - Py_VISIT(traverse_module_state->__pyx_codeobj__14); + Py_VISIT(traverse_module_state->__pyx_codeobj__15); Py_VISIT(traverse_module_state->__pyx_codeobj__16); Py_VISIT(traverse_module_state->__pyx_codeobj__18); - Py_VISIT(traverse_module_state->__pyx_codeobj__19); + Py_VISIT(traverse_module_state->__pyx_codeobj__20); Py_VISIT(traverse_module_state->__pyx_codeobj__21); Py_VISIT(traverse_module_state->__pyx_codeobj__23); + Py_VISIT(traverse_module_state->__pyx_codeobj__25); Py_VISIT(traverse_module_state->__pyx_codeobj__27); - Py_VISIT(traverse_module_state->__pyx_codeobj__29); - Py_VISIT(traverse_module_state->__pyx_codeobj__30); - Py_VISIT(traverse_module_state->__pyx_codeobj__32); + Py_VISIT(traverse_module_state->__pyx_codeobj__31); Py_VISIT(traverse_module_state->__pyx_codeobj__33); - Py_VISIT(traverse_module_state->__pyx_codeobj__35); - Py_VISIT(traverse_module_state->__pyx_codeobj__40); - Py_VISIT(traverse_module_state->__pyx_codeobj__42); + Py_VISIT(traverse_module_state->__pyx_codeobj__34); + Py_VISIT(traverse_module_state->__pyx_codeobj__36); + Py_VISIT(traverse_module_state->__pyx_codeobj__37); + Py_VISIT(traverse_module_state->__pyx_codeobj__39); Py_VISIT(traverse_module_state->__pyx_codeobj__44); Py_VISIT(traverse_module_state->__pyx_codeobj__46); Py_VISIT(traverse_module_state->__pyx_codeobj__48); - Py_VISIT(traverse_module_state->__pyx_codeobj__51); - Py_VISIT(traverse_module_state->__pyx_codeobj__53); + Py_VISIT(traverse_module_state->__pyx_codeobj__50); + Py_VISIT(traverse_module_state->__pyx_codeobj__52); Py_VISIT(traverse_module_state->__pyx_codeobj__55); Py_VISIT(traverse_module_state->__pyx_codeobj__57); Py_VISIT(traverse_module_state->__pyx_codeobj__59); Py_VISIT(traverse_module_state->__pyx_codeobj__61); Py_VISIT(traverse_module_state->__pyx_codeobj__63); - Py_VISIT(traverse_module_state->__pyx_codeobj__64); - Py_VISIT(traverse_module_state->__pyx_codeobj__66); + Py_VISIT(traverse_module_state->__pyx_codeobj__65); + Py_VISIT(traverse_module_state->__pyx_codeobj__67); Py_VISIT(traverse_module_state->__pyx_codeobj__68); Py_VISIT(traverse_module_state->__pyx_codeobj__70); Py_VISIT(traverse_module_state->__pyx_codeobj__72); - Py_VISIT(traverse_module_state->__pyx_codeobj__73); Py_VISIT(traverse_module_state->__pyx_codeobj__74); Py_VISIT(traverse_module_state->__pyx_codeobj__76); - Py_VISIT(traverse_module_state->__pyx_codeobj__79); - Py_VISIT(traverse_module_state->__pyx_codeobj__81); - Py_VISIT(traverse_module_state->__pyx_codeobj__82); + Py_VISIT(traverse_module_state->__pyx_codeobj__77); + Py_VISIT(traverse_module_state->__pyx_codeobj__78); + Py_VISIT(traverse_module_state->__pyx_codeobj__80); Py_VISIT(traverse_module_state->__pyx_codeobj__83); - Py_VISIT(traverse_module_state->__pyx_codeobj__84); Py_VISIT(traverse_module_state->__pyx_codeobj__85); + Py_VISIT(traverse_module_state->__pyx_codeobj__86); Py_VISIT(traverse_module_state->__pyx_codeobj__87); + Py_VISIT(traverse_module_state->__pyx_codeobj__88); Py_VISIT(traverse_module_state->__pyx_codeobj__89); - Py_VISIT(traverse_module_state->__pyx_codeobj__90); - Py_VISIT(traverse_module_state->__pyx_codeobj__92); + Py_VISIT(traverse_module_state->__pyx_codeobj__91); + Py_VISIT(traverse_module_state->__pyx_codeobj__93); Py_VISIT(traverse_module_state->__pyx_codeobj__94); - Py_VISIT(traverse_module_state->__pyx_codeobj__95); Py_VISIT(traverse_module_state->__pyx_codeobj__96); - Py_VISIT(traverse_module_state->__pyx_codeobj__97); Py_VISIT(traverse_module_state->__pyx_codeobj__98); Py_VISIT(traverse_module_state->__pyx_codeobj__99); Py_VISIT(traverse_module_state->__pyx_codeobj__100); Py_VISIT(traverse_module_state->__pyx_codeobj__101); Py_VISIT(traverse_module_state->__pyx_codeobj__102); Py_VISIT(traverse_module_state->__pyx_codeobj__103); + Py_VISIT(traverse_module_state->__pyx_codeobj__104); Py_VISIT(traverse_module_state->__pyx_codeobj__105); + Py_VISIT(traverse_module_state->__pyx_codeobj__106); Py_VISIT(traverse_module_state->__pyx_codeobj__107); - Py_VISIT(traverse_module_state->__pyx_codeobj__108); Py_VISIT(traverse_module_state->__pyx_codeobj__109); Py_VISIT(traverse_module_state->__pyx_codeobj__111); - Py_VISIT(traverse_module_state->__pyx_codeobj__112); + Py_VISIT(traverse_module_state->__pyx_codeobj__113); Py_VISIT(traverse_module_state->__pyx_codeobj__114); Py_VISIT(traverse_module_state->__pyx_codeobj__116); Py_VISIT(traverse_module_state->__pyx_codeobj__117); Py_VISIT(traverse_module_state->__pyx_codeobj__119); Py_VISIT(traverse_module_state->__pyx_codeobj__121); - Py_VISIT(traverse_module_state->__pyx_codeobj__123); - Py_VISIT(traverse_module_state->__pyx_codeobj__125); + Py_VISIT(traverse_module_state->__pyx_codeobj__122); + Py_VISIT(traverse_module_state->__pyx_codeobj__124); Py_VISIT(traverse_module_state->__pyx_codeobj__126); - Py_VISIT(traverse_module_state->__pyx_codeobj__127); Py_VISIT(traverse_module_state->__pyx_codeobj__128); - Py_VISIT(traverse_module_state->__pyx_codeobj__129); - Py_VISIT(traverse_module_state->__pyx_codeobj__131); - Py_VISIT(traverse_module_state->__pyx_codeobj__133); + Py_VISIT(traverse_module_state->__pyx_codeobj__130); + Py_VISIT(traverse_module_state->__pyx_codeobj__132); Py_VISIT(traverse_module_state->__pyx_codeobj__134); + Py_VISIT(traverse_module_state->__pyx_codeobj__135); Py_VISIT(traverse_module_state->__pyx_codeobj__136); + Py_VISIT(traverse_module_state->__pyx_codeobj__137); Py_VISIT(traverse_module_state->__pyx_codeobj__138); - Py_VISIT(traverse_module_state->__pyx_codeobj__139); Py_VISIT(traverse_module_state->__pyx_codeobj__140); - Py_VISIT(traverse_module_state->__pyx_codeobj__141); Py_VISIT(traverse_module_state->__pyx_codeobj__142); Py_VISIT(traverse_module_state->__pyx_codeobj__143); - Py_VISIT(traverse_module_state->__pyx_codeobj__144); Py_VISIT(traverse_module_state->__pyx_codeobj__145); - Py_VISIT(traverse_module_state->__pyx_codeobj__146); + Py_VISIT(traverse_module_state->__pyx_codeobj__147); + Py_VISIT(traverse_module_state->__pyx_codeobj__148); Py_VISIT(traverse_module_state->__pyx_codeobj__149); + Py_VISIT(traverse_module_state->__pyx_codeobj__150); Py_VISIT(traverse_module_state->__pyx_codeobj__151); Py_VISIT(traverse_module_state->__pyx_codeobj__152); + Py_VISIT(traverse_module_state->__pyx_codeobj__153); Py_VISIT(traverse_module_state->__pyx_codeobj__154); - Py_VISIT(traverse_module_state->__pyx_codeobj__156); - Py_VISIT(traverse_module_state->__pyx_codeobj__157); + Py_VISIT(traverse_module_state->__pyx_codeobj__155); Py_VISIT(traverse_module_state->__pyx_codeobj__158); Py_VISIT(traverse_module_state->__pyx_codeobj__160); Py_VISIT(traverse_module_state->__pyx_codeobj__161); - Py_VISIT(traverse_module_state->__pyx_codeobj__162); - Py_VISIT(traverse_module_state->__pyx_codeobj__164); + Py_VISIT(traverse_module_state->__pyx_codeobj__163); Py_VISIT(traverse_module_state->__pyx_codeobj__165); Py_VISIT(traverse_module_state->__pyx_codeobj__166); - Py_VISIT(traverse_module_state->__pyx_codeobj__168); + Py_VISIT(traverse_module_state->__pyx_codeobj__167); Py_VISIT(traverse_module_state->__pyx_codeobj__169); Py_VISIT(traverse_module_state->__pyx_codeobj__170); Py_VISIT(traverse_module_state->__pyx_codeobj__171); - Py_VISIT(traverse_module_state->__pyx_codeobj__172); + Py_VISIT(traverse_module_state->__pyx_codeobj__173); Py_VISIT(traverse_module_state->__pyx_codeobj__174); - Py_VISIT(traverse_module_state->__pyx_codeobj__176); + Py_VISIT(traverse_module_state->__pyx_codeobj__175); + Py_VISIT(traverse_module_state->__pyx_codeobj__177); Py_VISIT(traverse_module_state->__pyx_codeobj__178); + Py_VISIT(traverse_module_state->__pyx_codeobj__179); Py_VISIT(traverse_module_state->__pyx_codeobj__180); - Py_VISIT(traverse_module_state->__pyx_codeobj__182); - Py_VISIT(traverse_module_state->__pyx_codeobj__184); - Py_VISIT(traverse_module_state->__pyx_codeobj__186); + Py_VISIT(traverse_module_state->__pyx_codeobj__181); + Py_VISIT(traverse_module_state->__pyx_codeobj__183); + Py_VISIT(traverse_module_state->__pyx_codeobj__185); Py_VISIT(traverse_module_state->__pyx_codeobj__187); - Py_VISIT(traverse_module_state->__pyx_codeobj__188); Py_VISIT(traverse_module_state->__pyx_codeobj__189); - Py_VISIT(traverse_module_state->__pyx_codeobj__190); Py_VISIT(traverse_module_state->__pyx_codeobj__191); Py_VISIT(traverse_module_state->__pyx_codeobj__193); - Py_VISIT(traverse_module_state->__pyx_codeobj__194); Py_VISIT(traverse_module_state->__pyx_codeobj__195); + Py_VISIT(traverse_module_state->__pyx_codeobj__196); Py_VISIT(traverse_module_state->__pyx_codeobj__197); + Py_VISIT(traverse_module_state->__pyx_codeobj__198); Py_VISIT(traverse_module_state->__pyx_codeobj__199); - Py_VISIT(traverse_module_state->__pyx_codeobj__201); + Py_VISIT(traverse_module_state->__pyx_codeobj__200); + Py_VISIT(traverse_module_state->__pyx_codeobj__202); Py_VISIT(traverse_module_state->__pyx_codeobj__203); Py_VISIT(traverse_module_state->__pyx_codeobj__205); Py_VISIT(traverse_module_state->__pyx_codeobj__206); Py_VISIT(traverse_module_state->__pyx_codeobj__207); - Py_VISIT(traverse_module_state->__pyx_codeobj__208); Py_VISIT(traverse_module_state->__pyx_codeobj__209); - Py_VISIT(traverse_module_state->__pyx_codeobj__210); Py_VISIT(traverse_module_state->__pyx_codeobj__211); - Py_VISIT(traverse_module_state->__pyx_codeobj__212); Py_VISIT(traverse_module_state->__pyx_codeobj__213); Py_VISIT(traverse_module_state->__pyx_codeobj__215); Py_VISIT(traverse_module_state->__pyx_codeobj__217); Py_VISIT(traverse_module_state->__pyx_codeobj__219); Py_VISIT(traverse_module_state->__pyx_codeobj__220); Py_VISIT(traverse_module_state->__pyx_codeobj__221); + Py_VISIT(traverse_module_state->__pyx_codeobj__222); Py_VISIT(traverse_module_state->__pyx_codeobj__223); + Py_VISIT(traverse_module_state->__pyx_codeobj__224); Py_VISIT(traverse_module_state->__pyx_codeobj__225); - Py_VISIT(traverse_module_state->__pyx_codeobj__227); - Py_VISIT(traverse_module_state->__pyx_codeobj__229); - Py_VISIT(traverse_module_state->__pyx_codeobj__231); + Py_VISIT(traverse_module_state->__pyx_codeobj__226); + Py_VISIT(traverse_module_state->__pyx_codeobj__228); + Py_VISIT(traverse_module_state->__pyx_codeobj__230); + Py_VISIT(traverse_module_state->__pyx_codeobj__232); Py_VISIT(traverse_module_state->__pyx_codeobj__233); - Py_VISIT(traverse_module_state->__pyx_codeobj__235); + Py_VISIT(traverse_module_state->__pyx_codeobj__234); Py_VISIT(traverse_module_state->__pyx_codeobj__236); - Py_VISIT(traverse_module_state->__pyx_codeobj__237); Py_VISIT(traverse_module_state->__pyx_codeobj__238); - Py_VISIT(traverse_module_state->__pyx_codeobj__239); Py_VISIT(traverse_module_state->__pyx_codeobj__240); - Py_VISIT(traverse_module_state->__pyx_codeobj__241); - Py_VISIT(traverse_module_state->__pyx_codeobj__243); - Py_VISIT(traverse_module_state->__pyx_codeobj__245); - Py_VISIT(traverse_module_state->__pyx_codeobj__247); + Py_VISIT(traverse_module_state->__pyx_codeobj__242); + Py_VISIT(traverse_module_state->__pyx_codeobj__244); + Py_VISIT(traverse_module_state->__pyx_codeobj__246); + Py_VISIT(traverse_module_state->__pyx_codeobj__248); Py_VISIT(traverse_module_state->__pyx_codeobj__249); + Py_VISIT(traverse_module_state->__pyx_codeobj__250); Py_VISIT(traverse_module_state->__pyx_codeobj__251); + Py_VISIT(traverse_module_state->__pyx_codeobj__252); Py_VISIT(traverse_module_state->__pyx_codeobj__253); - Py_VISIT(traverse_module_state->__pyx_codeobj__255); - Py_VISIT(traverse_module_state->__pyx_codeobj__257); + Py_VISIT(traverse_module_state->__pyx_codeobj__254); + Py_VISIT(traverse_module_state->__pyx_codeobj__256); Py_VISIT(traverse_module_state->__pyx_codeobj__258); - Py_VISIT(traverse_module_state->__pyx_codeobj__259); Py_VISIT(traverse_module_state->__pyx_codeobj__260); - Py_VISIT(traverse_module_state->__pyx_codeobj__261); Py_VISIT(traverse_module_state->__pyx_codeobj__262); Py_VISIT(traverse_module_state->__pyx_codeobj__264); - Py_VISIT(traverse_module_state->__pyx_codeobj__265); Py_VISIT(traverse_module_state->__pyx_codeobj__266); Py_VISIT(traverse_module_state->__pyx_codeobj__268); Py_VISIT(traverse_module_state->__pyx_codeobj__270); @@ -7964,35 +8077,45 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_codeobj__274); Py_VISIT(traverse_module_state->__pyx_codeobj__275); Py_VISIT(traverse_module_state->__pyx_codeobj__277); + Py_VISIT(traverse_module_state->__pyx_codeobj__278); Py_VISIT(traverse_module_state->__pyx_codeobj__279); Py_VISIT(traverse_module_state->__pyx_codeobj__281); - Py_VISIT(traverse_module_state->__pyx_codeobj__282); + Py_VISIT(traverse_module_state->__pyx_codeobj__283); Py_VISIT(traverse_module_state->__pyx_codeobj__284); + Py_VISIT(traverse_module_state->__pyx_codeobj__285); Py_VISIT(traverse_module_state->__pyx_codeobj__286); Py_VISIT(traverse_module_state->__pyx_codeobj__287); - Py_VISIT(traverse_module_state->__pyx_codeobj__289); + Py_VISIT(traverse_module_state->__pyx_codeobj__288); Py_VISIT(traverse_module_state->__pyx_codeobj__290); Py_VISIT(traverse_module_state->__pyx_codeobj__292); - Py_VISIT(traverse_module_state->__pyx_codeobj__293); + Py_VISIT(traverse_module_state->__pyx_codeobj__294); Py_VISIT(traverse_module_state->__pyx_codeobj__295); Py_VISIT(traverse_module_state->__pyx_codeobj__297); Py_VISIT(traverse_module_state->__pyx_codeobj__299); Py_VISIT(traverse_module_state->__pyx_codeobj__300); - Py_VISIT(traverse_module_state->__pyx_codeobj__301); + Py_VISIT(traverse_module_state->__pyx_codeobj__302); Py_VISIT(traverse_module_state->__pyx_codeobj__303); - Py_VISIT(traverse_module_state->__pyx_codeobj__304); + Py_VISIT(traverse_module_state->__pyx_codeobj__305); Py_VISIT(traverse_module_state->__pyx_codeobj__306); - Py_VISIT(traverse_module_state->__pyx_codeobj__307); Py_VISIT(traverse_module_state->__pyx_codeobj__308); - Py_VISIT(traverse_module_state->__pyx_codeobj__309); Py_VISIT(traverse_module_state->__pyx_codeobj__310); - Py_VISIT(traverse_module_state->__pyx_codeobj__311); + Py_VISIT(traverse_module_state->__pyx_codeobj__312); Py_VISIT(traverse_module_state->__pyx_codeobj__313); - Py_VISIT(traverse_module_state->__pyx_codeobj__315); + Py_VISIT(traverse_module_state->__pyx_codeobj__314); + Py_VISIT(traverse_module_state->__pyx_codeobj__316); Py_VISIT(traverse_module_state->__pyx_codeobj__317); Py_VISIT(traverse_module_state->__pyx_codeobj__319); + Py_VISIT(traverse_module_state->__pyx_codeobj__320); Py_VISIT(traverse_module_state->__pyx_codeobj__321); + Py_VISIT(traverse_module_state->__pyx_codeobj__322); Py_VISIT(traverse_module_state->__pyx_codeobj__323); + Py_VISIT(traverse_module_state->__pyx_codeobj__324); + Py_VISIT(traverse_module_state->__pyx_codeobj__326); + Py_VISIT(traverse_module_state->__pyx_codeobj__328); + Py_VISIT(traverse_module_state->__pyx_codeobj__330); + Py_VISIT(traverse_module_state->__pyx_codeobj__332); + Py_VISIT(traverse_module_state->__pyx_codeobj__334); + Py_VISIT(traverse_module_state->__pyx_codeobj__336); return 0; } #endif @@ -8022,79 +8145,81 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE -#define __pyx_type_10collisions___pyx_scope_struct__genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct__genexpr +#define __pyx_type_10collisions___pyx_scope_struct__closestPointTo __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct__closestPointTo #define __pyx_type_10collisions___pyx_scope_struct_1_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_1_genexpr #define __pyx_type_10collisions___pyx_scope_struct_2_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_2_genexpr #define __pyx_type_10collisions___pyx_scope_struct_3_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_3_genexpr #define __pyx_type_10collisions___pyx_scope_struct_4_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_4_genexpr #define __pyx_type_10collisions___pyx_scope_struct_5_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_5_genexpr -#define __pyx_type_10collisions___pyx_scope_struct_6_handleCollisionsPos __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_6_handleCollisionsPos -#define __pyx_type_10collisions___pyx_scope_struct_7_closestPointTo __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_7_closestPointTo -#define __pyx_type_10collisions___pyx_scope_struct_8_isCorner __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_8_isCorner -#define __pyx_type_10collisions___pyx_scope_struct_9__contains __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_9__contains -#define __pyx_type_10collisions___pyx_scope_struct_10_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_10_genexpr -#define __pyx_type_10collisions___pyx_scope_struct_11_closestPointTo __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_11_closestPointTo -#define __pyx_type_10collisions___pyx_scope_struct_12_handleCollisionsPos __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_12_handleCollisionsPos -#define __pyx_type_10collisions___pyx_scope_struct_13__collides __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_13__collides -#define __pyx_type_10collisions___pyx_scope_struct_14_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_14_genexpr -#define __pyx_type_10collisions___pyx_scope_struct_15_closestPointTo __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_15_closestPointTo -#define __pyx_type_10collisions___pyx_scope_struct_16_tangent __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_16_tangent -#define __pyx_type_10collisions___pyx_scope_struct_17_closestPointTo __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_17_closestPointTo -#define __pyx_type_10collisions___pyx_scope_struct_18__contains __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_18__contains -#define __pyx_type_10collisions___pyx_scope_struct_19_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_19_genexpr -#define __pyx_type_10collisions___pyx_scope_struct_20__collides __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_20__collides -#define __pyx_type_10collisions___pyx_scope_struct_21_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_21_genexpr -#define __pyx_type_10collisions___pyx_scope_struct_22_getCache __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_22_getCache -#define __pyx_type_10collisions___pyx_scope_struct_23__collides __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_23__collides -#define __pyx_type_10collisions___pyx_scope_struct_24_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_24_genexpr -#define __pyx_type_10collisions___pyx_scope_struct_25___setitem__ __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_25___setitem__ -#define __pyx_type_10collisions___pyx_scope_struct_26_area __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_26_area -#define __pyx_type_10collisions___pyx_scope_struct_27_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_27_genexpr -#define __pyx_type_10collisions___pyx_scope_struct_28__collides __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_28__collides -#define __pyx_type_10collisions___pyx_scope_struct_29_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_29_genexpr +#define __pyx_type_10collisions___pyx_scope_struct_6_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_6_genexpr +#define __pyx_type_10collisions___pyx_scope_struct_7_handleCollisionsPos __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_7_handleCollisionsPos +#define __pyx_type_10collisions___pyx_scope_struct_8_closestPointTo __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_8_closestPointTo +#define __pyx_type_10collisions___pyx_scope_struct_9_isCorner __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_9_isCorner +#define __pyx_type_10collisions___pyx_scope_struct_10__contains __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_10__contains +#define __pyx_type_10collisions___pyx_scope_struct_11_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_11_genexpr +#define __pyx_type_10collisions___pyx_scope_struct_12_closestPointTo __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_12_closestPointTo +#define __pyx_type_10collisions___pyx_scope_struct_13_handleCollisionsPos __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_13_handleCollisionsPos +#define __pyx_type_10collisions___pyx_scope_struct_14__collides __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_14__collides +#define __pyx_type_10collisions___pyx_scope_struct_15_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_15_genexpr +#define __pyx_type_10collisions___pyx_scope_struct_16_closestPointTo __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_16_closestPointTo +#define __pyx_type_10collisions___pyx_scope_struct_17_tangent __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_17_tangent +#define __pyx_type_10collisions___pyx_scope_struct_18_closestPointTo __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_18_closestPointTo +#define __pyx_type_10collisions___pyx_scope_struct_19__contains __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_19__contains +#define __pyx_type_10collisions___pyx_scope_struct_20_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_20_genexpr +#define __pyx_type_10collisions___pyx_scope_struct_21__collides __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_21__collides +#define __pyx_type_10collisions___pyx_scope_struct_22_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_22_genexpr +#define __pyx_type_10collisions___pyx_scope_struct_23_getCache __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_23_getCache +#define __pyx_type_10collisions___pyx_scope_struct_24__collides __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_24__collides +#define __pyx_type_10collisions___pyx_scope_struct_25_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_25_genexpr +#define __pyx_type_10collisions___pyx_scope_struct_26___setitem__ __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_26___setitem__ +#define __pyx_type_10collisions___pyx_scope_struct_27_area __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_27_area +#define __pyx_type_10collisions___pyx_scope_struct_28_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_28_genexpr +#define __pyx_type_10collisions___pyx_scope_struct_29__collides __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_29__collides #define __pyx_type_10collisions___pyx_scope_struct_30_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_30_genexpr #define __pyx_type_10collisions___pyx_scope_struct_31_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_31_genexpr #define __pyx_type_10collisions___pyx_scope_struct_32_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_32_genexpr #define __pyx_type_10collisions___pyx_scope_struct_33_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_33_genexpr -#define __pyx_type_10collisions___pyx_scope_struct_34_union __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_34_union -#define __pyx_type_10collisions___pyx_scope_struct_35_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_35_genexpr +#define __pyx_type_10collisions___pyx_scope_struct_34_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_34_genexpr +#define __pyx_type_10collisions___pyx_scope_struct_35_union __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_35_union +#define __pyx_type_10collisions___pyx_scope_struct_36_genexpr __pyx_mstate_global->__pyx_type_10collisions___pyx_scope_struct_36_genexpr #endif -#define __pyx_ptype_10collisions___pyx_scope_struct__genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct__genexpr +#define __pyx_ptype_10collisions___pyx_scope_struct__closestPointTo __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct__closestPointTo #define __pyx_ptype_10collisions___pyx_scope_struct_1_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_1_genexpr #define __pyx_ptype_10collisions___pyx_scope_struct_2_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_2_genexpr #define __pyx_ptype_10collisions___pyx_scope_struct_3_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_3_genexpr #define __pyx_ptype_10collisions___pyx_scope_struct_4_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_4_genexpr #define __pyx_ptype_10collisions___pyx_scope_struct_5_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_5_genexpr -#define __pyx_ptype_10collisions___pyx_scope_struct_6_handleCollisionsPos __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_6_handleCollisionsPos -#define __pyx_ptype_10collisions___pyx_scope_struct_7_closestPointTo __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_7_closestPointTo -#define __pyx_ptype_10collisions___pyx_scope_struct_8_isCorner __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_8_isCorner -#define __pyx_ptype_10collisions___pyx_scope_struct_9__contains __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_9__contains -#define __pyx_ptype_10collisions___pyx_scope_struct_10_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_10_genexpr -#define __pyx_ptype_10collisions___pyx_scope_struct_11_closestPointTo __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_11_closestPointTo -#define __pyx_ptype_10collisions___pyx_scope_struct_12_handleCollisionsPos __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_12_handleCollisionsPos -#define __pyx_ptype_10collisions___pyx_scope_struct_13__collides __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_13__collides -#define __pyx_ptype_10collisions___pyx_scope_struct_14_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_14_genexpr -#define __pyx_ptype_10collisions___pyx_scope_struct_15_closestPointTo __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_15_closestPointTo -#define __pyx_ptype_10collisions___pyx_scope_struct_16_tangent __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_16_tangent -#define __pyx_ptype_10collisions___pyx_scope_struct_17_closestPointTo __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_17_closestPointTo -#define __pyx_ptype_10collisions___pyx_scope_struct_18__contains __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_18__contains -#define __pyx_ptype_10collisions___pyx_scope_struct_19_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_19_genexpr -#define __pyx_ptype_10collisions___pyx_scope_struct_20__collides __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_20__collides -#define __pyx_ptype_10collisions___pyx_scope_struct_21_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_21_genexpr -#define __pyx_ptype_10collisions___pyx_scope_struct_22_getCache __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_22_getCache -#define __pyx_ptype_10collisions___pyx_scope_struct_23__collides __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_23__collides -#define __pyx_ptype_10collisions___pyx_scope_struct_24_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_24_genexpr -#define __pyx_ptype_10collisions___pyx_scope_struct_25___setitem__ __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_25___setitem__ -#define __pyx_ptype_10collisions___pyx_scope_struct_26_area __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_26_area -#define __pyx_ptype_10collisions___pyx_scope_struct_27_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_27_genexpr -#define __pyx_ptype_10collisions___pyx_scope_struct_28__collides __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_28__collides -#define __pyx_ptype_10collisions___pyx_scope_struct_29_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_29_genexpr +#define __pyx_ptype_10collisions___pyx_scope_struct_6_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_6_genexpr +#define __pyx_ptype_10collisions___pyx_scope_struct_7_handleCollisionsPos __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_7_handleCollisionsPos +#define __pyx_ptype_10collisions___pyx_scope_struct_8_closestPointTo __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_8_closestPointTo +#define __pyx_ptype_10collisions___pyx_scope_struct_9_isCorner __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_9_isCorner +#define __pyx_ptype_10collisions___pyx_scope_struct_10__contains __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_10__contains +#define __pyx_ptype_10collisions___pyx_scope_struct_11_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_11_genexpr +#define __pyx_ptype_10collisions___pyx_scope_struct_12_closestPointTo __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_12_closestPointTo +#define __pyx_ptype_10collisions___pyx_scope_struct_13_handleCollisionsPos __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_13_handleCollisionsPos +#define __pyx_ptype_10collisions___pyx_scope_struct_14__collides __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_14__collides +#define __pyx_ptype_10collisions___pyx_scope_struct_15_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_15_genexpr +#define __pyx_ptype_10collisions___pyx_scope_struct_16_closestPointTo __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_16_closestPointTo +#define __pyx_ptype_10collisions___pyx_scope_struct_17_tangent __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_17_tangent +#define __pyx_ptype_10collisions___pyx_scope_struct_18_closestPointTo __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_18_closestPointTo +#define __pyx_ptype_10collisions___pyx_scope_struct_19__contains __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_19__contains +#define __pyx_ptype_10collisions___pyx_scope_struct_20_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_20_genexpr +#define __pyx_ptype_10collisions___pyx_scope_struct_21__collides __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_21__collides +#define __pyx_ptype_10collisions___pyx_scope_struct_22_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_22_genexpr +#define __pyx_ptype_10collisions___pyx_scope_struct_23_getCache __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_23_getCache +#define __pyx_ptype_10collisions___pyx_scope_struct_24__collides __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_24__collides +#define __pyx_ptype_10collisions___pyx_scope_struct_25_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_25_genexpr +#define __pyx_ptype_10collisions___pyx_scope_struct_26___setitem__ __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_26___setitem__ +#define __pyx_ptype_10collisions___pyx_scope_struct_27_area __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_27_area +#define __pyx_ptype_10collisions___pyx_scope_struct_28_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_28_genexpr +#define __pyx_ptype_10collisions___pyx_scope_struct_29__collides __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_29__collides #define __pyx_ptype_10collisions___pyx_scope_struct_30_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_30_genexpr #define __pyx_ptype_10collisions___pyx_scope_struct_31_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_31_genexpr #define __pyx_ptype_10collisions___pyx_scope_struct_32_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_32_genexpr #define __pyx_ptype_10collisions___pyx_scope_struct_33_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_33_genexpr -#define __pyx_ptype_10collisions___pyx_scope_struct_34_union __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_34_union -#define __pyx_ptype_10collisions___pyx_scope_struct_35_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_35_genexpr +#define __pyx_ptype_10collisions___pyx_scope_struct_34_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_34_genexpr +#define __pyx_ptype_10collisions___pyx_scope_struct_35_union __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_35_union +#define __pyx_ptype_10collisions___pyx_scope_struct_36_genexpr __pyx_mstate_global->__pyx_ptype_10collisions___pyx_scope_struct_36_genexpr #define __pyx_n_s_A __pyx_mstate_global->__pyx_n_s_A #define __pyx_n_s_AVERYSMALLNUMBER __pyx_mstate_global->__pyx_n_s_AVERYSMALLNUMBER #define __pyx_kp_s_A_Rectangle_It_is_defined_with_a __pyx_mstate_global->__pyx_kp_s_A_Rectangle_It_is_defined_with_a @@ -8140,8 +8265,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_BASEPRECISION __pyx_mstate_global->__pyx_n_s_BASEPRECISION #define __pyx_n_s_C __pyx_mstate_global->__pyx_n_s_C #define __pyx_n_s_CLOSED __pyx_mstate_global->__pyx_n_s_CLOSED -#define __pyx_kp_u_Cannot_convert_BlazeSudio_shape __pyx_mstate_global->__pyx_kp_u_Cannot_convert_BlazeSudio_shape -#define __pyx_kp_u_Cannot_convert_shapely_shape_of __pyx_mstate_global->__pyx_kp_u_Cannot_convert_shapely_shape_of #define __pyx_kp_u_Cannot_draw_BlazeSudio_shape_of __pyx_mstate_global->__pyx_kp_u_Cannot_draw_BlazeSudio_shape_of #define __pyx_kp_u_Cannot_have_a_Polygon_with_less __pyx_mstate_global->__pyx_kp_u_Cannot_have_a_Polygon_with_less #define __pyx_n_s_Circle __pyx_mstate_global->__pyx_n_s_Circle @@ -8162,8 +8285,10 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_Circle_closestPointTo __pyx_mstate_global->__pyx_n_s_Circle_closestPointTo #define __pyx_n_s_Circle_closestPointTo_locals_lam __pyx_mstate_global->__pyx_n_s_Circle_closestPointTo_locals_lam #define __pyx_n_s_Circle_copy __pyx_mstate_global->__pyx_n_s_Circle_copy +#define __pyx_n_s_Circle_d __pyx_mstate_global->__pyx_n_s_Circle_d #define __pyx_n_s_Circle_handleCollisionsPos __pyx_mstate_global->__pyx_n_s_Circle_handleCollisionsPos #define __pyx_n_s_Circle_handleCollisionsPos_local __pyx_mstate_global->__pyx_n_s_Circle_handleCollisionsPos_local +#define __pyx_n_s_Circle_handleCollisionsPos_local_2 __pyx_mstate_global->__pyx_n_s_Circle_handleCollisionsPos_local_2 #define __pyx_n_s_Circle_handleCollisionsVel __pyx_mstate_global->__pyx_n_s_Circle_handleCollisionsVel #define __pyx_n_s_Circle_isCorner __pyx_mstate_global->__pyx_n_s_Circle_isCorner #define __pyx_n_s_Circle_rect __pyx_mstate_global->__pyx_n_s_Circle_rect @@ -8192,8 +8317,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_ClosedShape_toPoints __pyx_mstate_global->__pyx_n_s_ClosedShape_toPoints #define __pyx_kp_u_Closed_Shape __pyx_mstate_global->__pyx_kp_u_Closed_Shape #define __pyx_n_s_D __pyx_mstate_global->__pyx_n_s_D -#define __pyx_n_s_Dict __pyx_mstate_global->__pyx_n_s_Dict -#define __pyx_kp_s_Dict_Union_Shape_Shapes_bool __pyx_mstate_global->__pyx_kp_s_Dict_Union_Shape_Shapes_bool #define __pyx_n_s_Dx __pyx_mstate_global->__pyx_n_s_Dx #define __pyx_n_s_Dy __pyx_mstate_global->__pyx_n_s_Dy #define __pyx_n_s_E __pyx_mstate_global->__pyx_n_s_E @@ -8341,6 +8464,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_RotatedRect_toLines __pyx_mstate_global->__pyx_n_s_RotatedRect_toLines #define __pyx_n_s_RotatedRect_toPoints __pyx_mstate_global->__pyx_n_s_RotatedRect_toPoints #define __pyx_n_s_S __pyx_mstate_global->__pyx_n_s_S +#define __pyx_n_s_SPLITTABLE __pyx_mstate_global->__pyx_n_s_SPLITTABLE #define __pyx_n_s_Shape __pyx_mstate_global->__pyx_n_s_Shape #define __pyx_n_u_Shape __pyx_mstate_global->__pyx_n_u_Shape #define __pyx_n_s_ShapeCombiner __pyx_mstate_global->__pyx_n_s_ShapeCombiner @@ -8397,6 +8521,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_Shapes_area __pyx_mstate_global->__pyx_n_s_Shapes_area #define __pyx_n_s_Shapes_area_locals_genexpr __pyx_mstate_global->__pyx_n_s_Shapes_area_locals_genexpr #define __pyx_n_s_Shapes_closestPointTo __pyx_mstate_global->__pyx_n_s_Shapes_closestPointTo +#define __pyx_n_s_Shapes_closestPointTo_locals_sor __pyx_mstate_global->__pyx_n_s_Shapes_closestPointTo_locals_sor #define __pyx_n_s_Shapes_collides __pyx_mstate_global->__pyx_n_s_Shapes_collides #define __pyx_n_s_Shapes_copy __pyx_mstate_global->__pyx_n_s_Shapes_copy #define __pyx_n_s_Shapes_copy_leave_shapes __pyx_mstate_global->__pyx_n_s_Shapes_copy_leave_shapes @@ -8408,6 +8533,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_Shapes_remove_shape __pyx_mstate_global->__pyx_n_s_Shapes_remove_shape #define __pyx_n_s_Shapes_remove_shapes __pyx_mstate_global->__pyx_n_s_Shapes_remove_shapes #define __pyx_n_s_Shapes_tangent __pyx_mstate_global->__pyx_n_s_Shapes_tangent +#define __pyx_n_s_Shapes_toLines __pyx_mstate_global->__pyx_n_s_Shapes_toLines +#define __pyx_n_s_Shapes_toPoints __pyx_mstate_global->__pyx_n_s_Shapes_toPoints #define __pyx_n_s_Shapes_whereCollides __pyx_mstate_global->__pyx_n_s_Shapes_whereCollides #define __pyx_kp_u_Shapes_with_shapes __pyx_mstate_global->__pyx_kp_u_Shapes_with_shapes #define __pyx_n_s_ShpGroups __pyx_mstate_global->__pyx_n_s_ShpGroups @@ -8432,17 +8559,17 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_kp_s_Union_pointLike_Iterable_pointLi __pyx_mstate_global->__pyx_kp_s_Union_pointLike_Iterable_pointLi #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError #define __pyx_n_s_W __pyx_mstate_global->__pyx_n_s_W -#define __pyx_n_s__147 __pyx_mstate_global->__pyx_n_s__147 -#define __pyx_kp_u__24 __pyx_mstate_global->__pyx_kp_u__24 -#define __pyx_kp_u__25 __pyx_mstate_global->__pyx_kp_u__25 -#define __pyx_kp_u__3 __pyx_mstate_global->__pyx_kp_u__3 -#define __pyx_n_s__324 __pyx_mstate_global->__pyx_n_s__324 -#define __pyx_n_s__36 __pyx_mstate_global->__pyx_n_s__36 -#define __pyx_kp_u__37 __pyx_mstate_global->__pyx_kp_u__37 -#define __pyx_kp_u__4 __pyx_mstate_global->__pyx_kp_u__4 +#define __pyx_n_s__156 __pyx_mstate_global->__pyx_n_s__156 +#define __pyx_kp_u__28 __pyx_mstate_global->__pyx_kp_u__28 +#define __pyx_kp_u__29 __pyx_mstate_global->__pyx_kp_u__29 +#define __pyx_n_s__337 __pyx_mstate_global->__pyx_n_s__337 +#define __pyx_n_s__40 __pyx_mstate_global->__pyx_n_s__40 +#define __pyx_kp_u__41 __pyx_mstate_global->__pyx_kp_u__41 #define __pyx_kp_u__5 __pyx_mstate_global->__pyx_kp_u__5 #define __pyx_kp_u__6 __pyx_mstate_global->__pyx_kp_u__6 #define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7 +#define __pyx_kp_u__8 __pyx_mstate_global->__pyx_kp_u__8 +#define __pyx_kp_u__9 __pyx_mstate_global->__pyx_kp_u__9 #define __pyx_n_s_a __pyx_mstate_global->__pyx_n_s_a #define __pyx_n_s_add_shape __pyx_mstate_global->__pyx_n_s_add_shape #define __pyx_n_s_add_shapes __pyx_mstate_global->__pyx_n_s_add_shapes @@ -8493,6 +8620,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_closestP __pyx_mstate_global->__pyx_n_s_closestP #define __pyx_n_s_closestPointTo __pyx_mstate_global->__pyx_n_s_closestPointTo #define __pyx_n_s_closests __pyx_mstate_global->__pyx_n_s_closests +#define __pyx_n_s_collP __pyx_mstate_global->__pyx_n_s_collP #define __pyx_n_s_collShape __pyx_mstate_global->__pyx_n_s_collShape #define __pyx_n_s_collToShapely __pyx_mstate_global->__pyx_n_s_collToShapely #define __pyx_n_u_collToShapely __pyx_mstate_global->__pyx_n_u_collToShapely @@ -8554,6 +8682,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_errorOnLT3 __pyx_mstate_global->__pyx_n_s_errorOnLT3 #define __pyx_n_s_extend __pyx_mstate_global->__pyx_n_s_extend #define __pyx_n_s_exterior __pyx_mstate_global->__pyx_n_s_exterior +#define __pyx_n_s_factor __pyx_mstate_global->__pyx_n_s_factor #define __pyx_n_s_fixangle __pyx_mstate_global->__pyx_n_s_fixangle #define __pyx_n_s_flip __pyx_mstate_global->__pyx_n_s_flip #define __pyx_n_s_float __pyx_mstate_global->__pyx_n_s_float @@ -8600,12 +8729,14 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_kp_s_lib_collisions_py __pyx_mstate_global->__pyx_kp_s_lib_collisions_py #define __pyx_n_s_line __pyx_mstate_global->__pyx_n_s_line #define __pyx_n_s_line_mag __pyx_mstate_global->__pyx_n_s_line_mag +#define __pyx_n_s_lines __pyx_mstate_global->__pyx_n_s_lines #define __pyx_kp_s_list_Point __pyx_mstate_global->__pyx_kp_s_list_Point #define __pyx_n_s_ln __pyx_mstate_global->__pyx_n_s_ln #define __pyx_n_s_lns __pyx_mstate_global->__pyx_n_s_lns #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_math __pyx_mstate_global->__pyx_n_s_math #define __pyx_n_s_max __pyx_mstate_global->__pyx_n_s_max +#define __pyx_n_s_maxTries __pyx_mstate_global->__pyx_n_s_maxTries #define __pyx_n_s_maxs __pyx_mstate_global->__pyx_n_s_maxs #define __pyx_n_s_merged __pyx_mstate_global->__pyx_n_s_merged #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass @@ -8619,6 +8750,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_mycp __pyx_mstate_global->__pyx_n_s_mycp #define __pyx_n_s_n __pyx_mstate_global->__pyx_n_s_n #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name +#define __pyx_n_s_nd __pyx_mstate_global->__pyx_n_s_nd #define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new #define __pyx_n_s_newCir __pyx_mstate_global->__pyx_n_s_newCir #define __pyx_n_s_newLine __pyx_mstate_global->__pyx_n_s_newLine @@ -8631,6 +8763,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_newp2 __pyx_mstate_global->__pyx_n_s_newp2 #define __pyx_n_s_newpts __pyx_mstate_global->__pyx_n_s_newpts #define __pyx_n_s_normal __pyx_mstate_global->__pyx_n_s_normal +#define __pyx_n_s_np __pyx_mstate_global->__pyx_n_s_np #define __pyx_n_s_o __pyx_mstate_global->__pyx_n_s_o #define __pyx_n_s_obj __pyx_mstate_global->__pyx_n_s_obj #define __pyx_n_s_objs __pyx_mstate_global->__pyx_n_s_objs @@ -8749,6 +8882,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_smallness __pyx_mstate_global->__pyx_n_s_smallness #define __pyx_n_s_snd __pyx_mstate_global->__pyx_n_s_snd #define __pyx_n_s_sort __pyx_mstate_global->__pyx_n_s_sort +#define __pyx_n_s_sortFunc __pyx_mstate_global->__pyx_n_s_sortFunc #define __pyx_n_s_sorted __pyx_mstate_global->__pyx_n_s_sorted #define __pyx_n_s_sortedOtherLn __pyx_mstate_global->__pyx_n_s_sortedOtherLn #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec @@ -8777,9 +8911,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_toLines __pyx_mstate_global->__pyx_n_s_toLines #define __pyx_n_s_toPoint __pyx_mstate_global->__pyx_n_s_toPoint #define __pyx_n_s_toPoints __pyx_mstate_global->__pyx_n_s_toPoints -#define __pyx_kp_u_to_BlazeSudio_Shape __pyx_mstate_global->__pyx_kp_u_to_BlazeSudio_Shape #define __pyx_kp_u_to_have_points __pyx_mstate_global->__pyx_kp_u_to_have_points -#define __pyx_kp_u_to_shapely_shape __pyx_mstate_global->__pyx_kp_u_to_shapely_shape #define __pyx_n_s_tries __pyx_mstate_global->__pyx_n_s_tries #define __pyx_kp_s_tuple_Circle_pointLike_verboseOu __pyx_mstate_global->__pyx_kp_s_tuple_Circle_pointLike_verboseOu #define __pyx_kp_s_tuple_ClosedShape_pointLike_verb __pyx_mstate_global->__pyx_kp_s_tuple_ClosedShape_pointLike_verb @@ -8794,6 +8926,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_u __pyx_mstate_global->__pyx_n_s_u #define __pyx_n_s_unary_union __pyx_mstate_global->__pyx_n_s_unary_union #define __pyx_n_s_union __pyx_mstate_global->__pyx_n_s_union +#define __pyx_n_s_unstuckable __pyx_mstate_global->__pyx_n_s_unstuckable #define __pyx_n_s_value __pyx_mstate_global->__pyx_n_s_value #define __pyx_n_s_vel __pyx_mstate_global->__pyx_n_s_vel #define __pyx_n_s_velDiff __pyx_mstate_global->__pyx_n_s_velDiff @@ -8824,6 +8957,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_xj __pyx_mstate_global->__pyx_n_s_xj #define __pyx_n_s_xk __pyx_mstate_global->__pyx_n_s_xk #define __pyx_n_s_xpt __pyx_mstate_global->__pyx_n_s_xpt +#define __pyx_n_s_xs __pyx_mstate_global->__pyx_n_s_xs #define __pyx_n_s_xy __pyx_mstate_global->__pyx_n_s_xy #define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y #define __pyx_n_s_y1 __pyx_mstate_global->__pyx_n_s_y1 @@ -8838,6 +8972,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_yi __pyx_mstate_global->__pyx_n_s_yi #define __pyx_n_s_yj __pyx_mstate_global->__pyx_n_s_yj #define __pyx_n_s_yk __pyx_mstate_global->__pyx_n_s_yk +#define __pyx_n_s_ys __pyx_mstate_global->__pyx_n_s_ys #define __pyx_n_s_zip __pyx_mstate_global->__pyx_n_s_zip #define __pyx_float_0_0 __pyx_mstate_global->__pyx_float_0_0 #define __pyx_float_0_1 __pyx_mstate_global->__pyx_float_0_1 @@ -8849,6 +8984,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_int_3 __pyx_mstate_global->__pyx_int_3 #define __pyx_int_4 __pyx_mstate_global->__pyx_int_4 #define __pyx_int_5 __pyx_mstate_global->__pyx_int_5 +#define __pyx_int_10 __pyx_mstate_global->__pyx_int_10 +#define __pyx_int_50 __pyx_mstate_global->__pyx_int_50 #define __pyx_int_90 __pyx_mstate_global->__pyx_int_90 #define __pyx_int_180 __pyx_mstate_global->__pyx_int_180 #define __pyx_int_270 __pyx_mstate_global->__pyx_int_270 @@ -8864,279 +9001,282 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_int_neg_9 __pyx_mstate_global->__pyx_int_neg_9 #define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_ #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2 -#define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8 +#define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3 #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10 #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12 -#define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15 +#define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14 #define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17 -#define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20 +#define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22 +#define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24 #define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26 -#define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28 -#define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31 -#define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34 +#define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30 +#define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32 +#define __pyx_tuple__35 __pyx_mstate_global->__pyx_tuple__35 #define __pyx_tuple__38 __pyx_mstate_global->__pyx_tuple__38 -#define __pyx_tuple__39 __pyx_mstate_global->__pyx_tuple__39 -#define __pyx_tuple__41 __pyx_mstate_global->__pyx_tuple__41 +#define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42 #define __pyx_tuple__43 __pyx_mstate_global->__pyx_tuple__43 #define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45 #define __pyx_tuple__47 __pyx_mstate_global->__pyx_tuple__47 #define __pyx_tuple__49 __pyx_mstate_global->__pyx_tuple__49 -#define __pyx_tuple__50 __pyx_mstate_global->__pyx_tuple__50 -#define __pyx_tuple__52 __pyx_mstate_global->__pyx_tuple__52 +#define __pyx_tuple__51 __pyx_mstate_global->__pyx_tuple__51 +#define __pyx_tuple__53 __pyx_mstate_global->__pyx_tuple__53 #define __pyx_tuple__54 __pyx_mstate_global->__pyx_tuple__54 #define __pyx_tuple__56 __pyx_mstate_global->__pyx_tuple__56 #define __pyx_tuple__58 __pyx_mstate_global->__pyx_tuple__58 #define __pyx_tuple__60 __pyx_mstate_global->__pyx_tuple__60 #define __pyx_tuple__62 __pyx_mstate_global->__pyx_tuple__62 -#define __pyx_tuple__65 __pyx_mstate_global->__pyx_tuple__65 -#define __pyx_tuple__67 __pyx_mstate_global->__pyx_tuple__67 +#define __pyx_tuple__64 __pyx_mstate_global->__pyx_tuple__64 +#define __pyx_tuple__66 __pyx_mstate_global->__pyx_tuple__66 #define __pyx_tuple__69 __pyx_mstate_global->__pyx_tuple__69 #define __pyx_tuple__71 __pyx_mstate_global->__pyx_tuple__71 +#define __pyx_tuple__73 __pyx_mstate_global->__pyx_tuple__73 #define __pyx_tuple__75 __pyx_mstate_global->__pyx_tuple__75 -#define __pyx_tuple__77 __pyx_mstate_global->__pyx_tuple__77 -#define __pyx_tuple__78 __pyx_mstate_global->__pyx_tuple__78 -#define __pyx_tuple__80 __pyx_mstate_global->__pyx_tuple__80 -#define __pyx_tuple__86 __pyx_mstate_global->__pyx_tuple__86 -#define __pyx_tuple__88 __pyx_mstate_global->__pyx_tuple__88 -#define __pyx_tuple__91 __pyx_mstate_global->__pyx_tuple__91 -#define __pyx_tuple__93 __pyx_mstate_global->__pyx_tuple__93 -#define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9 -#define __pyx_tuple__104 __pyx_mstate_global->__pyx_tuple__104 -#define __pyx_tuple__106 __pyx_mstate_global->__pyx_tuple__106 +#define __pyx_tuple__79 __pyx_mstate_global->__pyx_tuple__79 +#define __pyx_tuple__81 __pyx_mstate_global->__pyx_tuple__81 +#define __pyx_tuple__82 __pyx_mstate_global->__pyx_tuple__82 +#define __pyx_tuple__84 __pyx_mstate_global->__pyx_tuple__84 +#define __pyx_tuple__90 __pyx_mstate_global->__pyx_tuple__90 +#define __pyx_tuple__92 __pyx_mstate_global->__pyx_tuple__92 +#define __pyx_tuple__95 __pyx_mstate_global->__pyx_tuple__95 +#define __pyx_tuple__97 __pyx_mstate_global->__pyx_tuple__97 +#define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4 +#define __pyx_tuple__108 __pyx_mstate_global->__pyx_tuple__108 #define __pyx_tuple__110 __pyx_mstate_global->__pyx_tuple__110 -#define __pyx_tuple__113 __pyx_mstate_global->__pyx_tuple__113 +#define __pyx_tuple__112 __pyx_mstate_global->__pyx_tuple__112 #define __pyx_tuple__115 __pyx_mstate_global->__pyx_tuple__115 #define __pyx_tuple__118 __pyx_mstate_global->__pyx_tuple__118 #define __pyx_tuple__120 __pyx_mstate_global->__pyx_tuple__120 -#define __pyx_tuple__122 __pyx_mstate_global->__pyx_tuple__122 -#define __pyx_tuple__124 __pyx_mstate_global->__pyx_tuple__124 -#define __pyx_tuple__130 __pyx_mstate_global->__pyx_tuple__130 -#define __pyx_tuple__132 __pyx_mstate_global->__pyx_tuple__132 -#define __pyx_tuple__135 __pyx_mstate_global->__pyx_tuple__135 -#define __pyx_tuple__137 __pyx_mstate_global->__pyx_tuple__137 -#define __pyx_tuple__148 __pyx_mstate_global->__pyx_tuple__148 -#define __pyx_tuple__150 __pyx_mstate_global->__pyx_tuple__150 -#define __pyx_tuple__153 __pyx_mstate_global->__pyx_tuple__153 -#define __pyx_tuple__155 __pyx_mstate_global->__pyx_tuple__155 +#define __pyx_tuple__123 __pyx_mstate_global->__pyx_tuple__123 +#define __pyx_tuple__125 __pyx_mstate_global->__pyx_tuple__125 +#define __pyx_tuple__127 __pyx_mstate_global->__pyx_tuple__127 +#define __pyx_tuple__129 __pyx_mstate_global->__pyx_tuple__129 +#define __pyx_tuple__131 __pyx_mstate_global->__pyx_tuple__131 +#define __pyx_tuple__133 __pyx_mstate_global->__pyx_tuple__133 +#define __pyx_tuple__139 __pyx_mstate_global->__pyx_tuple__139 +#define __pyx_tuple__141 __pyx_mstate_global->__pyx_tuple__141 +#define __pyx_tuple__144 __pyx_mstate_global->__pyx_tuple__144 +#define __pyx_tuple__146 __pyx_mstate_global->__pyx_tuple__146 +#define __pyx_tuple__157 __pyx_mstate_global->__pyx_tuple__157 #define __pyx_tuple__159 __pyx_mstate_global->__pyx_tuple__159 -#define __pyx_tuple__163 __pyx_mstate_global->__pyx_tuple__163 -#define __pyx_tuple__167 __pyx_mstate_global->__pyx_tuple__167 -#define __pyx_tuple__173 __pyx_mstate_global->__pyx_tuple__173 -#define __pyx_tuple__175 __pyx_mstate_global->__pyx_tuple__175 -#define __pyx_tuple__177 __pyx_mstate_global->__pyx_tuple__177 -#define __pyx_tuple__179 __pyx_mstate_global->__pyx_tuple__179 -#define __pyx_tuple__181 __pyx_mstate_global->__pyx_tuple__181 -#define __pyx_tuple__183 __pyx_mstate_global->__pyx_tuple__183 -#define __pyx_tuple__185 __pyx_mstate_global->__pyx_tuple__185 +#define __pyx_tuple__162 __pyx_mstate_global->__pyx_tuple__162 +#define __pyx_tuple__164 __pyx_mstate_global->__pyx_tuple__164 +#define __pyx_tuple__168 __pyx_mstate_global->__pyx_tuple__168 +#define __pyx_tuple__172 __pyx_mstate_global->__pyx_tuple__172 +#define __pyx_tuple__176 __pyx_mstate_global->__pyx_tuple__176 +#define __pyx_tuple__182 __pyx_mstate_global->__pyx_tuple__182 +#define __pyx_tuple__184 __pyx_mstate_global->__pyx_tuple__184 +#define __pyx_tuple__186 __pyx_mstate_global->__pyx_tuple__186 +#define __pyx_tuple__188 __pyx_mstate_global->__pyx_tuple__188 +#define __pyx_tuple__190 __pyx_mstate_global->__pyx_tuple__190 #define __pyx_tuple__192 __pyx_mstate_global->__pyx_tuple__192 -#define __pyx_tuple__196 __pyx_mstate_global->__pyx_tuple__196 -#define __pyx_tuple__198 __pyx_mstate_global->__pyx_tuple__198 -#define __pyx_tuple__200 __pyx_mstate_global->__pyx_tuple__200 -#define __pyx_tuple__202 __pyx_mstate_global->__pyx_tuple__202 +#define __pyx_tuple__194 __pyx_mstate_global->__pyx_tuple__194 +#define __pyx_tuple__201 __pyx_mstate_global->__pyx_tuple__201 #define __pyx_tuple__204 __pyx_mstate_global->__pyx_tuple__204 +#define __pyx_tuple__208 __pyx_mstate_global->__pyx_tuple__208 +#define __pyx_tuple__210 __pyx_mstate_global->__pyx_tuple__210 +#define __pyx_tuple__212 __pyx_mstate_global->__pyx_tuple__212 #define __pyx_tuple__214 __pyx_mstate_global->__pyx_tuple__214 #define __pyx_tuple__216 __pyx_mstate_global->__pyx_tuple__216 #define __pyx_tuple__218 __pyx_mstate_global->__pyx_tuple__218 -#define __pyx_tuple__222 __pyx_mstate_global->__pyx_tuple__222 -#define __pyx_tuple__224 __pyx_mstate_global->__pyx_tuple__224 -#define __pyx_tuple__226 __pyx_mstate_global->__pyx_tuple__226 -#define __pyx_tuple__228 __pyx_mstate_global->__pyx_tuple__228 -#define __pyx_tuple__230 __pyx_mstate_global->__pyx_tuple__230 -#define __pyx_tuple__232 __pyx_mstate_global->__pyx_tuple__232 -#define __pyx_tuple__234 __pyx_mstate_global->__pyx_tuple__234 -#define __pyx_tuple__242 __pyx_mstate_global->__pyx_tuple__242 -#define __pyx_tuple__244 __pyx_mstate_global->__pyx_tuple__244 -#define __pyx_tuple__246 __pyx_mstate_global->__pyx_tuple__246 -#define __pyx_tuple__248 __pyx_mstate_global->__pyx_tuple__248 -#define __pyx_tuple__250 __pyx_mstate_global->__pyx_tuple__250 -#define __pyx_tuple__252 __pyx_mstate_global->__pyx_tuple__252 -#define __pyx_tuple__254 __pyx_mstate_global->__pyx_tuple__254 -#define __pyx_tuple__256 __pyx_mstate_global->__pyx_tuple__256 +#define __pyx_tuple__227 __pyx_mstate_global->__pyx_tuple__227 +#define __pyx_tuple__229 __pyx_mstate_global->__pyx_tuple__229 +#define __pyx_tuple__231 __pyx_mstate_global->__pyx_tuple__231 +#define __pyx_tuple__235 __pyx_mstate_global->__pyx_tuple__235 +#define __pyx_tuple__237 __pyx_mstate_global->__pyx_tuple__237 +#define __pyx_tuple__239 __pyx_mstate_global->__pyx_tuple__239 +#define __pyx_tuple__241 __pyx_mstate_global->__pyx_tuple__241 +#define __pyx_tuple__243 __pyx_mstate_global->__pyx_tuple__243 +#define __pyx_tuple__245 __pyx_mstate_global->__pyx_tuple__245 +#define __pyx_tuple__247 __pyx_mstate_global->__pyx_tuple__247 +#define __pyx_tuple__255 __pyx_mstate_global->__pyx_tuple__255 +#define __pyx_tuple__257 __pyx_mstate_global->__pyx_tuple__257 +#define __pyx_tuple__259 __pyx_mstate_global->__pyx_tuple__259 +#define __pyx_tuple__261 __pyx_mstate_global->__pyx_tuple__261 #define __pyx_tuple__263 __pyx_mstate_global->__pyx_tuple__263 +#define __pyx_tuple__265 __pyx_mstate_global->__pyx_tuple__265 #define __pyx_tuple__267 __pyx_mstate_global->__pyx_tuple__267 #define __pyx_tuple__269 __pyx_mstate_global->__pyx_tuple__269 #define __pyx_tuple__276 __pyx_mstate_global->__pyx_tuple__276 -#define __pyx_tuple__278 __pyx_mstate_global->__pyx_tuple__278 #define __pyx_tuple__280 __pyx_mstate_global->__pyx_tuple__280 -#define __pyx_tuple__283 __pyx_mstate_global->__pyx_tuple__283 -#define __pyx_tuple__285 __pyx_mstate_global->__pyx_tuple__285 -#define __pyx_tuple__288 __pyx_mstate_global->__pyx_tuple__288 +#define __pyx_tuple__282 __pyx_mstate_global->__pyx_tuple__282 +#define __pyx_tuple__289 __pyx_mstate_global->__pyx_tuple__289 #define __pyx_tuple__291 __pyx_mstate_global->__pyx_tuple__291 -#define __pyx_tuple__294 __pyx_mstate_global->__pyx_tuple__294 +#define __pyx_tuple__293 __pyx_mstate_global->__pyx_tuple__293 #define __pyx_tuple__296 __pyx_mstate_global->__pyx_tuple__296 #define __pyx_tuple__298 __pyx_mstate_global->__pyx_tuple__298 -#define __pyx_tuple__302 __pyx_mstate_global->__pyx_tuple__302 -#define __pyx_tuple__305 __pyx_mstate_global->__pyx_tuple__305 -#define __pyx_tuple__312 __pyx_mstate_global->__pyx_tuple__312 -#define __pyx_tuple__314 __pyx_mstate_global->__pyx_tuple__314 -#define __pyx_tuple__316 __pyx_mstate_global->__pyx_tuple__316 +#define __pyx_tuple__301 __pyx_mstate_global->__pyx_tuple__301 +#define __pyx_tuple__304 __pyx_mstate_global->__pyx_tuple__304 +#define __pyx_tuple__307 __pyx_mstate_global->__pyx_tuple__307 +#define __pyx_tuple__309 __pyx_mstate_global->__pyx_tuple__309 +#define __pyx_tuple__311 __pyx_mstate_global->__pyx_tuple__311 +#define __pyx_tuple__315 __pyx_mstate_global->__pyx_tuple__315 #define __pyx_tuple__318 __pyx_mstate_global->__pyx_tuple__318 -#define __pyx_tuple__320 __pyx_mstate_global->__pyx_tuple__320 -#define __pyx_tuple__322 __pyx_mstate_global->__pyx_tuple__322 +#define __pyx_tuple__325 __pyx_mstate_global->__pyx_tuple__325 +#define __pyx_tuple__327 __pyx_mstate_global->__pyx_tuple__327 +#define __pyx_tuple__329 __pyx_mstate_global->__pyx_tuple__329 +#define __pyx_tuple__331 __pyx_mstate_global->__pyx_tuple__331 +#define __pyx_tuple__333 __pyx_mstate_global->__pyx_tuple__333 +#define __pyx_tuple__335 __pyx_mstate_global->__pyx_tuple__335 #define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13 -#define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14 +#define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15 #define __pyx_codeobj__16 __pyx_mstate_global->__pyx_codeobj__16 #define __pyx_codeobj__18 __pyx_mstate_global->__pyx_codeobj__18 -#define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19 +#define __pyx_codeobj__20 __pyx_mstate_global->__pyx_codeobj__20 #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23 +#define __pyx_codeobj__25 __pyx_mstate_global->__pyx_codeobj__25 #define __pyx_codeobj__27 __pyx_mstate_global->__pyx_codeobj__27 -#define __pyx_codeobj__29 __pyx_mstate_global->__pyx_codeobj__29 -#define __pyx_codeobj__30 __pyx_mstate_global->__pyx_codeobj__30 -#define __pyx_codeobj__32 __pyx_mstate_global->__pyx_codeobj__32 +#define __pyx_codeobj__31 __pyx_mstate_global->__pyx_codeobj__31 #define __pyx_codeobj__33 __pyx_mstate_global->__pyx_codeobj__33 -#define __pyx_codeobj__35 __pyx_mstate_global->__pyx_codeobj__35 -#define __pyx_codeobj__40 __pyx_mstate_global->__pyx_codeobj__40 -#define __pyx_codeobj__42 __pyx_mstate_global->__pyx_codeobj__42 +#define __pyx_codeobj__34 __pyx_mstate_global->__pyx_codeobj__34 +#define __pyx_codeobj__36 __pyx_mstate_global->__pyx_codeobj__36 +#define __pyx_codeobj__37 __pyx_mstate_global->__pyx_codeobj__37 +#define __pyx_codeobj__39 __pyx_mstate_global->__pyx_codeobj__39 #define __pyx_codeobj__44 __pyx_mstate_global->__pyx_codeobj__44 #define __pyx_codeobj__46 __pyx_mstate_global->__pyx_codeobj__46 #define __pyx_codeobj__48 __pyx_mstate_global->__pyx_codeobj__48 -#define __pyx_codeobj__51 __pyx_mstate_global->__pyx_codeobj__51 -#define __pyx_codeobj__53 __pyx_mstate_global->__pyx_codeobj__53 +#define __pyx_codeobj__50 __pyx_mstate_global->__pyx_codeobj__50 +#define __pyx_codeobj__52 __pyx_mstate_global->__pyx_codeobj__52 #define __pyx_codeobj__55 __pyx_mstate_global->__pyx_codeobj__55 #define __pyx_codeobj__57 __pyx_mstate_global->__pyx_codeobj__57 #define __pyx_codeobj__59 __pyx_mstate_global->__pyx_codeobj__59 #define __pyx_codeobj__61 __pyx_mstate_global->__pyx_codeobj__61 #define __pyx_codeobj__63 __pyx_mstate_global->__pyx_codeobj__63 -#define __pyx_codeobj__64 __pyx_mstate_global->__pyx_codeobj__64 -#define __pyx_codeobj__66 __pyx_mstate_global->__pyx_codeobj__66 +#define __pyx_codeobj__65 __pyx_mstate_global->__pyx_codeobj__65 +#define __pyx_codeobj__67 __pyx_mstate_global->__pyx_codeobj__67 #define __pyx_codeobj__68 __pyx_mstate_global->__pyx_codeobj__68 #define __pyx_codeobj__70 __pyx_mstate_global->__pyx_codeobj__70 #define __pyx_codeobj__72 __pyx_mstate_global->__pyx_codeobj__72 -#define __pyx_codeobj__73 __pyx_mstate_global->__pyx_codeobj__73 #define __pyx_codeobj__74 __pyx_mstate_global->__pyx_codeobj__74 #define __pyx_codeobj__76 __pyx_mstate_global->__pyx_codeobj__76 -#define __pyx_codeobj__79 __pyx_mstate_global->__pyx_codeobj__79 -#define __pyx_codeobj__81 __pyx_mstate_global->__pyx_codeobj__81 -#define __pyx_codeobj__82 __pyx_mstate_global->__pyx_codeobj__82 +#define __pyx_codeobj__77 __pyx_mstate_global->__pyx_codeobj__77 +#define __pyx_codeobj__78 __pyx_mstate_global->__pyx_codeobj__78 +#define __pyx_codeobj__80 __pyx_mstate_global->__pyx_codeobj__80 #define __pyx_codeobj__83 __pyx_mstate_global->__pyx_codeobj__83 -#define __pyx_codeobj__84 __pyx_mstate_global->__pyx_codeobj__84 #define __pyx_codeobj__85 __pyx_mstate_global->__pyx_codeobj__85 +#define __pyx_codeobj__86 __pyx_mstate_global->__pyx_codeobj__86 #define __pyx_codeobj__87 __pyx_mstate_global->__pyx_codeobj__87 +#define __pyx_codeobj__88 __pyx_mstate_global->__pyx_codeobj__88 #define __pyx_codeobj__89 __pyx_mstate_global->__pyx_codeobj__89 -#define __pyx_codeobj__90 __pyx_mstate_global->__pyx_codeobj__90 -#define __pyx_codeobj__92 __pyx_mstate_global->__pyx_codeobj__92 +#define __pyx_codeobj__91 __pyx_mstate_global->__pyx_codeobj__91 +#define __pyx_codeobj__93 __pyx_mstate_global->__pyx_codeobj__93 #define __pyx_codeobj__94 __pyx_mstate_global->__pyx_codeobj__94 -#define __pyx_codeobj__95 __pyx_mstate_global->__pyx_codeobj__95 #define __pyx_codeobj__96 __pyx_mstate_global->__pyx_codeobj__96 -#define __pyx_codeobj__97 __pyx_mstate_global->__pyx_codeobj__97 #define __pyx_codeobj__98 __pyx_mstate_global->__pyx_codeobj__98 #define __pyx_codeobj__99 __pyx_mstate_global->__pyx_codeobj__99 #define __pyx_codeobj__100 __pyx_mstate_global->__pyx_codeobj__100 #define __pyx_codeobj__101 __pyx_mstate_global->__pyx_codeobj__101 #define __pyx_codeobj__102 __pyx_mstate_global->__pyx_codeobj__102 #define __pyx_codeobj__103 __pyx_mstate_global->__pyx_codeobj__103 +#define __pyx_codeobj__104 __pyx_mstate_global->__pyx_codeobj__104 #define __pyx_codeobj__105 __pyx_mstate_global->__pyx_codeobj__105 +#define __pyx_codeobj__106 __pyx_mstate_global->__pyx_codeobj__106 #define __pyx_codeobj__107 __pyx_mstate_global->__pyx_codeobj__107 -#define __pyx_codeobj__108 __pyx_mstate_global->__pyx_codeobj__108 #define __pyx_codeobj__109 __pyx_mstate_global->__pyx_codeobj__109 #define __pyx_codeobj__111 __pyx_mstate_global->__pyx_codeobj__111 -#define __pyx_codeobj__112 __pyx_mstate_global->__pyx_codeobj__112 +#define __pyx_codeobj__113 __pyx_mstate_global->__pyx_codeobj__113 #define __pyx_codeobj__114 __pyx_mstate_global->__pyx_codeobj__114 #define __pyx_codeobj__116 __pyx_mstate_global->__pyx_codeobj__116 #define __pyx_codeobj__117 __pyx_mstate_global->__pyx_codeobj__117 #define __pyx_codeobj__119 __pyx_mstate_global->__pyx_codeobj__119 #define __pyx_codeobj__121 __pyx_mstate_global->__pyx_codeobj__121 -#define __pyx_codeobj__123 __pyx_mstate_global->__pyx_codeobj__123 -#define __pyx_codeobj__125 __pyx_mstate_global->__pyx_codeobj__125 +#define __pyx_codeobj__122 __pyx_mstate_global->__pyx_codeobj__122 +#define __pyx_codeobj__124 __pyx_mstate_global->__pyx_codeobj__124 #define __pyx_codeobj__126 __pyx_mstate_global->__pyx_codeobj__126 -#define __pyx_codeobj__127 __pyx_mstate_global->__pyx_codeobj__127 #define __pyx_codeobj__128 __pyx_mstate_global->__pyx_codeobj__128 -#define __pyx_codeobj__129 __pyx_mstate_global->__pyx_codeobj__129 -#define __pyx_codeobj__131 __pyx_mstate_global->__pyx_codeobj__131 -#define __pyx_codeobj__133 __pyx_mstate_global->__pyx_codeobj__133 +#define __pyx_codeobj__130 __pyx_mstate_global->__pyx_codeobj__130 +#define __pyx_codeobj__132 __pyx_mstate_global->__pyx_codeobj__132 #define __pyx_codeobj__134 __pyx_mstate_global->__pyx_codeobj__134 +#define __pyx_codeobj__135 __pyx_mstate_global->__pyx_codeobj__135 #define __pyx_codeobj__136 __pyx_mstate_global->__pyx_codeobj__136 +#define __pyx_codeobj__137 __pyx_mstate_global->__pyx_codeobj__137 #define __pyx_codeobj__138 __pyx_mstate_global->__pyx_codeobj__138 -#define __pyx_codeobj__139 __pyx_mstate_global->__pyx_codeobj__139 #define __pyx_codeobj__140 __pyx_mstate_global->__pyx_codeobj__140 -#define __pyx_codeobj__141 __pyx_mstate_global->__pyx_codeobj__141 #define __pyx_codeobj__142 __pyx_mstate_global->__pyx_codeobj__142 #define __pyx_codeobj__143 __pyx_mstate_global->__pyx_codeobj__143 -#define __pyx_codeobj__144 __pyx_mstate_global->__pyx_codeobj__144 #define __pyx_codeobj__145 __pyx_mstate_global->__pyx_codeobj__145 -#define __pyx_codeobj__146 __pyx_mstate_global->__pyx_codeobj__146 +#define __pyx_codeobj__147 __pyx_mstate_global->__pyx_codeobj__147 +#define __pyx_codeobj__148 __pyx_mstate_global->__pyx_codeobj__148 #define __pyx_codeobj__149 __pyx_mstate_global->__pyx_codeobj__149 +#define __pyx_codeobj__150 __pyx_mstate_global->__pyx_codeobj__150 #define __pyx_codeobj__151 __pyx_mstate_global->__pyx_codeobj__151 #define __pyx_codeobj__152 __pyx_mstate_global->__pyx_codeobj__152 +#define __pyx_codeobj__153 __pyx_mstate_global->__pyx_codeobj__153 #define __pyx_codeobj__154 __pyx_mstate_global->__pyx_codeobj__154 -#define __pyx_codeobj__156 __pyx_mstate_global->__pyx_codeobj__156 -#define __pyx_codeobj__157 __pyx_mstate_global->__pyx_codeobj__157 +#define __pyx_codeobj__155 __pyx_mstate_global->__pyx_codeobj__155 #define __pyx_codeobj__158 __pyx_mstate_global->__pyx_codeobj__158 #define __pyx_codeobj__160 __pyx_mstate_global->__pyx_codeobj__160 #define __pyx_codeobj__161 __pyx_mstate_global->__pyx_codeobj__161 -#define __pyx_codeobj__162 __pyx_mstate_global->__pyx_codeobj__162 -#define __pyx_codeobj__164 __pyx_mstate_global->__pyx_codeobj__164 +#define __pyx_codeobj__163 __pyx_mstate_global->__pyx_codeobj__163 #define __pyx_codeobj__165 __pyx_mstate_global->__pyx_codeobj__165 #define __pyx_codeobj__166 __pyx_mstate_global->__pyx_codeobj__166 -#define __pyx_codeobj__168 __pyx_mstate_global->__pyx_codeobj__168 +#define __pyx_codeobj__167 __pyx_mstate_global->__pyx_codeobj__167 #define __pyx_codeobj__169 __pyx_mstate_global->__pyx_codeobj__169 #define __pyx_codeobj__170 __pyx_mstate_global->__pyx_codeobj__170 #define __pyx_codeobj__171 __pyx_mstate_global->__pyx_codeobj__171 -#define __pyx_codeobj__172 __pyx_mstate_global->__pyx_codeobj__172 +#define __pyx_codeobj__173 __pyx_mstate_global->__pyx_codeobj__173 #define __pyx_codeobj__174 __pyx_mstate_global->__pyx_codeobj__174 -#define __pyx_codeobj__176 __pyx_mstate_global->__pyx_codeobj__176 +#define __pyx_codeobj__175 __pyx_mstate_global->__pyx_codeobj__175 +#define __pyx_codeobj__177 __pyx_mstate_global->__pyx_codeobj__177 #define __pyx_codeobj__178 __pyx_mstate_global->__pyx_codeobj__178 +#define __pyx_codeobj__179 __pyx_mstate_global->__pyx_codeobj__179 #define __pyx_codeobj__180 __pyx_mstate_global->__pyx_codeobj__180 -#define __pyx_codeobj__182 __pyx_mstate_global->__pyx_codeobj__182 -#define __pyx_codeobj__184 __pyx_mstate_global->__pyx_codeobj__184 -#define __pyx_codeobj__186 __pyx_mstate_global->__pyx_codeobj__186 +#define __pyx_codeobj__181 __pyx_mstate_global->__pyx_codeobj__181 +#define __pyx_codeobj__183 __pyx_mstate_global->__pyx_codeobj__183 +#define __pyx_codeobj__185 __pyx_mstate_global->__pyx_codeobj__185 #define __pyx_codeobj__187 __pyx_mstate_global->__pyx_codeobj__187 -#define __pyx_codeobj__188 __pyx_mstate_global->__pyx_codeobj__188 #define __pyx_codeobj__189 __pyx_mstate_global->__pyx_codeobj__189 -#define __pyx_codeobj__190 __pyx_mstate_global->__pyx_codeobj__190 #define __pyx_codeobj__191 __pyx_mstate_global->__pyx_codeobj__191 #define __pyx_codeobj__193 __pyx_mstate_global->__pyx_codeobj__193 -#define __pyx_codeobj__194 __pyx_mstate_global->__pyx_codeobj__194 #define __pyx_codeobj__195 __pyx_mstate_global->__pyx_codeobj__195 +#define __pyx_codeobj__196 __pyx_mstate_global->__pyx_codeobj__196 #define __pyx_codeobj__197 __pyx_mstate_global->__pyx_codeobj__197 +#define __pyx_codeobj__198 __pyx_mstate_global->__pyx_codeobj__198 #define __pyx_codeobj__199 __pyx_mstate_global->__pyx_codeobj__199 -#define __pyx_codeobj__201 __pyx_mstate_global->__pyx_codeobj__201 +#define __pyx_codeobj__200 __pyx_mstate_global->__pyx_codeobj__200 +#define __pyx_codeobj__202 __pyx_mstate_global->__pyx_codeobj__202 #define __pyx_codeobj__203 __pyx_mstate_global->__pyx_codeobj__203 #define __pyx_codeobj__205 __pyx_mstate_global->__pyx_codeobj__205 #define __pyx_codeobj__206 __pyx_mstate_global->__pyx_codeobj__206 #define __pyx_codeobj__207 __pyx_mstate_global->__pyx_codeobj__207 -#define __pyx_codeobj__208 __pyx_mstate_global->__pyx_codeobj__208 #define __pyx_codeobj__209 __pyx_mstate_global->__pyx_codeobj__209 -#define __pyx_codeobj__210 __pyx_mstate_global->__pyx_codeobj__210 #define __pyx_codeobj__211 __pyx_mstate_global->__pyx_codeobj__211 -#define __pyx_codeobj__212 __pyx_mstate_global->__pyx_codeobj__212 #define __pyx_codeobj__213 __pyx_mstate_global->__pyx_codeobj__213 #define __pyx_codeobj__215 __pyx_mstate_global->__pyx_codeobj__215 #define __pyx_codeobj__217 __pyx_mstate_global->__pyx_codeobj__217 #define __pyx_codeobj__219 __pyx_mstate_global->__pyx_codeobj__219 #define __pyx_codeobj__220 __pyx_mstate_global->__pyx_codeobj__220 #define __pyx_codeobj__221 __pyx_mstate_global->__pyx_codeobj__221 +#define __pyx_codeobj__222 __pyx_mstate_global->__pyx_codeobj__222 #define __pyx_codeobj__223 __pyx_mstate_global->__pyx_codeobj__223 +#define __pyx_codeobj__224 __pyx_mstate_global->__pyx_codeobj__224 #define __pyx_codeobj__225 __pyx_mstate_global->__pyx_codeobj__225 -#define __pyx_codeobj__227 __pyx_mstate_global->__pyx_codeobj__227 -#define __pyx_codeobj__229 __pyx_mstate_global->__pyx_codeobj__229 -#define __pyx_codeobj__231 __pyx_mstate_global->__pyx_codeobj__231 +#define __pyx_codeobj__226 __pyx_mstate_global->__pyx_codeobj__226 +#define __pyx_codeobj__228 __pyx_mstate_global->__pyx_codeobj__228 +#define __pyx_codeobj__230 __pyx_mstate_global->__pyx_codeobj__230 +#define __pyx_codeobj__232 __pyx_mstate_global->__pyx_codeobj__232 #define __pyx_codeobj__233 __pyx_mstate_global->__pyx_codeobj__233 -#define __pyx_codeobj__235 __pyx_mstate_global->__pyx_codeobj__235 +#define __pyx_codeobj__234 __pyx_mstate_global->__pyx_codeobj__234 #define __pyx_codeobj__236 __pyx_mstate_global->__pyx_codeobj__236 -#define __pyx_codeobj__237 __pyx_mstate_global->__pyx_codeobj__237 #define __pyx_codeobj__238 __pyx_mstate_global->__pyx_codeobj__238 -#define __pyx_codeobj__239 __pyx_mstate_global->__pyx_codeobj__239 #define __pyx_codeobj__240 __pyx_mstate_global->__pyx_codeobj__240 -#define __pyx_codeobj__241 __pyx_mstate_global->__pyx_codeobj__241 -#define __pyx_codeobj__243 __pyx_mstate_global->__pyx_codeobj__243 -#define __pyx_codeobj__245 __pyx_mstate_global->__pyx_codeobj__245 -#define __pyx_codeobj__247 __pyx_mstate_global->__pyx_codeobj__247 +#define __pyx_codeobj__242 __pyx_mstate_global->__pyx_codeobj__242 +#define __pyx_codeobj__244 __pyx_mstate_global->__pyx_codeobj__244 +#define __pyx_codeobj__246 __pyx_mstate_global->__pyx_codeobj__246 +#define __pyx_codeobj__248 __pyx_mstate_global->__pyx_codeobj__248 #define __pyx_codeobj__249 __pyx_mstate_global->__pyx_codeobj__249 +#define __pyx_codeobj__250 __pyx_mstate_global->__pyx_codeobj__250 #define __pyx_codeobj__251 __pyx_mstate_global->__pyx_codeobj__251 +#define __pyx_codeobj__252 __pyx_mstate_global->__pyx_codeobj__252 #define __pyx_codeobj__253 __pyx_mstate_global->__pyx_codeobj__253 -#define __pyx_codeobj__255 __pyx_mstate_global->__pyx_codeobj__255 -#define __pyx_codeobj__257 __pyx_mstate_global->__pyx_codeobj__257 +#define __pyx_codeobj__254 __pyx_mstate_global->__pyx_codeobj__254 +#define __pyx_codeobj__256 __pyx_mstate_global->__pyx_codeobj__256 #define __pyx_codeobj__258 __pyx_mstate_global->__pyx_codeobj__258 -#define __pyx_codeobj__259 __pyx_mstate_global->__pyx_codeobj__259 #define __pyx_codeobj__260 __pyx_mstate_global->__pyx_codeobj__260 -#define __pyx_codeobj__261 __pyx_mstate_global->__pyx_codeobj__261 #define __pyx_codeobj__262 __pyx_mstate_global->__pyx_codeobj__262 #define __pyx_codeobj__264 __pyx_mstate_global->__pyx_codeobj__264 -#define __pyx_codeobj__265 __pyx_mstate_global->__pyx_codeobj__265 #define __pyx_codeobj__266 __pyx_mstate_global->__pyx_codeobj__266 #define __pyx_codeobj__268 __pyx_mstate_global->__pyx_codeobj__268 #define __pyx_codeobj__270 __pyx_mstate_global->__pyx_codeobj__270 @@ -9146,35 +9286,45 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_codeobj__274 __pyx_mstate_global->__pyx_codeobj__274 #define __pyx_codeobj__275 __pyx_mstate_global->__pyx_codeobj__275 #define __pyx_codeobj__277 __pyx_mstate_global->__pyx_codeobj__277 +#define __pyx_codeobj__278 __pyx_mstate_global->__pyx_codeobj__278 #define __pyx_codeobj__279 __pyx_mstate_global->__pyx_codeobj__279 #define __pyx_codeobj__281 __pyx_mstate_global->__pyx_codeobj__281 -#define __pyx_codeobj__282 __pyx_mstate_global->__pyx_codeobj__282 +#define __pyx_codeobj__283 __pyx_mstate_global->__pyx_codeobj__283 #define __pyx_codeobj__284 __pyx_mstate_global->__pyx_codeobj__284 +#define __pyx_codeobj__285 __pyx_mstate_global->__pyx_codeobj__285 #define __pyx_codeobj__286 __pyx_mstate_global->__pyx_codeobj__286 #define __pyx_codeobj__287 __pyx_mstate_global->__pyx_codeobj__287 -#define __pyx_codeobj__289 __pyx_mstate_global->__pyx_codeobj__289 +#define __pyx_codeobj__288 __pyx_mstate_global->__pyx_codeobj__288 #define __pyx_codeobj__290 __pyx_mstate_global->__pyx_codeobj__290 #define __pyx_codeobj__292 __pyx_mstate_global->__pyx_codeobj__292 -#define __pyx_codeobj__293 __pyx_mstate_global->__pyx_codeobj__293 +#define __pyx_codeobj__294 __pyx_mstate_global->__pyx_codeobj__294 #define __pyx_codeobj__295 __pyx_mstate_global->__pyx_codeobj__295 #define __pyx_codeobj__297 __pyx_mstate_global->__pyx_codeobj__297 #define __pyx_codeobj__299 __pyx_mstate_global->__pyx_codeobj__299 #define __pyx_codeobj__300 __pyx_mstate_global->__pyx_codeobj__300 -#define __pyx_codeobj__301 __pyx_mstate_global->__pyx_codeobj__301 +#define __pyx_codeobj__302 __pyx_mstate_global->__pyx_codeobj__302 #define __pyx_codeobj__303 __pyx_mstate_global->__pyx_codeobj__303 -#define __pyx_codeobj__304 __pyx_mstate_global->__pyx_codeobj__304 +#define __pyx_codeobj__305 __pyx_mstate_global->__pyx_codeobj__305 #define __pyx_codeobj__306 __pyx_mstate_global->__pyx_codeobj__306 -#define __pyx_codeobj__307 __pyx_mstate_global->__pyx_codeobj__307 #define __pyx_codeobj__308 __pyx_mstate_global->__pyx_codeobj__308 -#define __pyx_codeobj__309 __pyx_mstate_global->__pyx_codeobj__309 #define __pyx_codeobj__310 __pyx_mstate_global->__pyx_codeobj__310 -#define __pyx_codeobj__311 __pyx_mstate_global->__pyx_codeobj__311 +#define __pyx_codeobj__312 __pyx_mstate_global->__pyx_codeobj__312 #define __pyx_codeobj__313 __pyx_mstate_global->__pyx_codeobj__313 -#define __pyx_codeobj__315 __pyx_mstate_global->__pyx_codeobj__315 +#define __pyx_codeobj__314 __pyx_mstate_global->__pyx_codeobj__314 +#define __pyx_codeobj__316 __pyx_mstate_global->__pyx_codeobj__316 #define __pyx_codeobj__317 __pyx_mstate_global->__pyx_codeobj__317 #define __pyx_codeobj__319 __pyx_mstate_global->__pyx_codeobj__319 +#define __pyx_codeobj__320 __pyx_mstate_global->__pyx_codeobj__320 #define __pyx_codeobj__321 __pyx_mstate_global->__pyx_codeobj__321 +#define __pyx_codeobj__322 __pyx_mstate_global->__pyx_codeobj__322 #define __pyx_codeobj__323 __pyx_mstate_global->__pyx_codeobj__323 +#define __pyx_codeobj__324 __pyx_mstate_global->__pyx_codeobj__324 +#define __pyx_codeobj__326 __pyx_mstate_global->__pyx_codeobj__326 +#define __pyx_codeobj__328 __pyx_mstate_global->__pyx_codeobj__328 +#define __pyx_codeobj__330 __pyx_mstate_global->__pyx_codeobj__330 +#define __pyx_codeobj__332 __pyx_mstate_global->__pyx_codeobj__332 +#define __pyx_codeobj__334 __pyx_mstate_global->__pyx_codeobj__334 +#define __pyx_codeobj__336 __pyx_mstate_global->__pyx_codeobj__336 /* #### Code section: module_code ### */ /* "collisions.py":49 @@ -10458,7 +10608,7 @@ static PyObject *__pyx_pf_10collisions_8pointOnCircle(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* "collisions.py":150 +/* "collisions.py":152 * Polygon = -9 * * def checkShpType(shape: Union['Shape', 'Shapes'], *typs: Union[ShpTyps, ShpGroups]) -> bool: # <<<<<<<<<<<<<< @@ -10527,13 +10677,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 152, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; const Py_ssize_t used_pos_args = (kwd_pos_args < 1) ? kwd_pos_args : 1; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, used_pos_args, "checkShpType") < 0)) __PYX_ERR(0, 150, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, used_pos_args, "checkShpType") < 0)) __PYX_ERR(0, 152, __pyx_L3_error) } } else if (unlikely(__pyx_nargs < 1)) { goto __pyx_L5_argtuple_error; @@ -10544,7 +10694,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("checkShpType", 0, 1, 1, __pyx_nargs); __PYX_ERR(0, 150, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("checkShpType", 0, 1, 1, __pyx_nargs); __PYX_ERR(0, 152, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10586,46 +10736,46 @@ static PyObject *__pyx_pf_10collisions_10checkShpType(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("checkShpType", 1); - /* "collisions.py":163 + /* "collisions.py":165 * bool: Whether the shape is of the specified type(s) or group(s). * """ * typ_set = set(typs) # <<<<<<<<<<<<<< * if typ_set.intersection(shape.GROUPS) or shape.TYPE in typ_set: * return True */ - __pyx_t_1 = PySet_New(__pyx_v_typs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_t_1 = PySet_New(__pyx_v_typs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_typ_set = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":164 + /* "collisions.py":166 * """ * typ_set = set(typs) * if typ_set.intersection(shape.GROUPS) or shape.TYPE in typ_set: # <<<<<<<<<<<<<< * return True * return False */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_GROUPS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_GROUPS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_intersection, __pyx_v_typ_set, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_3 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_intersection, __pyx_v_typ_set, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_4) { } else { __pyx_t_2 = __pyx_t_4; goto __pyx_L4_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_TYPE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_TYPE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = (__Pyx_PySet_ContainsTF(__pyx_t_3, __pyx_v_typ_set, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_4 = (__Pyx_PySet_ContainsTF(__pyx_t_3, __pyx_v_typ_set, Py_EQ)); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_2 = __pyx_t_4; __pyx_L4_bool_binop_done:; if (__pyx_t_2) { - /* "collisions.py":165 + /* "collisions.py":167 * typ_set = set(typs) * if typ_set.intersection(shape.GROUPS) or shape.TYPE in typ_set: * return True # <<<<<<<<<<<<<< @@ -10637,7 +10787,7 @@ static PyObject *__pyx_pf_10collisions_10checkShpType(CYTHON_UNUSED PyObject *__ __pyx_r = Py_True; goto __pyx_L0; - /* "collisions.py":164 + /* "collisions.py":166 * """ * typ_set = set(typs) * if typ_set.intersection(shape.GROUPS) or shape.TYPE in typ_set: # <<<<<<<<<<<<<< @@ -10646,7 +10796,7 @@ static PyObject *__pyx_pf_10collisions_10checkShpType(CYTHON_UNUSED PyObject *__ */ } - /* "collisions.py":166 + /* "collisions.py":168 * if typ_set.intersection(shape.GROUPS) or shape.TYPE in typ_set: * return True * return False # <<<<<<<<<<<<<< @@ -10658,7 +10808,7 @@ static PyObject *__pyx_pf_10collisions_10checkShpType(CYTHON_UNUSED PyObject *__ __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":150 + /* "collisions.py":152 * Polygon = -9 * * def checkShpType(shape: Union['Shape', 'Shapes'], *typs: Union[ShpTyps, ShpGroups]) -> bool: # <<<<<<<<<<<<<< @@ -10679,7 +10829,7 @@ static PyObject *__pyx_pf_10collisions_10checkShpType(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* "collisions.py":168 +/* "collisions.py":170 * return False * * def shapelyToColl(shapelyShape: shapelyGeom.base.BaseGeometry) -> Union['Shape', 'Shapes']: # <<<<<<<<<<<<<< @@ -10741,12 +10891,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 168, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 170, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "shapelyToColl") < 0)) __PYX_ERR(0, 168, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "shapelyToColl") < 0)) __PYX_ERR(0, 170, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -10757,7 +10907,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("shapelyToColl", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 168, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("shapelyToColl", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 170, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -10801,22 +10951,21 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ PyObject *(*__pyx_t_9)(PyObject *); int __pyx_t_10; PyObject *__pyx_t_11 = NULL; - Py_UCS4 __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("shapelyToColl", 1); - /* "collisions.py":178 + /* "collisions.py":180 * Shape | Shapes: The converted shape. * """ * if shapely.is_empty(shapelyShape): # <<<<<<<<<<<<<< * return NoShape() * if isinstance(shapelyShape, shapelyGeom.Point): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapely); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapely); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_is_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_is_empty); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -10837,15 +10986,15 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_shapelyShape}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 178, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "collisions.py":179 + /* "collisions.py":181 * """ * if shapely.is_empty(shapelyShape): * return NoShape() # <<<<<<<<<<<<<< @@ -10853,7 +11002,7 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ * return Point(shapelyShape.x, shapelyShape.y) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_NoShape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_NoShape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_4 = 0; @@ -10873,7 +11022,7 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 179, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -10881,7 +11030,7 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":178 + /* "collisions.py":180 * Shape | Shapes: The converted shape. * """ * if shapely.is_empty(shapelyShape): # <<<<<<<<<<<<<< @@ -10890,23 +11039,23 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ */ } - /* "collisions.py":180 + /* "collisions.py":182 * if shapely.is_empty(shapelyShape): * return NoShape() * if isinstance(shapelyShape, shapelyGeom.Point): # <<<<<<<<<<<<<< * return Point(shapelyShape.x, shapelyShape.y) * if isinstance(shapelyShape, shapelyGeom.LineString): */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = PyObject_IsInstance(__pyx_v_shapelyShape, __pyx_t_3); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 180, __pyx_L1_error) + __pyx_t_5 = PyObject_IsInstance(__pyx_v_shapelyShape, __pyx_t_3); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { - /* "collisions.py":181 + /* "collisions.py":183 * return NoShape() * if isinstance(shapelyShape, shapelyGeom.Point): * return Point(shapelyShape.x, shapelyShape.y) # <<<<<<<<<<<<<< @@ -10914,11 +11063,11 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ * return ShapeCombiner.pointsToShape(*list(zip(*[list(i) for i in shapelyShape.coords.xy]))) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Point); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Point); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_shapelyShape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_shapelyShape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_shapelyShape, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_shapelyShape, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_4 = 0; @@ -10940,7 +11089,7 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -10948,7 +11097,7 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":180 + /* "collisions.py":182 * if shapely.is_empty(shapelyShape): * return NoShape() * if isinstance(shapelyShape, shapelyGeom.Point): # <<<<<<<<<<<<<< @@ -10957,23 +11106,23 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ */ } - /* "collisions.py":182 + /* "collisions.py":184 * if isinstance(shapelyShape, shapelyGeom.Point): * return Point(shapelyShape.x, shapelyShape.y) * if isinstance(shapelyShape, shapelyGeom.LineString): # <<<<<<<<<<<<<< * return ShapeCombiner.pointsToShape(*list(zip(*[list(i) for i in shapelyShape.coords.xy]))) * if isinstance(shapelyShape, shapelyGeom.Polygon): */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_LineString); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_LineString); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = PyObject_IsInstance(__pyx_v_shapelyShape, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_5 = PyObject_IsInstance(__pyx_v_shapelyShape, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "collisions.py":183 + /* "collisions.py":185 * return Point(shapelyShape.x, shapelyShape.y) * if isinstance(shapelyShape, shapelyGeom.LineString): * return ShapeCombiner.pointsToShape(*list(zip(*[list(i) for i in shapelyShape.coords.xy]))) # <<<<<<<<<<<<<< @@ -10981,17 +11130,17 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ * return ShapeCombiner.pointsToShape(*list(zip(*[list(i) for i in shapelyShape.exterior.coords.xy]))) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ShapeCombiner); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ShapeCombiner); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pointsToShape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pointsToShape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L8_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_shapelyShape, __pyx_n_s_coords); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 183, __pyx_L8_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_shapelyShape, __pyx_n_s_coords); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 185, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_xy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L8_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_xy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { @@ -10999,9 +11148,9 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 183, __pyx_L8_error) + __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 185, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 183, __pyx_L8_error) + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 185, __pyx_L8_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -11010,28 +11159,28 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 183, __pyx_L8_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 185, __pyx_L8_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 183, __pyx_L8_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 185, __pyx_L8_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L8_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 183, __pyx_L8_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 185, __pyx_L8_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 183, __pyx_L8_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 185, __pyx_L8_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L8_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -11041,7 +11190,7 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 183, __pyx_L8_error) + else __PYX_ERR(0, 185, __pyx_L8_error) } break; } @@ -11049,9 +11198,9 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ } __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PySequence_List(__pyx_7genexpr__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L8_error) + __pyx_t_2 = PySequence_List(__pyx_7genexpr__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 183, __pyx_L8_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 185, __pyx_L8_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -11062,19 +11211,19 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ goto __pyx_L1_error; __pyx_L12_exit_scope:; } /* exit inner scope */ - __pyx_t_6 = PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 183, __pyx_L1_error) + __pyx_t_6 = PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 183, __pyx_L1_error) + __pyx_t_6 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PySequence_Tuple(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error) + __pyx_t_1 = PySequence_Tuple(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 183, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11082,7 +11231,7 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ __pyx_t_6 = 0; goto __pyx_L0; - /* "collisions.py":182 + /* "collisions.py":184 * if isinstance(shapelyShape, shapelyGeom.Point): * return Point(shapelyShape.x, shapelyShape.y) * if isinstance(shapelyShape, shapelyGeom.LineString): # <<<<<<<<<<<<<< @@ -11091,23 +11240,23 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ */ } - /* "collisions.py":184 + /* "collisions.py":186 * if isinstance(shapelyShape, shapelyGeom.LineString): * return ShapeCombiner.pointsToShape(*list(zip(*[list(i) for i in shapelyShape.coords.xy]))) * if isinstance(shapelyShape, shapelyGeom.Polygon): # <<<<<<<<<<<<<< * return ShapeCombiner.pointsToShape(*list(zip(*[list(i) for i in shapelyShape.exterior.coords.xy]))) * if isinstance(shapelyShape, (shapelyGeom.MultiPoint, shapelyGeom.MultiLineString, shapelyGeom.MultiPolygon, shapelyGeom.GeometryCollection)): */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 184, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_5 = PyObject_IsInstance(__pyx_v_shapelyShape, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_5 = PyObject_IsInstance(__pyx_v_shapelyShape, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "collisions.py":185 + /* "collisions.py":187 * return ShapeCombiner.pointsToShape(*list(zip(*[list(i) for i in shapelyShape.coords.xy]))) * if isinstance(shapelyShape, shapelyGeom.Polygon): * return ShapeCombiner.pointsToShape(*list(zip(*[list(i) for i in shapelyShape.exterior.coords.xy]))) # <<<<<<<<<<<<<< @@ -11115,20 +11264,20 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ * return Shapes(*[shapelyToColl(i) for i in shapelyShape.geoms]) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ShapeCombiner); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ShapeCombiner); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pointsToShape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pointsToShape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L16_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_shapelyShape, __pyx_n_s_exterior); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L16_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_shapelyShape, __pyx_n_s_exterior); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_coords); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L16_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_coords); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_xy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L16_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_xy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { @@ -11136,9 +11285,9 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L16_error) + __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 185, __pyx_L16_error) + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 187, __pyx_L16_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -11147,28 +11296,28 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 185, __pyx_L16_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 187, __pyx_L16_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 185, __pyx_L16_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 187, __pyx_L16_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L16_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 185, __pyx_L16_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 187, __pyx_L16_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 185, __pyx_L16_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 187, __pyx_L16_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L16_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -11178,7 +11327,7 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 185, __pyx_L16_error) + else __PYX_ERR(0, 187, __pyx_L16_error) } break; } @@ -11186,9 +11335,9 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ } __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_i, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PySequence_List(__pyx_8genexpr1__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 185, __pyx_L16_error) + __pyx_t_3 = PySequence_List(__pyx_8genexpr1__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_3); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 185, __pyx_L16_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 187, __pyx_L16_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -11199,19 +11348,19 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ goto __pyx_L1_error; __pyx_L20_exit_scope:; } /* exit inner scope */ - __pyx_t_2 = PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_2 = PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_1 = PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11219,7 +11368,7 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":184 + /* "collisions.py":186 * if isinstance(shapelyShape, shapelyGeom.LineString): * return ShapeCombiner.pointsToShape(*list(zip(*[list(i) for i in shapelyShape.coords.xy]))) * if isinstance(shapelyShape, shapelyGeom.Polygon): # <<<<<<<<<<<<<< @@ -11228,31 +11377,31 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ */ } - /* "collisions.py":186 + /* "collisions.py":188 * if isinstance(shapelyShape, shapelyGeom.Polygon): * return ShapeCombiner.pointsToShape(*list(zip(*[list(i) for i in shapelyShape.exterior.coords.xy]))) * if isinstance(shapelyShape, (shapelyGeom.MultiPoint, shapelyGeom.MultiLineString, shapelyGeom.MultiPolygon, shapelyGeom.GeometryCollection)): # <<<<<<<<<<<<<< * return Shapes(*[shapelyToColl(i) for i in shapelyShape.geoms]) - * raise ValueError(f'Cannot convert shapely shape of type {type(shapelyShape)} to BlazeSudio Shape') + * return NoShape() */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_MultiPoint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_MultiPoint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_MultiLineString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_MultiLineString); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_MultiPolygon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_MultiPolygon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_GeometryCollection); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_GeometryCollection); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_10 = PyObject_IsInstance(__pyx_v_shapelyShape, __pyx_t_1); @@ -11282,29 +11431,29 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "collisions.py":187 + /* "collisions.py":189 * return ShapeCombiner.pointsToShape(*list(zip(*[list(i) for i in shapelyShape.exterior.coords.xy]))) * if isinstance(shapelyShape, (shapelyGeom.MultiPoint, shapelyGeom.MultiLineString, shapelyGeom.MultiPolygon, shapelyGeom.GeometryCollection)): * return Shapes(*[shapelyToColl(i) for i in shapelyShape.geoms]) # <<<<<<<<<<<<<< + * return NoShape() * raise ValueError(f'Cannot convert shapely shape of type {type(shapelyShape)} to BlazeSudio Shape') - * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); { /* enter inner scope */ - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 187, __pyx_L28_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 189, __pyx_L28_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_shapelyShape, __pyx_n_s_geoms); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L28_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_shapelyShape, __pyx_n_s_geoms); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L28_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_7 = __pyx_t_3; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 187, __pyx_L28_error) + __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 189, __pyx_L28_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 187, __pyx_L28_error) + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 189, __pyx_L28_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -11313,28 +11462,28 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 187, __pyx_L28_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 189, __pyx_L28_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 187, __pyx_L28_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 189, __pyx_L28_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L28_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L28_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 187, __pyx_L28_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 189, __pyx_L28_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 187, __pyx_L28_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 189, __pyx_L28_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L28_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L28_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -11344,7 +11493,7 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 187, __pyx_L28_error) + else __PYX_ERR(0, 189, __pyx_L28_error) } break; } @@ -11352,7 +11501,7 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ } __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_i, __pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapelyToColl); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L28_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapelyToColl); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L28_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_11 = NULL; __pyx_t_4 = 0; @@ -11372,11 +11521,11 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_8genexpr2__pyx_v_i}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L28_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L28_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 187, __pyx_L28_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 189, __pyx_L28_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -11387,10 +11536,10 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ goto __pyx_L1_error; __pyx_L32_exit_scope:; } /* exit inner scope */ - __pyx_t_7 = PySequence_Tuple(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_7 = PySequence_Tuple(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -11398,52 +11547,52 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ __pyx_t_6 = 0; goto __pyx_L0; - /* "collisions.py":186 + /* "collisions.py":188 * if isinstance(shapelyShape, shapelyGeom.Polygon): * return ShapeCombiner.pointsToShape(*list(zip(*[list(i) for i in shapelyShape.exterior.coords.xy]))) * if isinstance(shapelyShape, (shapelyGeom.MultiPoint, shapelyGeom.MultiLineString, shapelyGeom.MultiPolygon, shapelyGeom.GeometryCollection)): # <<<<<<<<<<<<<< * return Shapes(*[shapelyToColl(i) for i in shapelyShape.geoms]) - * raise ValueError(f'Cannot convert shapely shape of type {type(shapelyShape)} to BlazeSudio Shape') + * return NoShape() */ } - /* "collisions.py":188 + /* "collisions.py":190 * if isinstance(shapelyShape, (shapelyGeom.MultiPoint, shapelyGeom.MultiLineString, shapelyGeom.MultiPolygon, shapelyGeom.GeometryCollection)): * return Shapes(*[shapelyToColl(i) for i in shapelyShape.geoms]) - * raise ValueError(f'Cannot convert shapely shape of type {type(shapelyShape)} to BlazeSudio Shape') # <<<<<<<<<<<<<< + * return NoShape() # <<<<<<<<<<<<<< + * raise ValueError(f'Cannot convert shapely shape of type {type(shapelyShape)} to BlazeSudio Shape') * - * def collToShapely(collShape: 'Shape') -> shapelyGeom.base.BaseGeometry: */ - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = 0; - __pyx_t_12 = 127; - __Pyx_INCREF(__pyx_kp_u_Cannot_convert_shapely_shape_of); - __pyx_t_8 += 37; - __Pyx_GIVEREF(__pyx_kp_u_Cannot_convert_shapely_shape_of); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u_Cannot_convert_shapely_shape_of); - __pyx_t_7 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_shapelyShape)), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_12 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_12) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_12; - __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7); - __pyx_t_7 = 0; - __Pyx_INCREF(__pyx_kp_u_to_BlazeSudio_Shape); - __pyx_t_8 += 20; - __Pyx_GIVEREF(__pyx_kp_u_to_BlazeSudio_Shape); - PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u_to_BlazeSudio_Shape); - __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_6, 3, __pyx_t_8, __pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_NoShape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 188, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 188, __pyx_L1_error) + __pyx_t_1 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; - /* "collisions.py":168 + /* "collisions.py":170 * return False * * def shapelyToColl(shapelyShape: shapelyGeom.base.BaseGeometry) -> Union['Shape', 'Shapes']: # <<<<<<<<<<<<<< @@ -11470,7 +11619,7 @@ static PyObject *__pyx_pf_10collisions_12shapelyToColl(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":190 +/* "collisions.py":193 * raise ValueError(f'Cannot convert shapely shape of type {type(shapelyShape)} to BlazeSudio Shape') * * def collToShapely(collShape: 'Shape') -> shapelyGeom.base.BaseGeometry: # <<<<<<<<<<<<<< @@ -11532,12 +11681,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 190, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 193, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "collToShapely") < 0)) __PYX_ERR(0, 190, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "collToShapely") < 0)) __PYX_ERR(0, 193, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -11548,7 +11697,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("collToShapely", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 190, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("collToShapely", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 193, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -11591,24 +11740,23 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ Py_ssize_t __pyx_t_9; PyObject *(*__pyx_t_10)(PyObject *); PyObject *__pyx_t_11 = NULL; - Py_UCS4 __pyx_t_12; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collToShapely", 1); - /* "collisions.py":200 + /* "collisions.py":203 * shapely.geometry.base.BaseGeometry: The converted shape. * """ * if checkShpType(collShape, ShpTyps.Point): # <<<<<<<<<<<<<< * return shapelyGeom.Point(collShape.x, collShape.y) * if checkShpType(collShape, ShpTyps.Line): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -11630,15 +11778,15 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 200, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 203, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":201 + /* "collisions.py":204 * """ * if checkShpType(collShape, ShpTyps.Point): * return shapelyGeom.Point(collShape.x, collShape.y) # <<<<<<<<<<<<<< @@ -11646,14 +11794,14 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ * return shapelyGeom.LineString([(collShape.p1[0], collShape.p1[1]), (collShape.p2[0], collShape.p2[1])]) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_collShape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_collShape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_collShape, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_collShape, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 = NULL; __pyx_t_5 = 0; @@ -11675,7 +11823,7 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -11683,7 +11831,7 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":200 + /* "collisions.py":203 * shapely.geometry.base.BaseGeometry: The converted shape. * """ * if checkShpType(collShape, ShpTyps.Point): # <<<<<<<<<<<<<< @@ -11692,18 +11840,18 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ */ } - /* "collisions.py":202 + /* "collisions.py":205 * if checkShpType(collShape, ShpTyps.Point): * return shapelyGeom.Point(collShape.x, collShape.y) * if checkShpType(collShape, ShpTyps.Line): # <<<<<<<<<<<<<< * return shapelyGeom.LineString([(collShape.p1[0], collShape.p1[1]), (collShape.p2[0], collShape.p2[1])]) * if checkShpType(collShape, ShpTyps.Circle): */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -11725,15 +11873,15 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":203 + /* "collisions.py":206 * return shapelyGeom.Point(collShape.x, collShape.y) * if checkShpType(collShape, ShpTyps.Line): * return shapelyGeom.LineString([(collShape.p1[0], collShape.p1[1]), (collShape.p2[0], collShape.p2[1])]) # <<<<<<<<<<<<<< @@ -11741,53 +11889,53 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ * return shapelyGeom.Point(collShape.x, collShape.y).buffer(collShape.r) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 203, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_LineString); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_LineString); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_collShape, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_collShape, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_collShape, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_collShape, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 206, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7)) __PYX_ERR(0, 203, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_7)) __PYX_ERR(0, 206, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_collShape, __pyx_n_s_p2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_collShape, __pyx_n_s_p2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_collShape, __pyx_n_s_p2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_collShape, __pyx_n_s_p2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3)) __PYX_ERR(0, 206, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8)) __PYX_ERR(0, 203, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8)) __PYX_ERR(0, 206, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_8 = 0; - __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_4)) __PYX_ERR(0, 203, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(0, 203, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(0, 206, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_7 = 0; __pyx_t_7 = NULL; @@ -11809,7 +11957,7 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -11817,7 +11965,7 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":202 + /* "collisions.py":205 * if checkShpType(collShape, ShpTyps.Point): * return shapelyGeom.Point(collShape.x, collShape.y) * if checkShpType(collShape, ShpTyps.Line): # <<<<<<<<<<<<<< @@ -11826,18 +11974,18 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ */ } - /* "collisions.py":204 + /* "collisions.py":207 * if checkShpType(collShape, ShpTyps.Line): * return shapelyGeom.LineString([(collShape.p1[0], collShape.p1[1]), (collShape.p2[0], collShape.p2[1])]) * if checkShpType(collShape, ShpTyps.Circle): # <<<<<<<<<<<<<< * return shapelyGeom.Point(collShape.x, collShape.y).buffer(collShape.r) * if checkShpType(collShape, ShpGroups.CLOSED): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 204, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_Circle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_Circle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -11859,15 +12007,15 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 207, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":205 + /* "collisions.py":208 * return shapelyGeom.LineString([(collShape.p1[0], collShape.p1[1]), (collShape.p2[0], collShape.p2[1])]) * if checkShpType(collShape, ShpTyps.Circle): * return shapelyGeom.Point(collShape.x, collShape.y).buffer(collShape.r) # <<<<<<<<<<<<<< @@ -11875,14 +12023,14 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ * return shapelyGeom.Polygon([(i[0], i[1]) for i in collShape.toPoints()]) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 205, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 205, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_collShape, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 205, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_collShape, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_collShape, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 205, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_collShape, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; @@ -11904,14 +12052,14 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_buffer); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 205, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_buffer); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_collShape, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_collShape, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -11932,7 +12080,7 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } @@ -11940,7 +12088,7 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":204 + /* "collisions.py":207 * if checkShpType(collShape, ShpTyps.Line): * return shapelyGeom.LineString([(collShape.p1[0], collShape.p1[1]), (collShape.p2[0], collShape.p2[1])]) * if checkShpType(collShape, ShpTyps.Circle): # <<<<<<<<<<<<<< @@ -11949,18 +12097,18 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ */ } - /* "collisions.py":206 + /* "collisions.py":209 * if checkShpType(collShape, ShpTyps.Circle): * return shapelyGeom.Point(collShape.x, collShape.y).buffer(collShape.r) * if checkShpType(collShape, ShpGroups.CLOSED): # <<<<<<<<<<<<<< * return shapelyGeom.Polygon([(i[0], i[1]) for i in collShape.toPoints()]) * if checkShpType(collShape, ShpGroups.GROUP): */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_CLOSED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_CLOSED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -11982,15 +12130,15 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":207 + /* "collisions.py":210 * return shapelyGeom.Point(collShape.x, collShape.y).buffer(collShape.r) * if checkShpType(collShape, ShpGroups.CLOSED): * return shapelyGeom.Polygon([(i[0], i[1]) for i in collShape.toPoints()]) # <<<<<<<<<<<<<< @@ -11998,15 +12146,15 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ * return shapelyGeom.GeometryCollection([collToShapely(i) for i in collShape.shapes]) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 207, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; { /* enter inner scope */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 207, __pyx_L9_error) + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 210, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_collShape, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 207, __pyx_L9_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_collShape, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 210, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = NULL; __pyx_t_5 = 0; @@ -12026,7 +12174,7 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L9_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } @@ -12035,9 +12183,9 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ __pyx_t_9 = 0; __pyx_t_10 = NULL; } else { - __pyx_t_9 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 207, __pyx_L9_error) + __pyx_t_9 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 210, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 207, __pyx_L9_error) + __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 210, __pyx_L9_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -12046,28 +12194,28 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 207, __pyx_L9_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 210, __pyx_L9_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 207, __pyx_L9_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 210, __pyx_L9_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L9_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 207, __pyx_L9_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 210, __pyx_L9_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 207, __pyx_L9_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 210, __pyx_L9_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L9_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -12077,7 +12225,7 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 207, __pyx_L9_error) + else __PYX_ERR(0, 210, __pyx_L9_error) } break; } @@ -12085,19 +12233,19 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ } __Pyx_XDECREF_SET(__pyx_8genexpr3__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_8genexpr3__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L9_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_8genexpr3__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_8genexpr3__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L9_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_8genexpr3__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 207, __pyx_L9_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 210, __pyx_L9_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2)) __PYX_ERR(0, 207, __pyx_L9_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2)) __PYX_ERR(0, 210, __pyx_L9_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_3)) __PYX_ERR(0, 207, __pyx_L9_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_3)) __PYX_ERR(0, 210, __pyx_L9_error); __pyx_t_2 = 0; __pyx_t_3 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 207, __pyx_L9_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 210, __pyx_L9_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -12127,7 +12275,7 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -12135,7 +12283,7 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":206 + /* "collisions.py":209 * if checkShpType(collShape, ShpTyps.Circle): * return shapelyGeom.Point(collShape.x, collShape.y).buffer(collShape.r) * if checkShpType(collShape, ShpGroups.CLOSED): # <<<<<<<<<<<<<< @@ -12144,18 +12292,18 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ */ } - /* "collisions.py":208 + /* "collisions.py":211 * if checkShpType(collShape, ShpGroups.CLOSED): * return shapelyGeom.Polygon([(i[0], i[1]) for i in collShape.toPoints()]) * if checkShpType(collShape, ShpGroups.GROUP): # <<<<<<<<<<<<<< * return shapelyGeom.GeometryCollection([collToShapely(i) for i in collShape.shapes]) - * raise ValueError(f'Cannot convert BlazeSudio shape of type {type(collShape)} to shapely shape') + * return shapelyGeom.GeometryCollection() */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 208, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_GROUP); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 208, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_GROUP); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -12177,40 +12325,40 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 208, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":209 + /* "collisions.py":212 * return shapelyGeom.Polygon([(i[0], i[1]) for i in collShape.toPoints()]) * if checkShpType(collShape, ShpGroups.GROUP): * return shapelyGeom.GeometryCollection([collToShapely(i) for i in collShape.shapes]) # <<<<<<<<<<<<<< + * return shapelyGeom.GeometryCollection() * raise ValueError(f'Cannot convert BlazeSudio shape of type {type(collShape)} to shapely shape') - * */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_GeometryCollection); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_GeometryCollection); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; { /* enter inner scope */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L17_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_collShape, __pyx_n_s_shapes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 209, __pyx_L17_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_collShape, __pyx_n_s_shapes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 212, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_8); if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { __pyx_t_11 = __pyx_t_8; __Pyx_INCREF(__pyx_t_11); __pyx_t_9 = 0; __pyx_t_10 = NULL; } else { - __pyx_t_9 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 209, __pyx_L17_error) + __pyx_t_9 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 212, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 209, __pyx_L17_error) + __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 212, __pyx_L17_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { @@ -12219,28 +12367,28 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 209, __pyx_L17_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 212, __pyx_L17_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 209, __pyx_L17_error) + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 212, __pyx_L17_error) #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 209, __pyx_L17_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 212, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_11); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 209, __pyx_L17_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 212, __pyx_L17_error) #endif if (__pyx_t_9 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 209, __pyx_L17_error) + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 212, __pyx_L17_error) #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 209, __pyx_L17_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 212, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_8); #endif } @@ -12250,7 +12398,7 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 209, __pyx_L17_error) + else __PYX_ERR(0, 212, __pyx_L17_error) } break; } @@ -12258,7 +12406,7 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ } __Pyx_XDECREF_SET(__pyx_8genexpr4__pyx_v_i, __pyx_t_8); __pyx_t_8 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_collToShapely); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L17_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_collToShapely); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_5 = 0; @@ -12278,11 +12426,11 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_8genexpr4__pyx_v_i}; __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 209, __pyx_L17_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 212, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 209, __pyx_L17_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 212, __pyx_L17_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; @@ -12312,7 +12460,7 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } @@ -12320,52 +12468,55 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":208 + /* "collisions.py":211 * if checkShpType(collShape, ShpGroups.CLOSED): * return shapelyGeom.Polygon([(i[0], i[1]) for i in collShape.toPoints()]) * if checkShpType(collShape, ShpGroups.GROUP): # <<<<<<<<<<<<<< * return shapelyGeom.GeometryCollection([collToShapely(i) for i in collShape.shapes]) - * raise ValueError(f'Cannot convert BlazeSudio shape of type {type(collShape)} to shapely shape') + * return shapelyGeom.GeometryCollection() */ } - /* "collisions.py":210 + /* "collisions.py":213 * if checkShpType(collShape, ShpGroups.GROUP): * return shapelyGeom.GeometryCollection([collToShapely(i) for i in collShape.shapes]) - * raise ValueError(f'Cannot convert BlazeSudio shape of type {type(collShape)} to shapely shape') # <<<<<<<<<<<<<< + * return shapelyGeom.GeometryCollection() # <<<<<<<<<<<<<< + * raise ValueError(f'Cannot convert BlazeSudio shape of type {type(collShape)} to shapely shape') * - * def drawShape(surface: Any, shape: 'Shape', colour: tuple[int, int, int], width: int = 0): */ - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = 0; - __pyx_t_12 = 127; - __Pyx_INCREF(__pyx_kp_u_Cannot_convert_BlazeSudio_shape); - __pyx_t_9 += 40; - __Pyx_GIVEREF(__pyx_kp_u_Cannot_convert_BlazeSudio_shape); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Cannot_convert_BlazeSudio_shape); - __pyx_t_7 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_collShape)), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 210, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_12 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_12) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_12; - __pyx_t_9 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7); - __pyx_t_7 = 0; - __Pyx_INCREF(__pyx_kp_u_to_shapely_shape); - __pyx_t_9 += 17; - __Pyx_GIVEREF(__pyx_kp_u_to_shapely_shape); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_to_shapely_shape); - __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_9, __pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 210, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_GeometryCollection); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_7 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "collisions.py":190 + /* "collisions.py":193 * raise ValueError(f'Cannot convert shapely shape of type {type(shapelyShape)} to BlazeSudio Shape') * * def collToShapely(collShape: 'Shape') -> shapelyGeom.base.BaseGeometry: # <<<<<<<<<<<<<< @@ -12392,7 +12543,7 @@ static PyObject *__pyx_pf_10collisions_14collToShapely(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":212 +/* "collisions.py":216 * raise ValueError(f'Cannot convert BlazeSudio shape of type {type(collShape)} to shapely shape') * * def drawShape(surface: Any, shape: 'Shape', colour: tuple[int, int, int], width: int = 0): # <<<<<<<<<<<<<< @@ -12410,18 +12561,18 @@ static PyObject *__pyx_pf_10collisions_18__defaults__(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_width); __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_width); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_width)) __PYX_ERR(0, 212, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_width)) __PYX_ERR(0, 216, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 212, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 216, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -12504,7 +12655,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -12512,9 +12663,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("drawShape", 0, 3, 4, 1); __PYX_ERR(0, 212, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("drawShape", 0, 3, 4, 1); __PYX_ERR(0, 216, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -12522,21 +12673,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("drawShape", 0, 3, 4, 2); __PYX_ERR(0, 212, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("drawShape", 0, 3, 4, 2); __PYX_ERR(0, 216, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_width); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 212, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "drawShape") < 0)) __PYX_ERR(0, 212, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "drawShape") < 0)) __PYX_ERR(0, 216, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -12556,7 +12707,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("drawShape", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 212, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("drawShape", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 216, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -12570,8 +12721,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colour), (&PyTuple_Type), 0, "colour", 1))) __PYX_ERR(0, 212, __pyx_L1_error) - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_width), (&PyInt_Type), 0, "width", 1))) __PYX_ERR(0, 212, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colour), (&PyTuple_Type), 0, "colour", 1))) __PYX_ERR(0, 216, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_width), (&PyInt_Type), 0, "width", 1))) __PYX_ERR(0, 216, __pyx_L1_error) __pyx_r = __pyx_pf_10collisions_16drawShape(__pyx_self, __pyx_v_surface, __pyx_v_shape, __pyx_v_colour, __pyx_v_width); /* function exit code */ @@ -12615,14 +12766,14 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("drawShape", 1); - /* "collisions.py":222 + /* "collisions.py":226 * width (int, optional): The width of the lines to draw. Defaults to 0. * """ * checkForPygame() # <<<<<<<<<<<<<< * if checkShpType(shape, ShpTyps.Point): * pygame.draw.circle(surface, colour, (int(shape.x), int(shape.y)), width) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkForPygame); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkForPygame); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -12642,24 +12793,24 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __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; - /* "collisions.py":223 + /* "collisions.py":227 * """ * checkForPygame() * if checkShpType(shape, ShpTyps.Point): # <<<<<<<<<<<<<< * pygame.draw.circle(surface, colour, (int(shape.x), int(shape.y)), width) * elif checkShpType(shape, ShpTyps.Line): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 223, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -12681,45 +12832,45 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":224 + /* "collisions.py":228 * checkForPygame() * if checkShpType(shape, ShpTyps.Point): * pygame.draw.circle(surface, colour, (int(shape.x), int(shape.y)), width) # <<<<<<<<<<<<<< * elif checkShpType(shape, ShpTyps.Line): * if tuple(shape.p1) == tuple(shape.p2): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pygame); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pygame); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_draw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_draw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_circle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_circle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(0, 224, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7)) __PYX_ERR(0, 224, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7)) __PYX_ERR(0, 228, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_7 = 0; __pyx_t_7 = NULL; @@ -12741,13 +12892,13 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __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; - /* "collisions.py":223 + /* "collisions.py":227 * """ * checkForPygame() * if checkShpType(shape, ShpTyps.Point): # <<<<<<<<<<<<<< @@ -12757,18 +12908,18 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx goto __pyx_L3; } - /* "collisions.py":225 + /* "collisions.py":229 * if checkShpType(shape, ShpTyps.Point): * pygame.draw.circle(surface, colour, (int(shape.x), int(shape.y)), width) * elif checkShpType(shape, ShpTyps.Line): # <<<<<<<<<<<<<< * if tuple(shape.p1) == tuple(shape.p2): * pygame.draw.circle(surface, colour, (int(shape.p1[0]), int(shape.p1[1])), int(width/2)) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 225, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Line); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 225, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Line); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -12790,80 +12941,80 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 225, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":226 + /* "collisions.py":230 * pygame.draw.circle(surface, colour, (int(shape.x), int(shape.y)), width) * elif checkShpType(shape, ShpTyps.Line): * if tuple(shape.p1) == tuple(shape.p2): # <<<<<<<<<<<<<< * pygame.draw.circle(surface, colour, (int(shape.p1[0]), int(shape.p1[1])), int(width/2)) * pygame.draw.line(surface, colour, (int(shape.p1[0]), int(shape.p1[1])), */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 226, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":227 + /* "collisions.py":231 * elif checkShpType(shape, ShpTyps.Line): * if tuple(shape.p1) == tuple(shape.p2): * pygame.draw.circle(surface, colour, (int(shape.p1[0]), int(shape.p1[1])), int(width/2)) # <<<<<<<<<<<<<< * pygame.draw.line(surface, colour, (int(shape.p1[0]), int(shape.p1[1])), * (int(shape.p2[0]), int(shape.p2[1])), width) */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pygame); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pygame); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_draw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_draw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_circle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_circle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_p1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_p1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5)) __PYX_ERR(0, 227, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5)) __PYX_ERR(0, 231, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_v_width, __pyx_int_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_v_width, __pyx_int_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -12886,13 +13037,13 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":226 + /* "collisions.py":230 * pygame.draw.circle(surface, colour, (int(shape.x), int(shape.y)), width) * elif checkShpType(shape, ShpTyps.Line): * if tuple(shape.p1) == tuple(shape.p2): # <<<<<<<<<<<<<< @@ -12901,75 +13052,75 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx */ } - /* "collisions.py":228 + /* "collisions.py":232 * if tuple(shape.p1) == tuple(shape.p2): * pygame.draw.circle(surface, colour, (int(shape.p1[0]), int(shape.p1[1])), int(width/2)) * pygame.draw.line(surface, colour, (int(shape.p1[0]), int(shape.p1[1])), # <<<<<<<<<<<<<< * (int(shape.p2[0]), int(shape.p2[1])), width) * elif checkShpType(shape, ShpTyps.Arc): */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pygame); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pygame); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_draw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_draw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_line); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_line); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 228, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; - /* "collisions.py":229 + /* "collisions.py":233 * pygame.draw.circle(surface, colour, (int(shape.p1[0]), int(shape.p1[1])), int(width/2)) * pygame.draw.line(surface, colour, (int(shape.p1[0]), int(shape.p1[1])), * (int(shape.p2[0]), int(shape.p2[1])), width) # <<<<<<<<<<<<<< * elif checkShpType(shape, ShpTyps.Arc): * pygame.draw.arc(surface, colour, */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 229, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 229, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3)) __PYX_ERR(0, 229, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -12992,13 +13143,13 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":225 + /* "collisions.py":229 * if checkShpType(shape, ShpTyps.Point): * pygame.draw.circle(surface, colour, (int(shape.x), int(shape.y)), width) * elif checkShpType(shape, ShpTyps.Line): # <<<<<<<<<<<<<< @@ -13008,18 +13159,18 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx goto __pyx_L3; } - /* "collisions.py":230 + /* "collisions.py":234 * pygame.draw.line(surface, colour, (int(shape.p1[0]), int(shape.p1[1])), * (int(shape.p2[0]), int(shape.p2[1])), width) * elif checkShpType(shape, ShpTyps.Arc): # <<<<<<<<<<<<<< * pygame.draw.arc(surface, colour, * (int(shape.x)-int(shape.r), int(shape.y)-int(shape.r), int(shape.r*2), int(shape.r*2)), */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 230, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 230, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_Arc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_Arc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -13041,111 +13192,111 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 230, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":231 + /* "collisions.py":235 * (int(shape.p2[0]), int(shape.p2[1])), width) * elif checkShpType(shape, ShpTyps.Arc): * pygame.draw.arc(surface, colour, # <<<<<<<<<<<<<< * (int(shape.x)-int(shape.r), int(shape.y)-int(shape.r), int(shape.r*2), int(shape.r*2)), * math.radians(-shape.endAng), math.radians(-shape.startAng), width) */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pygame); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 231, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pygame); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_draw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_draw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_arc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 231, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_arc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "collisions.py":232 + /* "collisions.py":236 * elif checkShpType(shape, ShpTyps.Arc): * pygame.draw.arc(surface, colour, * (int(shape.x)-int(shape.r), int(shape.y)-int(shape.r), int(shape.r*2), int(shape.r*2)), # <<<<<<<<<<<<<< * math.radians(-shape.endAng), math.radians(-shape.startAng), width) * elif checkShpType(shape, ShpTyps.Circle): */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_r); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_r); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Subtract(__pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_5 = PyNumber_Subtract(__pyx_t_8, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Subtract(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyInt_MultiplyObjC(__pyx_t_3, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_MultiplyObjC(__pyx_t_3, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_r); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_r); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyInt_MultiplyObjC(__pyx_t_8, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_MultiplyObjC(__pyx_t_8, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5)) __PYX_ERR(0, 232, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_5)) __PYX_ERR(0, 236, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_8)) __PYX_ERR(0, 232, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_8 = 0; - /* "collisions.py":233 + /* "collisions.py":237 * pygame.draw.arc(surface, colour, * (int(shape.x)-int(shape.r), int(shape.y)-int(shape.r), int(shape.r*2), int(shape.r*2)), * math.radians(-shape.endAng), math.radians(-shape.startAng), width) # <<<<<<<<<<<<<< * elif checkShpType(shape, ShpTyps.Circle): * pygame.draw.circle(surface, colour, (int(shape.x), int(shape.y)), int(shape.r), width) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_radians); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_radians); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_endAng); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_endAng); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_5 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -13167,18 +13318,18 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 233, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 233, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_radians); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_radians); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_startAng); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_startAng); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = PyNumber_Negative(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_10 = PyNumber_Negative(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -13200,7 +13351,7 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -13225,13 +13376,13 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":230 + /* "collisions.py":234 * pygame.draw.line(surface, colour, (int(shape.p1[0]), int(shape.p1[1])), * (int(shape.p2[0]), int(shape.p2[1])), width) * elif checkShpType(shape, ShpTyps.Arc): # <<<<<<<<<<<<<< @@ -13241,18 +13392,18 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx goto __pyx_L3; } - /* "collisions.py":234 + /* "collisions.py":238 * (int(shape.x)-int(shape.r), int(shape.y)-int(shape.r), int(shape.r*2), int(shape.r*2)), * math.radians(-shape.endAng), math.radians(-shape.startAng), width) * elif checkShpType(shape, ShpTyps.Circle): # <<<<<<<<<<<<<< * pygame.draw.circle(surface, colour, (int(shape.x), int(shape.y)), int(shape.r), width) * elif checkShpType(shape, ShpGroups.CLOSED): */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Circle); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Circle); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -13274,50 +13425,50 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 238, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":235 + /* "collisions.py":239 * math.radians(-shape.endAng), math.radians(-shape.startAng), width) * elif checkShpType(shape, ShpTyps.Circle): * pygame.draw.circle(surface, colour, (int(shape.x), int(shape.y)), int(shape.r), width) # <<<<<<<<<<<<<< * elif checkShpType(shape, ShpGroups.CLOSED): * ps = shape.toPoints() */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pygame); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pygame); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_draw); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_draw); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_circle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_circle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9)) __PYX_ERR(0, 235, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9)) __PYX_ERR(0, 239, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_r); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_r); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -13340,13 +13491,13 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":234 + /* "collisions.py":238 * (int(shape.x)-int(shape.r), int(shape.y)-int(shape.r), int(shape.r*2), int(shape.r*2)), * math.radians(-shape.endAng), math.radians(-shape.startAng), width) * elif checkShpType(shape, ShpTyps.Circle): # <<<<<<<<<<<<<< @@ -13356,18 +13507,18 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx goto __pyx_L3; } - /* "collisions.py":236 + /* "collisions.py":240 * elif checkShpType(shape, ShpTyps.Circle): * pygame.draw.circle(surface, colour, (int(shape.x), int(shape.y)), int(shape.r), width) * elif checkShpType(shape, ShpGroups.CLOSED): # <<<<<<<<<<<<<< * ps = shape.toPoints() * psset = {tuple(i) for i in ps} */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_CLOSED); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_CLOSED); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -13389,22 +13540,22 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":237 + /* "collisions.py":241 * pygame.draw.circle(surface, colour, (int(shape.x), int(shape.y)), int(shape.r), width) * elif checkShpType(shape, ShpGroups.CLOSED): * ps = shape.toPoints() # <<<<<<<<<<<<<< * psset = {tuple(i) for i in ps} * if len(psset) == 0: */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_4 = 0; @@ -13424,14 +13575,14 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_v_ps = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":238 + /* "collisions.py":242 * elif checkShpType(shape, ShpGroups.CLOSED): * ps = shape.toPoints() * psset = {tuple(i) for i in ps} # <<<<<<<<<<<<<< @@ -13439,16 +13590,16 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx * return */ { /* enter inner scope */ - __pyx_t_1 = PySet_New(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L7_error) + __pyx_t_1 = PySet_New(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_v_ps)) || PyTuple_CheckExact(__pyx_v_ps)) { __pyx_t_7 = __pyx_v_ps; __Pyx_INCREF(__pyx_t_7); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_ps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 238, __pyx_L7_error) + __pyx_t_11 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_ps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 242, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 238, __pyx_L7_error) + __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 242, __pyx_L7_error) } for (;;) { if (likely(!__pyx_t_12)) { @@ -13456,28 +13607,28 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 238, __pyx_L7_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 242, __pyx_L7_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 238, __pyx_L7_error) + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 242, __pyx_L7_error) #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L7_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 242, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 238, __pyx_L7_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 242, __pyx_L7_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 238, __pyx_L7_error) + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_11); __Pyx_INCREF(__pyx_t_8); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 242, __pyx_L7_error) #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L7_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 242, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_8); #endif } @@ -13487,7 +13638,7 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 238, __pyx_L7_error) + else __PYX_ERR(0, 242, __pyx_L7_error) } break; } @@ -13495,9 +13646,9 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx } __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_i, __pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_8genexpr5__pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 238, __pyx_L7_error) + __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_8genexpr5__pyx_v_i); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 242, __pyx_L7_error) __Pyx_GOTREF(__pyx_t_8); - if (unlikely(PySet_Add(__pyx_t_1, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 238, __pyx_L7_error) + if (unlikely(PySet_Add(__pyx_t_1, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 242, __pyx_L7_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -13511,18 +13662,18 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx __pyx_v_psset = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":239 + /* "collisions.py":243 * ps = shape.toPoints() * psset = {tuple(i) for i in ps} * if len(psset) == 0: # <<<<<<<<<<<<<< * return * elif len(psset) == 1: */ - __pyx_t_11 = __Pyx_PySet_GET_SIZE(__pyx_v_psset); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_11 = __Pyx_PySet_GET_SIZE(__pyx_v_psset); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 243, __pyx_L1_error) __pyx_t_6 = (__pyx_t_11 == 0); if (__pyx_t_6) { - /* "collisions.py":240 + /* "collisions.py":244 * psset = {tuple(i) for i in ps} * if len(psset) == 0: * return # <<<<<<<<<<<<<< @@ -13533,7 +13684,7 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx __pyx_r = Py_None; __Pyx_INCREF(Py_None); goto __pyx_L0; - /* "collisions.py":239 + /* "collisions.py":243 * ps = shape.toPoints() * psset = {tuple(i) for i in ps} * if len(psset) == 0: # <<<<<<<<<<<<<< @@ -13542,65 +13693,65 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx */ } - /* "collisions.py":241 + /* "collisions.py":245 * if len(psset) == 0: * return * elif len(psset) == 1: # <<<<<<<<<<<<<< * fst = psset.pop() * pygame.draw.circle(surface, colour, (int(fst[0]), int(fst[1])), int(width/2)) */ - __pyx_t_11 = __Pyx_PySet_GET_SIZE(__pyx_v_psset); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 241, __pyx_L1_error) + __pyx_t_11 = __Pyx_PySet_GET_SIZE(__pyx_v_psset); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 245, __pyx_L1_error) __pyx_t_6 = (__pyx_t_11 == 1); if (__pyx_t_6) { - /* "collisions.py":242 + /* "collisions.py":246 * return * elif len(psset) == 1: * fst = psset.pop() # <<<<<<<<<<<<<< * pygame.draw.circle(surface, colour, (int(fst[0]), int(fst[1])), int(width/2)) * elif len(psset) == 2: */ - __pyx_t_1 = PySet_Pop(__pyx_v_psset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) + __pyx_t_1 = PySet_Pop(__pyx_v_psset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_fst = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":243 + /* "collisions.py":247 * elif len(psset) == 1: * fst = psset.pop() * pygame.draw.circle(surface, colour, (int(fst[0]), int(fst[1])), int(width/2)) # <<<<<<<<<<<<<< * elif len(psset) == 2: * fst = psset.pop() */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pygame); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 243, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pygame); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_draw); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 243, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_draw); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_circle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 243, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_circle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_fst, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 243, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_fst, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_fst, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 243, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_fst, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 243, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 243, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 247, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9)) __PYX_ERR(0, 243, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9)) __PYX_ERR(0, 247, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_v_width, __pyx_int_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 243, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_v_width, __pyx_int_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -13623,13 +13774,13 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":241 + /* "collisions.py":245 * if len(psset) == 0: * return * elif len(psset) == 1: # <<<<<<<<<<<<<< @@ -13639,114 +13790,114 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx goto __pyx_L12; } - /* "collisions.py":244 + /* "collisions.py":248 * fst = psset.pop() * pygame.draw.circle(surface, colour, (int(fst[0]), int(fst[1])), int(width/2)) * elif len(psset) == 2: # <<<<<<<<<<<<<< * fst = psset.pop() * snd = psset.pop() */ - __pyx_t_11 = __Pyx_PySet_GET_SIZE(__pyx_v_psset); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 244, __pyx_L1_error) + __pyx_t_11 = __Pyx_PySet_GET_SIZE(__pyx_v_psset); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 248, __pyx_L1_error) __pyx_t_6 = (__pyx_t_11 == 2); if (__pyx_t_6) { - /* "collisions.py":245 + /* "collisions.py":249 * pygame.draw.circle(surface, colour, (int(fst[0]), int(fst[1])), int(width/2)) * elif len(psset) == 2: * fst = psset.pop() # <<<<<<<<<<<<<< * snd = psset.pop() * pygame.draw.line(surface, colour, */ - __pyx_t_1 = PySet_Pop(__pyx_v_psset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error) + __pyx_t_1 = PySet_Pop(__pyx_v_psset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_fst = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":246 + /* "collisions.py":250 * elif len(psset) == 2: * fst = psset.pop() * snd = psset.pop() # <<<<<<<<<<<<<< * pygame.draw.line(surface, colour, * (int(fst[0]), int(fst[1])), */ - __pyx_t_1 = PySet_Pop(__pyx_v_psset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_1 = PySet_Pop(__pyx_v_psset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_snd = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":247 + /* "collisions.py":251 * fst = psset.pop() * snd = psset.pop() * pygame.draw.line(surface, colour, # <<<<<<<<<<<<<< * (int(fst[0]), int(fst[1])), * (int(snd[0]), int(snd[1])), int(width/4*3)) */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pygame); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 247, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pygame); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_draw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_draw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_line); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 247, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_line); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":248 + /* "collisions.py":252 * snd = psset.pop() * pygame.draw.line(surface, colour, * (int(fst[0]), int(fst[1])), # <<<<<<<<<<<<<< * (int(snd[0]), int(snd[1])), int(width/4*3)) * pygame.draw.polygon(surface, colour, ps, width) */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_fst, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_fst, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_fst, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_fst, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8)) __PYX_ERR(0, 248, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8)) __PYX_ERR(0, 252, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_9)) __PYX_ERR(0, 248, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_9)) __PYX_ERR(0, 252, __pyx_L1_error); __pyx_t_8 = 0; __pyx_t_9 = 0; - /* "collisions.py":249 + /* "collisions.py":253 * pygame.draw.line(surface, colour, * (int(fst[0]), int(fst[1])), * (int(snd[0]), int(snd[1])), int(width/4*3)) # <<<<<<<<<<<<<< * pygame.draw.polygon(surface, colour, ps, width) * elif checkShpType(shape, ShpGroups.GROUP): */ - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_snd, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 249, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_snd, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 249, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyNumber_Int(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_snd, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 249, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_snd, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 249, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8)) __PYX_ERR(0, 249, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8)) __PYX_ERR(0, 253, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error); __pyx_t_8 = 0; __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_width, __pyx_int_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_width, __pyx_int_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyInt_MultiplyObjC(__pyx_t_3, __pyx_int_3, 3, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 249, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyInt_MultiplyObjC(__pyx_t_3, __pyx_int_3, 3, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -13770,13 +13921,13 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":244 + /* "collisions.py":248 * fst = psset.pop() * pygame.draw.circle(surface, colour, (int(fst[0]), int(fst[1])), int(width/2)) * elif len(psset) == 2: # <<<<<<<<<<<<<< @@ -13786,19 +13937,19 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx } __pyx_L12:; - /* "collisions.py":250 + /* "collisions.py":254 * (int(fst[0]), int(fst[1])), * (int(snd[0]), int(snd[1])), int(width/4*3)) * pygame.draw.polygon(surface, colour, ps, width) # <<<<<<<<<<<<<< * elif checkShpType(shape, ShpGroups.GROUP): * for i in shape.shapes: */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pygame); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 250, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_pygame); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_draw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_draw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_polygon); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_polygon); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -13819,13 +13970,13 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_surface, __pyx_v_colour, __pyx_v_ps, __pyx_v_width}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":236 + /* "collisions.py":240 * elif checkShpType(shape, ShpTyps.Circle): * pygame.draw.circle(surface, colour, (int(shape.x), int(shape.y)), int(shape.r), width) * elif checkShpType(shape, ShpGroups.CLOSED): # <<<<<<<<<<<<<< @@ -13835,18 +13986,18 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx goto __pyx_L3; } - /* "collisions.py":251 + /* "collisions.py":255 * (int(snd[0]), int(snd[1])), int(width/4*3)) * pygame.draw.polygon(surface, colour, ps, width) * elif checkShpType(shape, ShpGroups.GROUP): # <<<<<<<<<<<<<< * for i in shape.shapes: * drawShape(surface, i, colour, width) */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 251, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_GROUP); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_GROUP); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -13868,31 +14019,31 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 251, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":252 + /* "collisions.py":256 * pygame.draw.polygon(surface, colour, ps, width) * elif checkShpType(shape, ShpGroups.GROUP): * for i in shape.shapes: # <<<<<<<<<<<<<< * drawShape(surface, i, colour, width) * elif checkShpType(shape, ShpTyps.NoShape): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_shape, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 256, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -13901,28 +14052,28 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 252, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 256, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 256, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 252, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 256, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 256, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -13932,7 +14083,7 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 252, __pyx_L1_error) + else __PYX_ERR(0, 256, __pyx_L1_error) } break; } @@ -13941,14 +14092,14 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":253 + /* "collisions.py":257 * elif checkShpType(shape, ShpGroups.GROUP): * for i in shape.shapes: * drawShape(surface, i, colour, width) # <<<<<<<<<<<<<< * elif checkShpType(shape, ShpTyps.NoShape): * pass */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_drawShape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 253, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_drawShape); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -13968,13 +14119,13 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx PyObject *__pyx_callargs[5] = {__pyx_t_3, __pyx_v_surface, __pyx_v_i, __pyx_v_colour, __pyx_v_width}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_4, 4+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":252 + /* "collisions.py":256 * pygame.draw.polygon(surface, colour, ps, width) * elif checkShpType(shape, ShpGroups.GROUP): * for i in shape.shapes: # <<<<<<<<<<<<<< @@ -13984,7 +14135,7 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":251 + /* "collisions.py":255 * (int(snd[0]), int(snd[1])), int(width/4*3)) * pygame.draw.polygon(surface, colour, ps, width) * elif checkShpType(shape, ShpGroups.GROUP): # <<<<<<<<<<<<<< @@ -13994,18 +14145,18 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx goto __pyx_L3; } - /* "collisions.py":254 + /* "collisions.py":258 * for i in shape.shapes: * drawShape(surface, i, colour, width) * elif checkShpType(shape, ShpTyps.NoShape): # <<<<<<<<<<<<<< * pass * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 254, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_NoShape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_NoShape); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -14027,17 +14178,17 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 254, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 254, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (likely(__pyx_t_6)) { goto __pyx_L3; } - /* "collisions.py":257 + /* "collisions.py":261 * pass * else: * raise ValueError(f'Cannot draw BlazeSudio shape of type {type(shape)}') # <<<<<<<<<<<<<< @@ -14045,21 +14196,21 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx * class Shape: */ /*else*/ { - __pyx_t_7 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_shape)), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_shape)), __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Cannot_draw_BlazeSudio_shape_of, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Cannot_draw_BlazeSudio_shape_of, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_Raise(__pyx_t_7, 0, 0, 0); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __PYX_ERR(0, 257, __pyx_L1_error) + __PYX_ERR(0, 261, __pyx_L1_error) } __pyx_L3:; - /* "collisions.py":212 + /* "collisions.py":216 * raise ValueError(f'Cannot convert BlazeSudio shape of type {type(collShape)} to shapely shape') * * def drawShape(surface: Any, shape: 'Shape', colour: tuple[int, int, int], width: int = 0): # <<<<<<<<<<<<<< @@ -14093,7 +14244,7 @@ static PyObject *__pyx_pf_10collisions_16drawShape(CYTHON_UNUSED PyObject *__pyx return __pyx_r; } -/* "collisions.py":266 +/* "collisions.py":270 * x: Number = 0 * y: Number = 0 * def __init__(self, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< @@ -14111,20 +14262,20 @@ static PyObject *__pyx_pf_10collisions_20__defaults__(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 270, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None)) __PYX_ERR(0, 266, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None)) __PYX_ERR(0, 270, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -14200,19 +14351,19 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 266, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bounciness); if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 266, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 266, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 270, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -14225,14 +14376,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } __pyx_v_self = values[0]; if (values[1]) { - __pyx_v_bounciness = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_bounciness == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 266, __pyx_L3_error) + __pyx_v_bounciness = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_bounciness == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L3_error) } else { __pyx_v_bounciness = __pyx_dynamic_args->__pyx_arg_bounciness; } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 266, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 270, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -14268,19 +14419,19 @@ static PyObject *__pyx_pf_10collisions_5Shape___init__(CYTHON_UNUSED PyObject *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); - /* "collisions.py":271 + /* "collisions.py":275 * bounciness (float, optional): How bouncy this object is. 1 = rebounds perfectly, <1 = eventually will stop, >1 = will bounce more each time. Defaults to 0.7. * """ * self.bounciness: Number = bounciness # <<<<<<<<<<<<<< * * def collides(self, othershape: Union['Shape','Shapes',Iterable['Shape']]) -> bool: */ - __pyx_t_1 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bounciness, __pyx_t_1) < 0) __PYX_ERR(0, 271, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bounciness, __pyx_t_1) < 0) __PYX_ERR(0, 275, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":266 + /* "collisions.py":270 * x: Number = 0 * y: Number = 0 * def __init__(self, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< @@ -14301,7 +14452,7 @@ static PyObject *__pyx_pf_10collisions_5Shape___init__(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":273 +/* "collisions.py":277 * self.bounciness: Number = bounciness * * def collides(self, othershape: Union['Shape','Shapes',Iterable['Shape']]) -> bool: # <<<<<<<<<<<<<< @@ -14366,7 +14517,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 273, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 277, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -14374,14 +14525,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 273, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 277, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("collides", 1, 2, 2, 1); __PYX_ERR(0, 273, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("collides", 1, 2, 2, 1); __PYX_ERR(0, 277, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "collides") < 0)) __PYX_ERR(0, 273, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "collides") < 0)) __PYX_ERR(0, 277, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -14394,7 +14545,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 273, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 277, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -14438,20 +14589,20 @@ static PyObject *__pyx_pf_10collisions_5Shape_2collides(CYTHON_UNUSED PyObject * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collides", 1); - /* "collisions.py":283 + /* "collisions.py":287 * bool: whether or not this shape collides with any of the input shape(s) * """ * if isinstance(othershape, Shape): # <<<<<<<<<<<<<< * return self._collides(othershape) * for s in othershape: */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_IsInstance(__pyx_v_othershape, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_2 = PyObject_IsInstance(__pyx_v_othershape, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":284 + /* "collisions.py":288 * """ * if isinstance(othershape, Shape): * return self._collides(othershape) # <<<<<<<<<<<<<< @@ -14459,7 +14610,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_2collides(CYTHON_UNUSED PyObject * * if s._collides(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -14479,7 +14630,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_2collides(CYTHON_UNUSED PyObject * PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_othershape}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -14487,7 +14638,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_2collides(CYTHON_UNUSED PyObject * __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":283 + /* "collisions.py":287 * bool: whether or not this shape collides with any of the input shape(s) * """ * if isinstance(othershape, Shape): # <<<<<<<<<<<<<< @@ -14496,7 +14647,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_2collides(CYTHON_UNUSED PyObject * */ } - /* "collisions.py":285 + /* "collisions.py":289 * if isinstance(othershape, Shape): * return self._collides(othershape) * for s in othershape: # <<<<<<<<<<<<<< @@ -14508,9 +14659,9 @@ static PyObject *__pyx_pf_10collisions_5Shape_2collides(CYTHON_UNUSED PyObject * __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_othershape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_othershape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 289, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -14518,28 +14669,28 @@ static PyObject *__pyx_pf_10collisions_5Shape_2collides(CYTHON_UNUSED PyObject * { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 285, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 289, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 289, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 285, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 289, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 289, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -14549,7 +14700,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_2collides(CYTHON_UNUSED PyObject * PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 285, __pyx_L1_error) + else __PYX_ERR(0, 289, __pyx_L1_error) } break; } @@ -14558,14 +14709,14 @@ static PyObject *__pyx_pf_10collisions_5Shape_2collides(CYTHON_UNUSED PyObject * __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":286 + /* "collisions.py":290 * return self._collides(othershape) * for s in othershape: * if s._collides(self): # <<<<<<<<<<<<<< * return True * return False */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_collides); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_collides); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; __pyx_t_5 = 0; @@ -14585,15 +14736,15 @@ static PyObject *__pyx_pf_10collisions_5Shape_2collides(CYTHON_UNUSED PyObject * PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_self}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 286, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - /* "collisions.py":287 + /* "collisions.py":291 * for s in othershape: * if s._collides(self): * return True # <<<<<<<<<<<<<< @@ -14606,7 +14757,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_2collides(CYTHON_UNUSED PyObject * __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":286 + /* "collisions.py":290 * return self._collides(othershape) * for s in othershape: * if s._collides(self): # <<<<<<<<<<<<<< @@ -14615,7 +14766,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_2collides(CYTHON_UNUSED PyObject * */ } - /* "collisions.py":285 + /* "collisions.py":289 * if isinstance(othershape, Shape): * return self._collides(othershape) * for s in othershape: # <<<<<<<<<<<<<< @@ -14625,7 +14776,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_2collides(CYTHON_UNUSED PyObject * } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":288 + /* "collisions.py":292 * if s._collides(self): * return True * return False # <<<<<<<<<<<<<< @@ -14637,7 +14788,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_2collides(CYTHON_UNUSED PyObject * __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":273 + /* "collisions.py":277 * self.bounciness: Number = bounciness * * def collides(self, othershape: Union['Shape','Shapes',Iterable['Shape']]) -> bool: # <<<<<<<<<<<<<< @@ -14660,7 +14811,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_2collides(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "collisions.py":290 +/* "collisions.py":294 * return False * * def whereCollides(self, othershape: Union['Shape','Shapes',Iterable['Shape']]) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -14725,7 +14876,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 294, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -14733,14 +14884,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 294, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("whereCollides", 1, 2, 2, 1); __PYX_ERR(0, 290, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("whereCollides", 1, 2, 2, 1); __PYX_ERR(0, 294, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "whereCollides") < 0)) __PYX_ERR(0, 290, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "whereCollides") < 0)) __PYX_ERR(0, 294, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -14753,7 +14904,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("whereCollides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 290, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("whereCollides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 294, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -14799,20 +14950,20 @@ static PyObject *__pyx_pf_10collisions_5Shape_4whereCollides(CYTHON_UNUSED PyObj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("whereCollides", 1); - /* "collisions.py":300 + /* "collisions.py":304 * Iterable[pointLike]: Points that lie both on this shape and the input shape(s) * """ * if isinstance(othershape, Shape): # <<<<<<<<<<<<<< * return self._where(othershape) * points = [] */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_IsInstance(__pyx_v_othershape, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 300, __pyx_L1_error) + __pyx_t_2 = PyObject_IsInstance(__pyx_v_othershape, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":301 + /* "collisions.py":305 * """ * if isinstance(othershape, Shape): * return self._where(othershape) # <<<<<<<<<<<<<< @@ -14820,7 +14971,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_4whereCollides(CYTHON_UNUSED PyObj * for s in othershape: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_where); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 301, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_where); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -14840,7 +14991,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_4whereCollides(CYTHON_UNUSED PyObj PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_othershape}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 301, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -14848,7 +14999,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_4whereCollides(CYTHON_UNUSED PyObj __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":300 + /* "collisions.py":304 * Iterable[pointLike]: Points that lie both on this shape and the input shape(s) * """ * if isinstance(othershape, Shape): # <<<<<<<<<<<<<< @@ -14857,19 +15008,19 @@ static PyObject *__pyx_pf_10collisions_5Shape_4whereCollides(CYTHON_UNUSED PyObj */ } - /* "collisions.py":302 + /* "collisions.py":306 * if isinstance(othershape, Shape): * return self._where(othershape) * points = [] # <<<<<<<<<<<<<< * for s in othershape: * points.extend(s._where(self)) */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_points = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":303 + /* "collisions.py":307 * return self._where(othershape) * points = [] * for s in othershape: # <<<<<<<<<<<<<< @@ -14881,9 +15032,9 @@ static PyObject *__pyx_pf_10collisions_5Shape_4whereCollides(CYTHON_UNUSED PyObj __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_othershape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_othershape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 307, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -14891,28 +15042,28 @@ static PyObject *__pyx_pf_10collisions_5Shape_4whereCollides(CYTHON_UNUSED PyObj { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 303, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 307, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 307, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 303, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 307, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 307, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -14922,7 +15073,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_4whereCollides(CYTHON_UNUSED PyObj PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 303, __pyx_L1_error) + else __PYX_ERR(0, 307, __pyx_L1_error) } break; } @@ -14931,14 +15082,14 @@ static PyObject *__pyx_pf_10collisions_5Shape_4whereCollides(CYTHON_UNUSED PyObj __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":304 + /* "collisions.py":308 * points = [] * for s in othershape: * points.extend(s._where(self)) # <<<<<<<<<<<<<< * return points * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_where); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_where); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; __pyx_t_5 = 0; @@ -14958,14 +15109,14 @@ static PyObject *__pyx_pf_10collisions_5Shape_4whereCollides(CYTHON_UNUSED PyObj PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_self}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_points, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 304, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_points, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 308, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":303 + /* "collisions.py":307 * return self._where(othershape) * points = [] * for s in othershape: # <<<<<<<<<<<<<< @@ -14975,7 +15126,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_4whereCollides(CYTHON_UNUSED PyObj } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":305 + /* "collisions.py":309 * for s in othershape: * points.extend(s._where(self)) * return points # <<<<<<<<<<<<<< @@ -14987,7 +15138,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_4whereCollides(CYTHON_UNUSED PyObj __pyx_r = __pyx_v_points; goto __pyx_L0; - /* "collisions.py":290 + /* "collisions.py":294 * return False * * def whereCollides(self, othershape: Union['Shape','Shapes',Iterable['Shape']]) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -15011,7 +15162,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_4whereCollides(CYTHON_UNUSED PyObj return __pyx_r; } -/* "collisions.py":307 +/* "collisions.py":311 * return points * * def isContaining(self, othershape: Union['Shape','Shapes',Iterable['Shape']]) -> bool: # <<<<<<<<<<<<<< @@ -15076,7 +15227,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 311, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -15084,14 +15235,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 311, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("isContaining", 1, 2, 2, 1); __PYX_ERR(0, 307, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("isContaining", 1, 2, 2, 1); __PYX_ERR(0, 311, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isContaining") < 0)) __PYX_ERR(0, 307, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isContaining") < 0)) __PYX_ERR(0, 311, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -15104,7 +15255,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("isContaining", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 307, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("isContaining", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 311, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -15148,20 +15299,20 @@ static PyObject *__pyx_pf_10collisions_5Shape_6isContaining(CYTHON_UNUSED PyObje int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isContaining", 1); - /* "collisions.py":317 + /* "collisions.py":321 * bool: Whether the shape is fully enclosed within this shape. * """ * if isinstance(othershape, Shape): # <<<<<<<<<<<<<< * return self._contains(othershape) * for s in othershape: */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_IsInstance(__pyx_v_othershape, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_2 = PyObject_IsInstance(__pyx_v_othershape, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":318 + /* "collisions.py":322 * """ * if isinstance(othershape, Shape): * return self._contains(othershape) # <<<<<<<<<<<<<< @@ -15169,7 +15320,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_6isContaining(CYTHON_UNUSED PyObje * if self._contains(s): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_contains); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_contains); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -15189,7 +15340,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_6isContaining(CYTHON_UNUSED PyObje PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_othershape}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -15197,7 +15348,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_6isContaining(CYTHON_UNUSED PyObje __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":317 + /* "collisions.py":321 * bool: Whether the shape is fully enclosed within this shape. * """ * if isinstance(othershape, Shape): # <<<<<<<<<<<<<< @@ -15206,7 +15357,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_6isContaining(CYTHON_UNUSED PyObje */ } - /* "collisions.py":319 + /* "collisions.py":323 * if isinstance(othershape, Shape): * return self._contains(othershape) * for s in othershape: # <<<<<<<<<<<<<< @@ -15218,9 +15369,9 @@ static PyObject *__pyx_pf_10collisions_5Shape_6isContaining(CYTHON_UNUSED PyObje __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_othershape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_othershape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 323, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -15228,28 +15379,28 @@ static PyObject *__pyx_pf_10collisions_5Shape_6isContaining(CYTHON_UNUSED PyObje { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 319, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 323, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 323, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 319, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 323, __pyx_L1_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 323, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -15259,7 +15410,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_6isContaining(CYTHON_UNUSED PyObje PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 319, __pyx_L1_error) + else __PYX_ERR(0, 323, __pyx_L1_error) } break; } @@ -15268,14 +15419,14 @@ static PyObject *__pyx_pf_10collisions_5Shape_6isContaining(CYTHON_UNUSED PyObje __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":320 + /* "collisions.py":324 * return self._contains(othershape) * for s in othershape: * if self._contains(s): # <<<<<<<<<<<<<< * return True * return False */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_contains); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_contains); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; __pyx_t_5 = 0; @@ -15295,15 +15446,15 @@ static PyObject *__pyx_pf_10collisions_5Shape_6isContaining(CYTHON_UNUSED PyObje PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_s}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 320, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 320, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 324, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - /* "collisions.py":321 + /* "collisions.py":325 * for s in othershape: * if self._contains(s): * return True # <<<<<<<<<<<<<< @@ -15316,7 +15467,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_6isContaining(CYTHON_UNUSED PyObje __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":320 + /* "collisions.py":324 * return self._contains(othershape) * for s in othershape: * if self._contains(s): # <<<<<<<<<<<<<< @@ -15325,7 +15476,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_6isContaining(CYTHON_UNUSED PyObje */ } - /* "collisions.py":319 + /* "collisions.py":323 * if isinstance(othershape, Shape): * return self._contains(othershape) * for s in othershape: # <<<<<<<<<<<<<< @@ -15335,7 +15486,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_6isContaining(CYTHON_UNUSED PyObje } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":322 + /* "collisions.py":326 * if self._contains(s): * return True * return False # <<<<<<<<<<<<<< @@ -15347,7 +15498,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_6isContaining(CYTHON_UNUSED PyObje __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":307 + /* "collisions.py":311 * return points * * def isContaining(self, othershape: Union['Shape','Shapes',Iterable['Shape']]) -> bool: # <<<<<<<<<<<<<< @@ -15370,7 +15521,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_6isContaining(CYTHON_UNUSED PyObje return __pyx_r; } -/* "collisions.py":324 +/* "collisions.py":328 * return False * * def distance_to(self, othershape: 'Shape') -> Number: # <<<<<<<<<<<<<< @@ -15435,7 +15586,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 324, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 328, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -15443,14 +15594,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 324, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 328, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("distance_to", 1, 2, 2, 1); __PYX_ERR(0, 324, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("distance_to", 1, 2, 2, 1); __PYX_ERR(0, 328, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "distance_to") < 0)) __PYX_ERR(0, 324, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "distance_to") < 0)) __PYX_ERR(0, 328, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -15463,7 +15614,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("distance_to", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 324, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("distance_to", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 328, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -15507,14 +15658,14 @@ static PyObject *__pyx_pf_10collisions_5Shape_8distance_to(CYTHON_UNUSED PyObjec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("distance_to", 1); - /* "collisions.py":334 + /* "collisions.py":338 * Number: The distance between this shape and the other shape * """ * thisP = self.closestPointTo(othershape) # <<<<<<<<<<<<<< * otherP = othershape.closestPointTo(self) * return math.hypot(thisP[0]-otherP[0], thisP[1]-otherP[1]) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -15534,21 +15685,21 @@ static PyObject *__pyx_pf_10collisions_5Shape_8distance_to(CYTHON_UNUSED PyObjec PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_othershape}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_thisP = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":335 + /* "collisions.py":339 * """ * thisP = self.closestPointTo(othershape) * otherP = othershape.closestPointTo(self) # <<<<<<<<<<<<<< * return math.hypot(thisP[0]-otherP[0], thisP[1]-otherP[1]) * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 335, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -15568,14 +15719,14 @@ static PyObject *__pyx_pf_10collisions_5Shape_8distance_to(CYTHON_UNUSED PyObjec PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 335, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_otherP = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":336 + /* "collisions.py":340 * thisP = self.closestPointTo(othershape) * otherP = othershape.closestPointTo(self) * return math.hypot(thisP[0]-otherP[0], thisP[1]-otherP[1]) # <<<<<<<<<<<<<< @@ -15583,24 +15734,24 @@ static PyObject *__pyx_pf_10collisions_5Shape_8distance_to(CYTHON_UNUSED PyObjec * def check_rects(self, othershape: 'Shape') -> bool: */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_hypot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_hypot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_thisP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_thisP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_otherP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_otherP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_thisP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_thisP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_otherP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_otherP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyNumber_Subtract(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_7 = PyNumber_Subtract(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -15624,7 +15775,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_8distance_to(CYTHON_UNUSED PyObjec __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 336, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -15632,7 +15783,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_8distance_to(CYTHON_UNUSED PyObjec __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":324 + /* "collisions.py":328 * return False * * def distance_to(self, othershape: 'Shape') -> Number: # <<<<<<<<<<<<<< @@ -15658,7 +15809,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_8distance_to(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "collisions.py":338 +/* "collisions.py":342 * return math.hypot(thisP[0]-otherP[0], thisP[1]-otherP[1]) * * def check_rects(self, othershape: 'Shape') -> bool: # <<<<<<<<<<<<<< @@ -15723,7 +15874,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -15731,14 +15882,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("check_rects", 1, 2, 2, 1); __PYX_ERR(0, 338, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("check_rects", 1, 2, 2, 1); __PYX_ERR(0, 342, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "check_rects") < 0)) __PYX_ERR(0, 338, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "check_rects") < 0)) __PYX_ERR(0, 342, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -15751,7 +15902,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("check_rects", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 338, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("check_rects", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 342, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -15794,14 +15945,14 @@ static PyObject *__pyx_pf_10collisions_5Shape_10check_rects(CYTHON_UNUSED PyObje int __pyx_clineno = 0; __Pyx_RefNannySetupContext("check_rects", 1); - /* "collisions.py":350 + /* "collisions.py":354 * bool: Whether the bounding boxes of this object an the othershape collide * """ * thisr, otherr = self.rect(), othershape.rect() # <<<<<<<<<<<<<< * return thisr[0] <= otherr[2] and thisr[2] >= otherr[0] and thisr[1] <= otherr[3] and thisr[3] >= otherr[1] * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -15821,11 +15972,11 @@ static PyObject *__pyx_pf_10collisions_5Shape_10check_rects(CYTHON_UNUSED PyObje PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_4 = 0; @@ -15845,7 +15996,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_10check_rects(CYTHON_UNUSED PyObje PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -15854,7 +16005,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_10check_rects(CYTHON_UNUSED PyObje __pyx_v_otherr = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":351 + /* "collisions.py":355 * """ * thisr, otherr = self.rect(), othershape.rect() * return thisr[0] <= otherr[2] and thisr[2] >= otherr[0] and thisr[1] <= otherr[3] and thisr[3] >= otherr[1] # <<<<<<<<<<<<<< @@ -15862,14 +16013,14 @@ static PyObject *__pyx_pf_10collisions_5Shape_10check_rects(CYTHON_UNUSED PyObje * def __repr__(self): return str(self) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_thisr, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_thisr, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_otherr, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_otherr, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 355, __pyx_L1_error) if (__pyx_t_6) { __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { @@ -15878,14 +16029,14 @@ static PyObject *__pyx_pf_10collisions_5Shape_10check_rects(CYTHON_UNUSED PyObje __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L3_bool_binop_done; } - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_thisr, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_thisr, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_otherr, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_otherr, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 355, __pyx_L1_error) if (__pyx_t_6) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { @@ -15894,14 +16045,14 @@ static PyObject *__pyx_pf_10collisions_5Shape_10check_rects(CYTHON_UNUSED PyObje __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L3_bool_binop_done; } - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_thisr, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_thisr, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_otherr, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_otherr, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 355, __pyx_L1_error) if (__pyx_t_6) { __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { @@ -15910,11 +16061,11 @@ static PyObject *__pyx_pf_10collisions_5Shape_10check_rects(CYTHON_UNUSED PyObje __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L3_bool_binop_done; } - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_thisr, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_thisr, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_otherr, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_otherr, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_INCREF(__pyx_t_1); @@ -15925,7 +16076,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_10check_rects(CYTHON_UNUSED PyObje __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":338 + /* "collisions.py":342 * return math.hypot(thisP[0]-otherP[0], thisP[1]-otherP[1]) * * def check_rects(self, othershape: 'Shape') -> bool: # <<<<<<<<<<<<<< @@ -15949,7 +16100,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_10check_rects(CYTHON_UNUSED PyObje return __pyx_r; } -/* "collisions.py":353 +/* "collisions.py":357 * return thisr[0] <= otherr[2] and thisr[2] >= otherr[0] and thisr[1] <= otherr[3] and thisr[3] >= otherr[1] * * def __repr__(self): return str(self) # <<<<<<<<<<<<<< @@ -16010,12 +16161,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 353, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 357, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__repr__") < 0)) __PYX_ERR(0, 353, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__repr__") < 0)) __PYX_ERR(0, 357, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -16026,7 +16177,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 353, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 357, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -16062,7 +16213,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_12__repr__(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__repr__", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -16079,7 +16230,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_12__repr__(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":356 +/* "collisions.py":360 * * # Replace these * def _collides(self, othershape: 'Shape') -> bool: # <<<<<<<<<<<<<< @@ -16143,7 +16294,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 356, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 360, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -16151,14 +16302,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 356, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 360, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 356, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 360, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_collides") < 0)) __PYX_ERR(0, 356, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_collides") < 0)) __PYX_ERR(0, 360, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -16171,7 +16322,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 356, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 360, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -16203,7 +16354,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_14_collides(CYTHON_UNUSED PyObject __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_collides", 1); - /* "collisions.py":357 + /* "collisions.py":361 * # Replace these * def _collides(self, othershape: 'Shape') -> bool: * return True # <<<<<<<<<<<<<< @@ -16215,7 +16366,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_14_collides(CYTHON_UNUSED PyObject __pyx_r = Py_True; goto __pyx_L0; - /* "collisions.py":356 + /* "collisions.py":360 * * # Replace these * def _collides(self, othershape: 'Shape') -> bool: # <<<<<<<<<<<<<< @@ -16230,7 +16381,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_14_collides(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":359 +/* "collisions.py":363 * return True * * def _where(self, othershape: 'Shape') -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -16294,7 +16445,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 359, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -16302,14 +16453,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 359, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, 1); __PYX_ERR(0, 359, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, 1); __PYX_ERR(0, 363, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_where") < 0)) __PYX_ERR(0, 359, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_where") < 0)) __PYX_ERR(0, 363, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -16322,7 +16473,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 359, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 363, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -16358,7 +16509,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_16_where(CYTHON_UNUSED PyObject *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_where", 1); - /* "collisions.py":360 + /* "collisions.py":364 * * def _where(self, othershape: 'Shape') -> Iterable[pointLike]: * return [] # <<<<<<<<<<<<<< @@ -16366,13 +16517,13 @@ static PyObject *__pyx_pf_10collisions_5Shape_16_where(CYTHON_UNUSED PyObject *_ * def _contains(self, othershape: 'Shape') -> bool: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":359 + /* "collisions.py":363 * return True * * def _where(self, othershape: 'Shape') -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -16391,7 +16542,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_16_where(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":362 +/* "collisions.py":366 * return [] * * def _contains(self, othershape: 'Shape') -> bool: # <<<<<<<<<<<<<< @@ -16455,7 +16606,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 366, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -16463,14 +16614,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 366, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, 1); __PYX_ERR(0, 362, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, 1); __PYX_ERR(0, 366, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_contains") < 0)) __PYX_ERR(0, 362, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_contains") < 0)) __PYX_ERR(0, 366, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -16483,7 +16634,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 362, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 366, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -16515,7 +16666,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_18_contains(CYTHON_UNUSED PyObject __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_contains", 1); - /* "collisions.py":363 + /* "collisions.py":367 * * def _contains(self, othershape: 'Shape') -> bool: * return True # <<<<<<<<<<<<<< @@ -16527,7 +16678,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_18_contains(CYTHON_UNUSED PyObject __pyx_r = Py_True; goto __pyx_L0; - /* "collisions.py":362 + /* "collisions.py":366 * return [] * * def _contains(self, othershape: 'Shape') -> bool: # <<<<<<<<<<<<<< @@ -16542,7 +16693,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_18_contains(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":365 +/* "collisions.py":369 * return True * * def closestPointTo(self, othershape: 'Shape', returnAll: bool = False) -> pointLike|Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -16611,7 +16762,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 369, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -16619,21 +16770,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 369, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, 1); __PYX_ERR(0, 365, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, 1); __PYX_ERR(0, 369, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_returnAll); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 369, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "closestPointTo") < 0)) __PYX_ERR(0, 365, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "closestPointTo") < 0)) __PYX_ERR(0, 369, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -16651,7 +16802,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 365, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 369, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -16688,17 +16839,17 @@ static PyObject *__pyx_pf_10collisions_5Shape_20closestPointTo(CYTHON_UNUSED PyO int __pyx_clineno = 0; __Pyx_RefNannySetupContext("closestPointTo", 1); - /* "collisions.py":376 + /* "collisions.py":380 * pointLike|Iterable[pointLike]: The closest point(s) on this object to the other object. Whether this is an iterable or not depends on the `returnAll` parameter. * """ * if returnAll: # <<<<<<<<<<<<<< * return [(0, 0)] * return (0, 0) */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 380, __pyx_L1_error) if (__pyx_t_1) { - /* "collisions.py":377 + /* "collisions.py":381 * """ * if returnAll: * return [(0, 0)] # <<<<<<<<<<<<<< @@ -16706,16 +16857,16 @@ static PyObject *__pyx_pf_10collisions_5Shape_20closestPointTo(CYTHON_UNUSED PyO * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_tuple__2)) __PYX_ERR(0, 377, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_tuple__2)) __PYX_ERR(0, 381, __pyx_L1_error); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":376 + /* "collisions.py":380 * pointLike|Iterable[pointLike]: The closest point(s) on this object to the other object. Whether this is an iterable or not depends on the `returnAll` parameter. * """ * if returnAll: # <<<<<<<<<<<<<< @@ -16724,7 +16875,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_20closestPointTo(CYTHON_UNUSED PyO */ } - /* "collisions.py":378 + /* "collisions.py":382 * if returnAll: * return [(0, 0)] * return (0, 0) # <<<<<<<<<<<<<< @@ -16736,7 +16887,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_20closestPointTo(CYTHON_UNUSED PyO __pyx_r = __pyx_tuple__2; goto __pyx_L0; - /* "collisions.py":365 + /* "collisions.py":369 * return True * * def closestPointTo(self, othershape: 'Shape', returnAll: bool = False) -> pointLike|Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -16755,7 +16906,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_20closestPointTo(CYTHON_UNUSED PyO return __pyx_r; } -/* "collisions.py":380 +/* "collisions.py":384 * return (0, 0) * * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< @@ -16773,18 +16924,18 @@ static PyObject *__pyx_pf_10collisions_22__defaults__(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_precision); __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 380, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 384, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 384, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 380, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 384, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -16864,7 +17015,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 384, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -16872,21 +17023,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 384, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, 1); __PYX_ERR(0, 380, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, 1); __PYX_ERR(0, 384, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_precision); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 384, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isCorner") < 0)) __PYX_ERR(0, 380, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isCorner") < 0)) __PYX_ERR(0, 384, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -16904,7 +17055,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 380, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 384, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -16936,7 +17087,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_22isCorner(CYTHON_UNUSED PyObject __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isCorner", 1); - /* "collisions.py":391 + /* "collisions.py":395 * bool: Whether the point is on a corner of this shape * """ * return True # <<<<<<<<<<<<<< @@ -16948,7 +17099,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_22isCorner(CYTHON_UNUSED PyObject __pyx_r = Py_True; goto __pyx_L0; - /* "collisions.py":380 + /* "collisions.py":384 * return (0, 0) * * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< @@ -16963,7 +17114,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_22isCorner(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":393 +/* "collisions.py":397 * return True * * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< @@ -17031,7 +17182,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 393, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 397, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -17039,9 +17190,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 393, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 397, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 1); __PYX_ERR(0, 393, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 1); __PYX_ERR(0, 397, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -17049,14 +17200,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 393, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 397, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 2); __PYX_ERR(0, 393, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 2); __PYX_ERR(0, 397, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tangent") < 0)) __PYX_ERR(0, 393, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tangent") < 0)) __PYX_ERR(0, 397, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -17071,7 +17222,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 393, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 397, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -17114,7 +17265,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_24tangent(CYTHON_UNUSED PyObject * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tangent", 1); - /* "collisions.py":404 + /* "collisions.py":408 * Number: The tangent of this object at the point. You can -90 to get the normal. * """ * return math.degrees(math.atan2(vel[1], vel[0])) % 360 # <<<<<<<<<<<<<< @@ -17122,19 +17273,19 @@ static PyObject *__pyx_pf_10collisions_5Shape_24tangent(CYTHON_UNUSED PyObject * * def toLines(self) -> Iterable['Line']: */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_degrees); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_degrees); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 404, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_atan2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_atan2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -17156,7 +17307,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_24tangent(CYTHON_UNUSED PyObject * __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -17179,18 +17330,18 @@ static PyObject *__pyx_pf_10collisions_5Shape_24tangent(CYTHON_UNUSED PyObject * __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_3 = __Pyx_PyInt_RemainderObjC(__pyx_t_1, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_RemainderObjC(__pyx_t_1, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":393 + /* "collisions.py":397 * return True * * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< @@ -17215,7 +17366,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_24tangent(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "collisions.py":406 +/* "collisions.py":410 * return math.degrees(math.atan2(vel[1], vel[0])) % 360 * * def toLines(self) -> Iterable['Line']: # <<<<<<<<<<<<<< @@ -17277,12 +17428,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 406, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 410, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toLines") < 0)) __PYX_ERR(0, 406, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toLines") < 0)) __PYX_ERR(0, 410, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -17293,7 +17444,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("toLines", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 406, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("toLines", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 410, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -17329,7 +17480,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_26toLines(CYTHON_UNUSED PyObject * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toLines", 1); - /* "collisions.py":411 + /* "collisions.py":415 * Iterable[Line]: Get a list of all the Lines that make up this object. For anything under a ClosedShape, this will most likely be empty. * """ * return [] # <<<<<<<<<<<<<< @@ -17337,13 +17488,13 @@ static PyObject *__pyx_pf_10collisions_5Shape_26toLines(CYTHON_UNUSED PyObject * * def toPoints(self) -> Iterable[pointLike]: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 411, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":406 + /* "collisions.py":410 * return math.degrees(math.atan2(vel[1], vel[0])) % 360 * * def toLines(self) -> Iterable['Line']: # <<<<<<<<<<<<<< @@ -17362,7 +17513,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_26toLines(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "collisions.py":413 +/* "collisions.py":417 * return [] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -17424,12 +17575,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 413, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 417, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toPoints") < 0)) __PYX_ERR(0, 413, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toPoints") < 0)) __PYX_ERR(0, 417, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -17440,7 +17591,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("toPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 413, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("toPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 417, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -17476,7 +17627,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_28toPoints(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toPoints", 1); - /* "collisions.py":418 + /* "collisions.py":422 * Iterable[pointLike]: Get a list of all the Points that make up this object. For a few shapes (e.g. circles), this will be empty. * """ * return [] # <<<<<<<<<<<<<< @@ -17484,13 +17635,13 @@ static PyObject *__pyx_pf_10collisions_5Shape_28toPoints(CYTHON_UNUSED PyObject * def area(self) -> Number: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":413 + /* "collisions.py":417 * return [] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -17509,7 +17660,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_28toPoints(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":420 +/* "collisions.py":424 * return [] * * def area(self) -> Number: # <<<<<<<<<<<<<< @@ -17571,12 +17722,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 420, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 424, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "area") < 0)) __PYX_ERR(0, 420, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "area") < 0)) __PYX_ERR(0, 424, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -17587,7 +17738,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 420, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 424, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -17624,7 +17775,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_30area(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("area", 1); - /* "collisions.py":427 + /* "collisions.py":431 * Number: The area of the shape * """ * return float('inf') # <<<<<<<<<<<<<< @@ -17632,14 +17783,14 @@ static PyObject *__pyx_pf_10collisions_5Shape_30area(CYTHON_UNUSED PyObject *__p * def rect(self) -> Iterable[Number]: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyUnicode_AsDouble(__pyx_n_u_inf); if (unlikely(__pyx_t_1 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 427, __pyx_L1_error) - __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_AsDouble(__pyx_n_u_inf); if (unlikely(__pyx_t_1 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":420 + /* "collisions.py":424 * return [] * * def area(self) -> Number: # <<<<<<<<<<<<<< @@ -17658,7 +17809,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_30area(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "collisions.py":429 +/* "collisions.py":433 * return float('inf') * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< @@ -17720,12 +17871,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 429, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 433, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rect") < 0)) __PYX_ERR(0, 429, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rect") < 0)) __PYX_ERR(0, 433, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -17736,7 +17887,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 429, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 433, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -17777,7 +17928,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_32rect(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rect", 1); - /* "collisions.py":436 + /* "collisions.py":440 * Iterable[Number]: (min x, min y, max x, max y) * """ * return -float('inf'), -float('inf'), float('inf'), float('inf') # <<<<<<<<<<<<<< @@ -17785,28 +17936,28 @@ static PyObject *__pyx_pf_10collisions_5Shape_32rect(CYTHON_UNUSED PyObject *__p * def handleCollisionsPos(self, oldP: 'Shape', newP: 'Shape', objs: Union['Shapes',Iterable['Shape']], vel: pointLike = [0,0], verbose: bool = False) -> tuple['Shape', pointLike, verboseOutput]: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyUnicode_AsDouble(__pyx_n_u_inf); if (unlikely(__pyx_t_1 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L1_error) - __pyx_t_2 = PyFloat_FromDouble((-__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_AsDouble(__pyx_n_u_inf); if (unlikely(__pyx_t_1 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble((-__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyUnicode_AsDouble(__pyx_n_u_inf); if (unlikely(__pyx_t_1 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L1_error) - __pyx_t_3 = PyFloat_FromDouble((-__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_AsDouble(__pyx_n_u_inf); if (unlikely(__pyx_t_1 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L1_error) + __pyx_t_3 = PyFloat_FromDouble((-__pyx_t_1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyUnicode_AsDouble(__pyx_n_u_inf); if (unlikely(__pyx_t_1 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L1_error) - __pyx_t_4 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_AsDouble(__pyx_n_u_inf); if (unlikely(__pyx_t_1 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyUnicode_AsDouble(__pyx_n_u_inf); if (unlikely(__pyx_t_1 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L1_error) - __pyx_t_5 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyUnicode_AsDouble(__pyx_n_u_inf); if (unlikely(__pyx_t_1 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 440, __pyx_L1_error) + __pyx_t_5 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 436, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 440, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(0, 436, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(0, 440, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 436, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 440, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4)) __PYX_ERR(0, 436, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_4)) __PYX_ERR(0, 440, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5)) __PYX_ERR(0, 436, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_5)) __PYX_ERR(0, 440, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; @@ -17815,7 +17966,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_32rect(CYTHON_UNUSED PyObject *__p __pyx_t_6 = 0; goto __pyx_L0; - /* "collisions.py":429 + /* "collisions.py":433 * return float('inf') * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< @@ -17838,7 +17989,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_32rect(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "collisions.py":438 +/* "collisions.py":442 * return -float('inf'), -float('inf'), float('inf'), float('inf') * * def handleCollisionsPos(self, oldP: 'Shape', newP: 'Shape', objs: Union['Shapes',Iterable['Shape']], vel: pointLike = [0,0], verbose: bool = False) -> tuple['Shape', pointLike, verboseOutput]: # <<<<<<<<<<<<<< @@ -17856,21 +18007,21 @@ static PyObject *__pyx_pf_10collisions_24__defaults__(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_vel); __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_vel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_vel)) __PYX_ERR(0, 438, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_self)->__pyx_arg_vel)) __PYX_ERR(0, 442, __pyx_L1_error); __Pyx_INCREF(((PyObject *)Py_False)); __Pyx_GIVEREF(((PyObject *)Py_False)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_False))) __PYX_ERR(0, 438, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_False))) __PYX_ERR(0, 442, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 438, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 438, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 442, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -17960,7 +18111,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 442, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -17968,9 +18119,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 442, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 6, 1); __PYX_ERR(0, 438, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 6, 1); __PYX_ERR(0, 442, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -17978,9 +18129,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 442, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 6, 2); __PYX_ERR(0, 438, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 6, 2); __PYX_ERR(0, 442, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: @@ -17988,28 +18139,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 442, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 6, 3); __PYX_ERR(0, 438, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 6, 3); __PYX_ERR(0, 442, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vel); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 442, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_verbose); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 438, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 442, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "handleCollisionsPos") < 0)) __PYX_ERR(0, 438, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "handleCollisionsPos") < 0)) __PYX_ERR(0, 442, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -18034,7 +18185,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 6, __pyx_nargs); __PYX_ERR(0, 438, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 6, __pyx_nargs); __PYX_ERR(0, 442, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18072,17 +18223,17 @@ static PyObject *__pyx_pf_10collisions_5Shape_34handleCollisionsPos(CYTHON_UNUSE int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handleCollisionsPos", 1); - /* "collisions.py":442 + /* "collisions.py":446 * This is called to modify objects' positions to bounce off objects. * """ * if verbose: # <<<<<<<<<<<<<< * return newP, vel, [] * return newP, vel */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 442, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 446, __pyx_L1_error) if (__pyx_t_1) { - /* "collisions.py":443 + /* "collisions.py":447 * """ * if verbose: * return newP, vel, [] # <<<<<<<<<<<<<< @@ -18090,24 +18241,24 @@ static PyObject *__pyx_pf_10collisions_5Shape_34handleCollisionsPos(CYTHON_UNUSE * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_newP); __Pyx_GIVEREF(__pyx_v_newP); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_newP)) __PYX_ERR(0, 443, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_newP)) __PYX_ERR(0, 447, __pyx_L1_error); __Pyx_INCREF(__pyx_v_vel); __Pyx_GIVEREF(__pyx_v_vel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vel)) __PYX_ERR(0, 443, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vel)) __PYX_ERR(0, 447, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(0, 443, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":442 + /* "collisions.py":446 * This is called to modify objects' positions to bounce off objects. * """ * if verbose: # <<<<<<<<<<<<<< @@ -18116,7 +18267,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_34handleCollisionsPos(CYTHON_UNUSE */ } - /* "collisions.py":444 + /* "collisions.py":448 * if verbose: * return newP, vel, [] * return newP, vel # <<<<<<<<<<<<<< @@ -18124,19 +18275,19 @@ static PyObject *__pyx_pf_10collisions_5Shape_34handleCollisionsPos(CYTHON_UNUSE * def handleCollisionsVel(self, vel: pointLike, objs: Union['Shapes',Iterable['Shape']], verbose: bool = False) -> tuple['Shape', pointLike, verboseOutput]: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_newP); __Pyx_GIVEREF(__pyx_v_newP); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_newP)) __PYX_ERR(0, 444, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_newP)) __PYX_ERR(0, 448, __pyx_L1_error); __Pyx_INCREF(__pyx_v_vel); __Pyx_GIVEREF(__pyx_v_vel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vel)) __PYX_ERR(0, 444, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vel)) __PYX_ERR(0, 448, __pyx_L1_error); __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":438 + /* "collisions.py":442 * return -float('inf'), -float('inf'), float('inf'), float('inf') * * def handleCollisionsPos(self, oldP: 'Shape', newP: 'Shape', objs: Union['Shapes',Iterable['Shape']], vel: pointLike = [0,0], verbose: bool = False) -> tuple['Shape', pointLike, verboseOutput]: # <<<<<<<<<<<<<< @@ -18156,7 +18307,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_34handleCollisionsPos(CYTHON_UNUSE return __pyx_r; } -/* "collisions.py":446 +/* "collisions.py":450 * return newP, vel * * def handleCollisionsVel(self, vel: pointLike, objs: Union['Shapes',Iterable['Shape']], verbose: bool = False) -> tuple['Shape', pointLike, verboseOutput]: # <<<<<<<<<<<<<< @@ -18228,7 +18379,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 450, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -18236,9 +18387,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 450, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 4, 1); __PYX_ERR(0, 446, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 4, 1); __PYX_ERR(0, 450, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -18246,21 +18397,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 450, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 4, 2); __PYX_ERR(0, 446, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 4, 2); __PYX_ERR(0, 450, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_verbose); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 446, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 450, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "handleCollisionsVel") < 0)) __PYX_ERR(0, 446, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "handleCollisionsVel") < 0)) __PYX_ERR(0, 450, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -18280,7 +18431,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 446, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 450, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18318,17 +18469,17 @@ static PyObject *__pyx_pf_10collisions_5Shape_36handleCollisionsVel(CYTHON_UNUSE int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handleCollisionsVel", 1); - /* "collisions.py":450 + /* "collisions.py":454 * This is a wrapper for `handleCollisionsPos` to handle velocity instead of position. * """ * if verbose: # <<<<<<<<<<<<<< * return self, vel, [] * return self, vel */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 450, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 454, __pyx_L1_error) if (__pyx_t_1) { - /* "collisions.py":451 + /* "collisions.py":455 * """ * if verbose: * return self, vel, [] # <<<<<<<<<<<<<< @@ -18336,24 +18487,24 @@ static PyObject *__pyx_pf_10collisions_5Shape_36handleCollisionsVel(CYTHON_UNUSE * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self)) __PYX_ERR(0, 451, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self)) __PYX_ERR(0, 455, __pyx_L1_error); __Pyx_INCREF(__pyx_v_vel); __Pyx_GIVEREF(__pyx_v_vel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vel)) __PYX_ERR(0, 451, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vel)) __PYX_ERR(0, 455, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":450 + /* "collisions.py":454 * This is a wrapper for `handleCollisionsPos` to handle velocity instead of position. * """ * if verbose: # <<<<<<<<<<<<<< @@ -18362,7 +18513,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_36handleCollisionsVel(CYTHON_UNUSE */ } - /* "collisions.py":452 + /* "collisions.py":456 * if verbose: * return self, vel, [] * return self, vel # <<<<<<<<<<<<<< @@ -18370,19 +18521,19 @@ static PyObject *__pyx_pf_10collisions_5Shape_36handleCollisionsVel(CYTHON_UNUSE * def copy(self) -> 'Shape': */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self)) __PYX_ERR(0, 452, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self)) __PYX_ERR(0, 456, __pyx_L1_error); __Pyx_INCREF(__pyx_v_vel); __Pyx_GIVEREF(__pyx_v_vel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vel)) __PYX_ERR(0, 452, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vel)) __PYX_ERR(0, 456, __pyx_L1_error); __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":446 + /* "collisions.py":450 * return newP, vel * * def handleCollisionsVel(self, vel: pointLike, objs: Union['Shapes',Iterable['Shape']], verbose: bool = False) -> tuple['Shape', pointLike, verboseOutput]: # <<<<<<<<<<<<<< @@ -18402,7 +18553,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_36handleCollisionsVel(CYTHON_UNUSE return __pyx_r; } -/* "collisions.py":454 +/* "collisions.py":458 * return self, vel * * def copy(self) -> 'Shape': # <<<<<<<<<<<<<< @@ -18464,12 +18615,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 454, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(0, 454, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(0, 458, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -18480,7 +18631,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("copy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 454, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("copy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 458, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18520,7 +18671,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_38copy(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 1); - /* "collisions.py":458 + /* "collisions.py":462 * Copy this shape to return another with the same properties * """ * return Shape(self.bounciness) # <<<<<<<<<<<<<< @@ -18528,9 +18679,9 @@ static PyObject *__pyx_pf_10collisions_5Shape_38copy(CYTHON_UNUSED PyObject *__p * def __getitem__(self, it: int) -> None: */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -18551,7 +18702,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_38copy(CYTHON_UNUSED PyObject *__p __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -18559,7 +18710,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_38copy(CYTHON_UNUSED PyObject *__p __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":454 + /* "collisions.py":458 * return self, vel * * def copy(self) -> 'Shape': # <<<<<<<<<<<<<< @@ -18581,7 +18732,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_38copy(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "collisions.py":460 +/* "collisions.py":464 * return Shape(self.bounciness) * * def __getitem__(self, it: int) -> None: # <<<<<<<<<<<<<< @@ -18645,7 +18796,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 464, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -18653,14 +18804,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 464, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 460, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 464, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__getitem__") < 0)) __PYX_ERR(0, 460, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__getitem__") < 0)) __PYX_ERR(0, 464, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -18673,7 +18824,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 460, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 464, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18687,7 +18838,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_it), (&PyInt_Type), 0, "it", 1))) __PYX_ERR(0, 460, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_it), (&PyInt_Type), 0, "it", 1))) __PYX_ERR(0, 464, __pyx_L1_error) __pyx_r = __pyx_pf_10collisions_5Shape_40__getitem__(__pyx_self, __pyx_v_self, __pyx_v_it); /* function exit code */ @@ -18710,7 +18861,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_40__getitem__(CYTHON_UNUSED PyObje __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__getitem__", 1); - /* "collisions.py":461 + /* "collisions.py":465 * * def __getitem__(self, it: int) -> None: * return 0 # <<<<<<<<<<<<<< @@ -18722,7 +18873,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_40__getitem__(CYTHON_UNUSED PyObje __pyx_r = __pyx_int_0; goto __pyx_L0; - /* "collisions.py":460 + /* "collisions.py":464 * return Shape(self.bounciness) * * def __getitem__(self, it: int) -> None: # <<<<<<<<<<<<<< @@ -18737,7 +18888,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_40__getitem__(CYTHON_UNUSED PyObje return __pyx_r; } -/* "collisions.py":463 +/* "collisions.py":467 * return 0 * * def __setitem__(self, it: int, new: Number) -> None: # <<<<<<<<<<<<<< @@ -18804,7 +18955,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 467, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -18812,9 +18963,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 467, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 463, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 467, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -18822,14 +18973,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 463, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 467, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 463, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 467, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(0, 463, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(0, 467, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -18844,7 +18995,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 463, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 467, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -18858,7 +19009,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_it), (&PyInt_Type), 0, "it", 1))) __PYX_ERR(0, 463, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_it), (&PyInt_Type), 0, "it", 1))) __PYX_ERR(0, 467, __pyx_L1_error) __pyx_r = __pyx_pf_10collisions_5Shape_42__setitem__(__pyx_self, __pyx_v_self, __pyx_v_it, __pyx_v_new); /* function exit code */ @@ -18888,7 +19039,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_42__setitem__(CYTHON_UNUSED PyObje return __pyx_r; } -/* "collisions.py":466 +/* "collisions.py":470 * pass * * def __iter__(self): # <<<<<<<<<<<<<< @@ -18949,12 +19100,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 466, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 470, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__iter__") < 0)) __PYX_ERR(0, 466, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__iter__") < 0)) __PYX_ERR(0, 470, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -18965,7 +19116,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 466, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 470, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19002,7 +19153,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_44__iter__(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 1); - /* "collisions.py":467 + /* "collisions.py":471 * * def __iter__(self): * return iter([]) # <<<<<<<<<<<<<< @@ -19010,16 +19161,16 @@ static PyObject *__pyx_pf_10collisions_5Shape_44__iter__(CYTHON_UNUSED PyObject * def __str__(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 467, __pyx_L1_error) + __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":466 + /* "collisions.py":470 * pass * * def __iter__(self): # <<<<<<<<<<<<<< @@ -19039,7 +19190,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_44__iter__(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":469 +/* "collisions.py":473 * return iter([]) * * def __str__(self): # <<<<<<<<<<<<<< @@ -19100,12 +19251,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 469, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 473, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 469, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 473, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -19116,7 +19267,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 469, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 473, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19148,7 +19299,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_46__str__(CYTHON_UNUSED PyObject * __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__", 1); - /* "collisions.py":470 + /* "collisions.py":474 * * def __str__(self): * return '' # <<<<<<<<<<<<<< @@ -19160,7 +19311,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_46__str__(CYTHON_UNUSED PyObject * __pyx_r = __pyx_kp_u_Shape_2; goto __pyx_L0; - /* "collisions.py":469 + /* "collisions.py":473 * return iter([]) * * def __str__(self): # <<<<<<<<<<<<<< @@ -19175,7 +19326,7 @@ static PyObject *__pyx_pf_10collisions_5Shape_46__str__(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "collisions.py":474 +/* "collisions.py":478 * class NoShape(Shape): * """A class to represent no shape. This is useful for when you want to have a shape that doesn't collide with anything.""" * def __init__(self): # <<<<<<<<<<<<<< @@ -19236,12 +19387,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 474, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 478, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 474, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 478, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -19252,7 +19403,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 474, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 478, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19291,7 +19442,7 @@ static PyObject *__pyx_pf_10collisions_7NoShape___init__(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); - /* "collisions.py":475 + /* "collisions.py":479 * """A class to represent no shape. This is useful for when you want to have a shape that doesn't collide with anything.""" * def __init__(self): * super().__init__(0) # <<<<<<<<<<<<<< @@ -19299,20 +19450,20 @@ static PyObject *__pyx_pf_10collisions_7NoShape___init__(CYTHON_UNUSED PyObject * def _collides(self, othershape: Shape) -> bool: */ __pyx_t_2 = __Pyx_CyFunction_GetClassObj(__pyx_self); - if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 475, __pyx_L1_error) } + if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 479, __pyx_L1_error) } __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 479, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(0, 475, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(0, 479, __pyx_L1_error); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 475, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -19333,13 +19484,13 @@ static PyObject *__pyx_pf_10collisions_7NoShape___init__(CYTHON_UNUSED PyObject PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_int_0}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":474 + /* "collisions.py":478 * class NoShape(Shape): * """A class to represent no shape. This is useful for when you want to have a shape that doesn't collide with anything.""" * def __init__(self): # <<<<<<<<<<<<<< @@ -19362,7 +19513,7 @@ static PyObject *__pyx_pf_10collisions_7NoShape___init__(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":477 +/* "collisions.py":481 * super().__init__(0) * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< @@ -19426,7 +19577,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 477, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -19434,14 +19585,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 477, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 477, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 481, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_collides") < 0)) __PYX_ERR(0, 477, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_collides") < 0)) __PYX_ERR(0, 481, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -19454,7 +19605,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 477, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 481, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19486,7 +19637,7 @@ static PyObject *__pyx_pf_10collisions_7NoShape_2_collides(CYTHON_UNUSED PyObjec __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_collides", 1); - /* "collisions.py":478 + /* "collisions.py":482 * * def _collides(self, othershape: Shape) -> bool: * return False # <<<<<<<<<<<<<< @@ -19498,7 +19649,7 @@ static PyObject *__pyx_pf_10collisions_7NoShape_2_collides(CYTHON_UNUSED PyObjec __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":477 + /* "collisions.py":481 * super().__init__(0) * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< @@ -19513,7 +19664,7 @@ static PyObject *__pyx_pf_10collisions_7NoShape_2_collides(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "collisions.py":480 +/* "collisions.py":484 * return False * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -19577,7 +19728,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 480, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -19585,14 +19736,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 480, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, 1); __PYX_ERR(0, 480, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, 1); __PYX_ERR(0, 484, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_where") < 0)) __PYX_ERR(0, 480, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_where") < 0)) __PYX_ERR(0, 484, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -19605,7 +19756,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 480, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 484, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19641,7 +19792,7 @@ static PyObject *__pyx_pf_10collisions_7NoShape_4_where(CYTHON_UNUSED PyObject * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_where", 1); - /* "collisions.py":481 + /* "collisions.py":485 * * def _where(self, othershape: Shape) -> Iterable[pointLike]: * return [] # <<<<<<<<<<<<<< @@ -19649,13 +19800,13 @@ static PyObject *__pyx_pf_10collisions_7NoShape_4_where(CYTHON_UNUSED PyObject * * def _contains(self, othershape: 'Shape') -> bool: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 481, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 485, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":480 + /* "collisions.py":484 * return False * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -19674,7 +19825,7 @@ static PyObject *__pyx_pf_10collisions_7NoShape_4_where(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "collisions.py":483 +/* "collisions.py":487 * return [] * * def _contains(self, othershape: 'Shape') -> bool: # <<<<<<<<<<<<<< @@ -19738,7 +19889,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 483, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 487, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -19746,14 +19897,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 483, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 487, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, 1); __PYX_ERR(0, 483, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, 1); __PYX_ERR(0, 487, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_contains") < 0)) __PYX_ERR(0, 483, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_contains") < 0)) __PYX_ERR(0, 487, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -19766,7 +19917,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 483, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 487, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19798,7 +19949,7 @@ static PyObject *__pyx_pf_10collisions_7NoShape_6_contains(CYTHON_UNUSED PyObjec __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_contains", 1); - /* "collisions.py":484 + /* "collisions.py":488 * * def _contains(self, othershape: 'Shape') -> bool: * return False # <<<<<<<<<<<<<< @@ -19810,7 +19961,7 @@ static PyObject *__pyx_pf_10collisions_7NoShape_6_contains(CYTHON_UNUSED PyObjec __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":483 + /* "collisions.py":487 * return [] * * def _contains(self, othershape: 'Shape') -> bool: # <<<<<<<<<<<<<< @@ -19825,7 +19976,7 @@ static PyObject *__pyx_pf_10collisions_7NoShape_6_contains(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "collisions.py":486 +/* "collisions.py":490 * return False * * def area(self) -> Number: # <<<<<<<<<<<<<< @@ -19887,12 +20038,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 490, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "area") < 0)) __PYX_ERR(0, 486, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "area") < 0)) __PYX_ERR(0, 490, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -19903,7 +20054,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 486, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 490, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -19935,7 +20086,7 @@ static PyObject *__pyx_pf_10collisions_7NoShape_8area(CYTHON_UNUSED PyObject *__ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("area", 1); - /* "collisions.py":493 + /* "collisions.py":497 * Number: The area of the shape * """ * return 0 # <<<<<<<<<<<<<< @@ -19947,7 +20098,7 @@ static PyObject *__pyx_pf_10collisions_7NoShape_8area(CYTHON_UNUSED PyObject *__ __pyx_r = __pyx_int_0; goto __pyx_L0; - /* "collisions.py":486 + /* "collisions.py":490 * return False * * def area(self) -> Number: # <<<<<<<<<<<<<< @@ -19962,7 +20113,7 @@ static PyObject *__pyx_pf_10collisions_7NoShape_8area(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* "collisions.py":495 +/* "collisions.py":499 * return 0 * * def copy(self) -> 'NoShape': # <<<<<<<<<<<<<< @@ -20007,179 +20158,6 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 495, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(0, 495, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_self = values[0]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("copy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 495, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("collisions.NoShape.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_7NoShape_10copy(__pyx_self, __pyx_v_self); - - /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10collisions_7NoShape_10copy(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - unsigned int __pyx_t_4; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("copy", 1); - - /* "collisions.py":497 - * def copy(self) -> 'NoShape': - * """Make a copy of this non-existant shape""" - * return NoShape() # <<<<<<<<<<<<<< - * - * def __str__(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NoShape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 497, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (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); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __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; - - /* "collisions.py":495 - * return 0 - * - * def copy(self) -> 'NoShape': # <<<<<<<<<<<<<< - * """Make a copy of this non-existant shape""" - * return NoShape() - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("collisions.NoShape.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "collisions.py":499 - * return NoShape() - * - * def __str__(self): # <<<<<<<<<<<<<< - * return '' - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_7NoShape_13__str__(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_7NoShape_13__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_7NoShape_13__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_7NoShape_13__str__(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - CYTHON_UNUSED PyObject *__pyx_v_self = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { @@ -20202,7 +20180,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 499, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(0, 499, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -20213,7 +20191,180 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 499, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("copy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 499, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("collisions.NoShape.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_7NoShape_10copy(__pyx_self, __pyx_v_self); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10collisions_7NoShape_10copy(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + unsigned int __pyx_t_4; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("copy", 1); + + /* "collisions.py":501 + * def copy(self) -> 'NoShape': + * """Make a copy of this non-existant shape""" + * return NoShape() # <<<<<<<<<<<<<< + * + * def __str__(self): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NoShape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (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); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __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; + + /* "collisions.py":499 + * return 0 + * + * def copy(self) -> 'NoShape': # <<<<<<<<<<<<<< + * """Make a copy of this non-existant shape""" + * return NoShape() + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("collisions.NoShape.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":503 + * return NoShape() + * + * def __str__(self): # <<<<<<<<<<<<<< + * return '' + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_7NoShape_13__str__(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_10collisions_7NoShape_13__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_7NoShape_13__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_7NoShape_13__str__(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + CYTHON_UNUSED PyObject *__pyx_v_self = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 503, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 503, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_self = values[0]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 503, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -20245,7 +20396,7 @@ static PyObject *__pyx_pf_10collisions_7NoShape_12__str__(CYTHON_UNUSED PyObject __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__", 1); - /* "collisions.py":500 + /* "collisions.py":504 * * def __str__(self): * return '' # <<<<<<<<<<<<<< @@ -20257,7 +20408,7 @@ static PyObject *__pyx_pf_10collisions_7NoShape_12__str__(CYTHON_UNUSED PyObject __pyx_r = __pyx_kp_u_NoShape_2; goto __pyx_L0; - /* "collisions.py":499 + /* "collisions.py":503 * return NoShape() * * def __str__(self): # <<<<<<<<<<<<<< @@ -20272,14 +20423,54 @@ static PyObject *__pyx_pf_10collisions_7NoShape_12__str__(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":506 +/* "collisions.py":510 * GROUPS = {ShpGroups.GROUP} * TYPE = ShpTyps.Group - * def __init__(self, *shapes: Shape): # <<<<<<<<<<<<<< + * def __init__(self, *shapes: Shape, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< * """ * Args: */ +static PyObject *__pyx_pf_10collisions_26__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __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("__defaults__", 1); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_bounciness, __pyx_t_2) < 0) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 510, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("collisions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* Python wrapper */ static PyObject *__pyx_pw_10collisions_6Shapes_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -20288,7 +20479,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_6Shapes___init__, "\n Args:\n *shapes (Shape): The shapes to start off with in this object.\n \n Example:\n `Shapes(Shape1, Shape2)` OR `Shapes(*[Shape1, Shape2])`\n "); +PyDoc_STRVAR(__pyx_doc_10collisions_6Shapes___init__, "\n Args:\n *shapes (Shape): The shapes to start off with in this object.\n bounciness (float, optional): How bouncy this object is. 1 = rebounds perfectly, <1 = eventually will stop, >1 = will bounce more each time. Defaults to 0.7.\n \n Example:\n `Shapes(Shape1, Shape2)` OR `Shapes(*[Shape1, Shape2])`\n "); static PyMethodDef __pyx_mdef_10collisions_6Shapes_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Shapes___init__}; static PyObject *__pyx_pw_10collisions_6Shapes_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -20298,12 +20489,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; + double __pyx_v_bounciness; PyObject *__pyx_v_shapes = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; + PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -20325,7 +20517,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } __Pyx_GOTREF(__pyx_v_shapes); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_bounciness,0}; + __pyx_defaults4 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -20341,13 +20534,19 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 506, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 510, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } + if (kw_args == 1) { + const Py_ssize_t index = 1; + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); + if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 510, __pyx_L3_error) + } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; const Py_ssize_t used_pos_args = (kwd_pos_args < 1) ? kwd_pos_args : 1; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 506, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 510, __pyx_L3_error) } } else if (unlikely(__pyx_nargs < 1)) { goto __pyx_L5_argtuple_error; @@ -20355,10 +20554,15 @@ PyObject *__pyx_args, PyObject *__pyx_kwds values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; + if (values[1]) { + __pyx_v_bounciness = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_bounciness == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 510, __pyx_L3_error) + } else { + __pyx_v_bounciness = __pyx_dynamic_args->__pyx_arg_bounciness; + } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, __pyx_nargs); __PYX_ERR(0, 506, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, __pyx_nargs); __PYX_ERR(0, 510, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -20373,7 +20577,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Shapes___init__(__pyx_self, __pyx_v_self, __pyx_v_shapes); + __pyx_r = __pyx_pf_10collisions_6Shapes___init__(__pyx_self, __pyx_v_self, __pyx_v_bounciness, __pyx_v_shapes); /* function exit code */ __Pyx_DECREF(__pyx_v_shapes); @@ -20387,7 +20591,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Shapes___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_shapes) { +static PyObject *__pyx_pf_10collisions_6Shapes___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, double __pyx_v_bounciness, PyObject *__pyx_v_shapes) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -20396,22 +20600,34 @@ static PyObject *__pyx_pf_10collisions_6Shapes___init__(CYTHON_UNUSED PyObject * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); - /* "collisions.py":514 + /* "collisions.py":519 * `Shapes(Shape1, Shape2)` OR `Shapes(*[Shape1, Shape2])` * """ + * self.bounciness = bounciness # <<<<<<<<<<<<<< + * self.shapes = list(shapes) + * + */ + __pyx_t_1 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bounciness, __pyx_t_1) < 0) __PYX_ERR(0, 519, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "collisions.py":520 + * """ + * self.bounciness = bounciness * self.shapes = list(shapes) # <<<<<<<<<<<<<< * * def add_shape(self, shape: Shape) -> None: */ - __pyx_t_1 = PySequence_List(__pyx_v_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) + __pyx_t_1 = PySequence_List(__pyx_v_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shapes, __pyx_t_1) < 0) __PYX_ERR(0, 514, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_shapes, __pyx_t_1) < 0) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":506 + /* "collisions.py":510 * GROUPS = {ShpGroups.GROUP} * TYPE = ShpTyps.Group - * def __init__(self, *shapes: Shape): # <<<<<<<<<<<<<< + * def __init__(self, *shapes: Shape, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< * """ * Args: */ @@ -20429,7 +20645,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes___init__(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "collisions.py":516 +/* "collisions.py":522 * self.shapes = list(shapes) * * def add_shape(self, shape: Shape) -> None: # <<<<<<<<<<<<<< @@ -20494,7 +20710,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 522, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -20502,14 +20718,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 516, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 522, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("add_shape", 1, 2, 2, 1); __PYX_ERR(0, 516, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_shape", 1, 2, 2, 1); __PYX_ERR(0, 522, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "add_shape") < 0)) __PYX_ERR(0, 516, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "add_shape") < 0)) __PYX_ERR(0, 522, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -20522,7 +20738,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("add_shape", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 516, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_shape", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 522, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -20559,19 +20775,19 @@ static PyObject *__pyx_pf_10collisions_6Shapes_2add_shape(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_shape", 1); - /* "collisions.py":523 + /* "collisions.py":529 * shape (Shape): The desired shape to add. * """ * self.shapes.append(shape) # <<<<<<<<<<<<<< * * def add_shapes(self, *shapes: Shape) -> None: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_shape); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 523, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_shape); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":516 + /* "collisions.py":522 * self.shapes = list(shapes) * * def add_shape(self, shape: Shape) -> None: # <<<<<<<<<<<<<< @@ -20592,7 +20808,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_2add_shape(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":525 +/* "collisions.py":531 * self.shapes.append(shape) * * def add_shapes(self, *shapes: Shape) -> None: # <<<<<<<<<<<<<< @@ -20661,13 +20877,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 525, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 531, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; const Py_ssize_t used_pos_args = (kwd_pos_args < 1) ? kwd_pos_args : 1; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, used_pos_args, "add_shapes") < 0)) __PYX_ERR(0, 525, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, used_pos_args, "add_shapes") < 0)) __PYX_ERR(0, 531, __pyx_L3_error) } } else if (unlikely(__pyx_nargs < 1)) { goto __pyx_L5_argtuple_error; @@ -20678,7 +20894,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("add_shapes", 0, 1, 1, __pyx_nargs); __PYX_ERR(0, 525, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("add_shapes", 0, 1, 1, __pyx_nargs); __PYX_ERR(0, 531, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -20720,19 +20936,19 @@ static PyObject *__pyx_pf_10collisions_6Shapes_4add_shapes(CYTHON_UNUSED PyObjec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("add_shapes", 1); - /* "collisions.py":535 + /* "collisions.py":541 * `shapes.add_shapes(Shape1, Shape2)` OR `shapes.add_shapes(*[Shape1, Shape2])` * """ * self.shapes.extend(list(shapes)) # <<<<<<<<<<<<<< * * def remove_shape(self, shape: Shape) -> None: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_extend); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_extend); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PySequence_List(__pyx_v_shapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error) + __pyx_t_2 = PySequence_List(__pyx_v_shapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -20753,13 +20969,13 @@ static PyObject *__pyx_pf_10collisions_6Shapes_4add_shapes(CYTHON_UNUSED PyObjec __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 535, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":525 + /* "collisions.py":531 * self.shapes.append(shape) * * def add_shapes(self, *shapes: Shape) -> None: # <<<<<<<<<<<<<< @@ -20783,7 +20999,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_4add_shapes(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "collisions.py":537 +/* "collisions.py":543 * self.shapes.extend(list(shapes)) * * def remove_shape(self, shape: Shape) -> None: # <<<<<<<<<<<<<< @@ -20848,7 +21064,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 537, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 543, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -20856,14 +21072,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 537, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 543, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("remove_shape", 1, 2, 2, 1); __PYX_ERR(0, 537, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remove_shape", 1, 2, 2, 1); __PYX_ERR(0, 543, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "remove_shape") < 0)) __PYX_ERR(0, 537, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "remove_shape") < 0)) __PYX_ERR(0, 543, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -20876,7 +21092,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("remove_shape", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 537, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remove_shape", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 543, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -20915,16 +21131,16 @@ static PyObject *__pyx_pf_10collisions_6Shapes_6remove_shape(CYTHON_UNUSED PyObj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("remove_shape", 1); - /* "collisions.py":544 + /* "collisions.py":550 * shape (Shape): The shape to remove. * """ * self.shapes.remove(shape) # <<<<<<<<<<<<<< * * def remove_shapes(self, *shapes: Shape) -> None: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 544, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -20945,13 +21161,13 @@ static PyObject *__pyx_pf_10collisions_6Shapes_6remove_shape(CYTHON_UNUSED PyObj PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_shape}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":537 + /* "collisions.py":543 * self.shapes.extend(list(shapes)) * * def remove_shape(self, shape: Shape) -> None: # <<<<<<<<<<<<<< @@ -20974,7 +21190,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_6remove_shape(CYTHON_UNUSED PyObj return __pyx_r; } -/* "collisions.py":546 +/* "collisions.py":552 * self.shapes.remove(shape) * * def remove_shapes(self, *shapes: Shape) -> None: # <<<<<<<<<<<<<< @@ -21043,13 +21259,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 546, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 552, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; const Py_ssize_t used_pos_args = (kwd_pos_args < 1) ? kwd_pos_args : 1; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, used_pos_args, "remove_shapes") < 0)) __PYX_ERR(0, 546, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, used_pos_args, "remove_shapes") < 0)) __PYX_ERR(0, 552, __pyx_L3_error) } } else if (unlikely(__pyx_nargs < 1)) { goto __pyx_L5_argtuple_error; @@ -21060,7 +21276,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("remove_shapes", 0, 1, 1, __pyx_nargs); __PYX_ERR(0, 546, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("remove_shapes", 0, 1, 1, __pyx_nargs); __PYX_ERR(0, 552, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -21104,7 +21320,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_8remove_shapes(CYTHON_UNUSED PyOb int __pyx_clineno = 0; __Pyx_RefNannySetupContext("remove_shapes", 1); - /* "collisions.py":556 + /* "collisions.py":562 * `shapes.remove_shapes(Shape1, Shape2)` OR `shapes.remove_shapes(*[Shape1, Shape2])` * """ * for s in shapes: # <<<<<<<<<<<<<< @@ -21117,29 +21333,29 @@ static PyObject *__pyx_pf_10collisions_6Shapes_8remove_shapes(CYTHON_UNUSED PyOb { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 556, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 562, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 556, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 562, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 556, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":557 + /* "collisions.py":563 * """ * for s in shapes: * self.shapes.remove(s) # <<<<<<<<<<<<<< * * def collides(self, shapes: Union[Shape,'Shapes',Iterable[Shape]]) -> bool: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 557, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_remove); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 557, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_remove); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -21160,13 +21376,13 @@ static PyObject *__pyx_pf_10collisions_6Shapes_8remove_shapes(CYTHON_UNUSED PyOb PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_s}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":556 + /* "collisions.py":562 * `shapes.remove_shapes(Shape1, Shape2)` OR `shapes.remove_shapes(*[Shape1, Shape2])` * """ * for s in shapes: # <<<<<<<<<<<<<< @@ -21176,7 +21392,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_8remove_shapes(CYTHON_UNUSED PyOb } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":546 + /* "collisions.py":552 * self.shapes.remove(shape) * * def remove_shapes(self, *shapes: Shape) -> None: # <<<<<<<<<<<<<< @@ -21201,7 +21417,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_8remove_shapes(CYTHON_UNUSED PyOb return __pyx_r; } -/* "collisions.py":559 +/* "collisions.py":565 * self.shapes.remove(s) * * def collides(self, shapes: Union[Shape,'Shapes',Iterable[Shape]]) -> bool: # <<<<<<<<<<<<<< @@ -21266,7 +21482,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 559, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 565, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -21274,14 +21490,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 559, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 565, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("collides", 1, 2, 2, 1); __PYX_ERR(0, 559, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("collides", 1, 2, 2, 1); __PYX_ERR(0, 565, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "collides") < 0)) __PYX_ERR(0, 559, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "collides") < 0)) __PYX_ERR(0, 565, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -21294,7 +21510,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 559, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 565, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -21338,23 +21554,23 @@ static PyObject *__pyx_pf_10collisions_6Shapes_10collides(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("collides", 1); - /* "collisions.py":569 + /* "collisions.py":575 * bool: True if *any* of the shapes in this object collide with *any* of the input shapes * """ * for s in self.shapes: # <<<<<<<<<<<<<< * if s.collides(shapes): * return True */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 575, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -21363,28 +21579,28 @@ static PyObject *__pyx_pf_10collisions_6Shapes_10collides(CYTHON_UNUSED PyObject { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 569, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 575, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 575, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 569, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 575, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 575, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -21394,7 +21610,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_10collides(CYTHON_UNUSED PyObject PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 569, __pyx_L1_error) + else __PYX_ERR(0, 575, __pyx_L1_error) } break; } @@ -21403,14 +21619,14 @@ static PyObject *__pyx_pf_10collisions_6Shapes_10collides(CYTHON_UNUSED PyObject __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":570 + /* "collisions.py":576 * """ * for s in self.shapes: * if s.collides(shapes): # <<<<<<<<<<<<<< * return True * return False */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -21430,15 +21646,15 @@ static PyObject *__pyx_pf_10collisions_6Shapes_10collides(CYTHON_UNUSED PyObject PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_shapes}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_8) { - /* "collisions.py":571 + /* "collisions.py":577 * for s in self.shapes: * if s.collides(shapes): * return True # <<<<<<<<<<<<<< @@ -21451,7 +21667,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_10collides(CYTHON_UNUSED PyObject __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":570 + /* "collisions.py":576 * """ * for s in self.shapes: * if s.collides(shapes): # <<<<<<<<<<<<<< @@ -21460,7 +21676,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_10collides(CYTHON_UNUSED PyObject */ } - /* "collisions.py":569 + /* "collisions.py":575 * bool: True if *any* of the shapes in this object collide with *any* of the input shapes * """ * for s in self.shapes: # <<<<<<<<<<<<<< @@ -21470,7 +21686,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_10collides(CYTHON_UNUSED PyObject } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":572 + /* "collisions.py":578 * if s.collides(shapes): * return True * return False # <<<<<<<<<<<<<< @@ -21482,7 +21698,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_10collides(CYTHON_UNUSED PyObject __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":559 + /* "collisions.py":565 * self.shapes.remove(s) * * def collides(self, shapes: Union[Shape,'Shapes',Iterable[Shape]]) -> bool: # <<<<<<<<<<<<<< @@ -21505,7 +21721,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_10collides(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":574 +/* "collisions.py":580 * return False * * def whereCollides(self, shapes: Union[Shape,'Shapes',Iterable[Shape]]) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -21570,7 +21786,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 574, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -21578,14 +21794,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 574, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("whereCollides", 1, 2, 2, 1); __PYX_ERR(0, 574, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("whereCollides", 1, 2, 2, 1); __PYX_ERR(0, 580, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "whereCollides") < 0)) __PYX_ERR(0, 574, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "whereCollides") < 0)) __PYX_ERR(0, 580, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -21598,7 +21814,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("whereCollides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 574, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("whereCollides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 580, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -21643,35 +21859,35 @@ static PyObject *__pyx_pf_10collisions_6Shapes_12whereCollides(CYTHON_UNUSED PyO int __pyx_clineno = 0; __Pyx_RefNannySetupContext("whereCollides", 1); - /* "collisions.py":584 + /* "collisions.py":590 * Iterable[pointLike]: _description_ * """ * points = [] # <<<<<<<<<<<<<< * for s in self.shapes: * points.extend(s.whereCollides(shapes)) */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_points = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":585 + /* "collisions.py":591 * """ * points = [] * for s in self.shapes: # <<<<<<<<<<<<<< * points.extend(s.whereCollides(shapes)) * return points */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 591, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -21680,28 +21896,28 @@ static PyObject *__pyx_pf_10collisions_6Shapes_12whereCollides(CYTHON_UNUSED PyO { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 585, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 591, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 591, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 585, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 591, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 591, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -21711,7 +21927,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_12whereCollides(CYTHON_UNUSED PyO PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 585, __pyx_L1_error) + else __PYX_ERR(0, 591, __pyx_L1_error) } break; } @@ -21720,14 +21936,14 @@ static PyObject *__pyx_pf_10collisions_6Shapes_12whereCollides(CYTHON_UNUSED PyO __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":586 + /* "collisions.py":592 * points = [] * for s in self.shapes: * points.extend(s.whereCollides(shapes)) # <<<<<<<<<<<<<< * return points * */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -21747,14 +21963,14 @@ static PyObject *__pyx_pf_10collisions_6Shapes_12whereCollides(CYTHON_UNUSED PyO PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_shapes}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_8 = __Pyx_PyList_Extend(__pyx_v_points, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyList_Extend(__pyx_v_points, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":585 + /* "collisions.py":591 * """ * points = [] * for s in self.shapes: # <<<<<<<<<<<<<< @@ -21764,7 +21980,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_12whereCollides(CYTHON_UNUSED PyO } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":587 + /* "collisions.py":593 * for s in self.shapes: * points.extend(s.whereCollides(shapes)) * return points # <<<<<<<<<<<<<< @@ -21776,7 +21992,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_12whereCollides(CYTHON_UNUSED PyO __pyx_r = __pyx_v_points; goto __pyx_L0; - /* "collisions.py":574 + /* "collisions.py":580 * return False * * def whereCollides(self, shapes: Union[Shape,'Shapes',Iterable[Shape]]) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -21800,12 +22016,12 @@ static PyObject *__pyx_pf_10collisions_6Shapes_12whereCollides(CYTHON_UNUSED PyO return __pyx_r; } -/* "collisions.py":589 +/* "collisions.py":595 * return points * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ - * Finds the closest point ON all of these objects TO the input shape. + * Finds the closest point ON ANY of these objects TO the input shape. */ /* Python wrapper */ @@ -21816,7 +22032,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_6Shapes_14closestPointTo, "\n Finds the closest point ON all of these objects TO the input shape.\n PLEASE NOTE that this won't have the list in order of closest to furthest, you have to do that yourself.\n\n Args:\n othershape (Shape): The shape to find the cosest points towards\n returnAll (bool, optional): Whether to return EVERY possible option, sorted from closest to furthest. Defaults to False.\n\n Returns:\n Iterable[pointLike]: All the closest point(s) ON each of these objects\n "); +PyDoc_STRVAR(__pyx_doc_10collisions_6Shapes_14closestPointTo, "\n Finds the closest point ON ANY of these objects TO the input shape.\n\n Args:\n othershape (Shape): The shape to find the closest points towards\n returnAll (bool, optional): Whether to return EVERY possible option, sorted from closest to furthest. Defaults to False.\n\n Returns:\n Iterable[pointLike]: All the closest point(s) ON each of these objects\n "); static PyMethodDef __pyx_mdef_10collisions_6Shapes_15closestPointTo = {"closestPointTo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_15closestPointTo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Shapes_14closestPointTo}; static PyObject *__pyx_pw_10collisions_6Shapes_15closestPointTo(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL @@ -21869,7 +22085,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 589, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -21877,21 +22093,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 589, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, 1); __PYX_ERR(0, 589, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, 1); __PYX_ERR(0, 595, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_returnAll); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 589, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 595, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "closestPointTo") < 0)) __PYX_ERR(0, 589, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "closestPointTo") < 0)) __PYX_ERR(0, 595, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -21909,7 +22125,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 589, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 595, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -21936,277 +22152,42 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Shapes_14closestPointTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape, PyObject *__pyx_v_returnAll) { - PyObject *__pyx_v_points = NULL; - PyObject *__pyx_v_s = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - PyObject *(*__pyx_t_4)(PyObject *); - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - unsigned int __pyx_t_8; - int __pyx_t_9; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("closestPointTo", 1); - - /* "collisions.py":601 - * Iterable[pointLike]: All the closest point(s) ON each of these objects - * """ - * points = [] # <<<<<<<<<<<<<< - * for s in self.shapes: - * if returnAll: - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 601, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_points = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - - /* "collisions.py":602 - * """ - * points = [] - * for s in self.shapes: # <<<<<<<<<<<<<< - * if returnAll: - * points.extend(s.closestPointTo(othershape, True)) - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = 0; - __pyx_t_4 = NULL; - } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 602, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_4)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 602, __pyx_L1_error) - #endif - if (__pyx_t_3 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 602, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 602, __pyx_L1_error) - #endif - if (__pyx_t_3 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 602, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_4(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 602, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_1); - __pyx_t_1 = 0; - - /* "collisions.py":603 - * points = [] - * for s in self.shapes: - * if returnAll: # <<<<<<<<<<<<<< - * points.extend(s.closestPointTo(othershape, True)) - * else: - */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 603, __pyx_L1_error) - if (__pyx_t_5) { - - /* "collisions.py":604 - * for s in self.shapes: - * if returnAll: - * points.extend(s.closestPointTo(othershape, True)) # <<<<<<<<<<<<<< - * else: - * points.append(s.closestPointTo(othershape, False)) - */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 604, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = NULL; - __pyx_t_8 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_8 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_othershape, Py_True}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_points, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 604, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "collisions.py":603 - * points = [] - * for s in self.shapes: - * if returnAll: # <<<<<<<<<<<<<< - * points.extend(s.closestPointTo(othershape, True)) - * else: - */ - goto __pyx_L5; - } - - /* "collisions.py":606 - * points.extend(s.closestPointTo(othershape, True)) - * else: - * points.append(s.closestPointTo(othershape, False)) # <<<<<<<<<<<<<< - * return points - * - */ - /*else*/ { - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 606, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = NULL; - __pyx_t_8 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_8 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_othershape, Py_False}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 606, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_points, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 606, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_L5:; - - /* "collisions.py":602 - * """ - * points = [] - * for s in self.shapes: # <<<<<<<<<<<<<< - * if returnAll: +/* "collisions.py":610 + * for s in self.shapes: * points.extend(s.closestPointTo(othershape, True)) - */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "collisions.py":607 - * else: - * points.append(s.closestPointTo(othershape, False)) - * return points # <<<<<<<<<<<<<< - * - * def isContaining(self, othershape: Union[Shape,'Shapes',Iterable[Shape]]) -> bool: - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_points); - __pyx_r = __pyx_v_points; - goto __pyx_L0; - - /* "collisions.py":589 - * return points - * - * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * """ - * Finds the closest point ON all of these objects TO the input shape. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("collisions.Shapes.closestPointTo", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_points); - __Pyx_XDECREF(__pyx_v_s); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "collisions.py":609 - * return points - * - * def isContaining(self, othershape: Union[Shape,'Shapes',Iterable[Shape]]) -> bool: # <<<<<<<<<<<<<< - * """ - * Finds whether this shape fully encloses `othershape`; if `whereCollides` returns `[]` but `collides` returns True. But more optimised than that. + * def sortFunc(p): # <<<<<<<<<<<<<< + * op = othershape.closestPointTo(Point(*p), False) + * return math.hypot(p[0]-op[0], p[1]-op[1]) */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Shapes_17isContaining(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Shapes_14closestPointTo_1sortFunc(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_6Shapes_16isContaining, "\n Finds whether this shape fully encloses `othershape`; if `whereCollides` returns `[]` but `collides` returns True. But more optimised than that.\n\n Args:\n othershape (Shape / Shapes / Iterable[Shape]): The shape to check if it is fully enclosed within this shape.\n\n Returns:\n bool: Whether the shape is fully enclosed within this shape.\n "); -static PyMethodDef __pyx_mdef_10collisions_6Shapes_17isContaining = {"isContaining", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_17isContaining, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Shapes_16isContaining}; -static PyObject *__pyx_pw_10collisions_6Shapes_17isContaining(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_6Shapes_14closestPointTo_1sortFunc = {"sortFunc", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_14closestPointTo_1sortFunc, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_6Shapes_14closestPointTo_1sortFunc(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_othershape = 0; + PyObject *__pyx_v_p = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[2] = {0,0}; + PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("isContaining (wrapper)", 0); + __Pyx_RefNannySetupContext("sortFunc (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -22216,12 +22197,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_othershape,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; @@ -22230,39 +22209,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 609, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 610, __pyx_L3_error) else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_othershape)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 609, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("isContaining", 1, 2, 2, 1); __PYX_ERR(0, 609, __pyx_L3_error) - } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isContaining") < 0)) __PYX_ERR(0, 609, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "sortFunc") < 0)) __PYX_ERR(0, 610, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 2)) { + } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } - __pyx_v_self = values[0]; - __pyx_v_othershape = values[1]; + __pyx_v_p = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("isContaining", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 609, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("sortFunc", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 610, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -22272,11 +22239,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Shapes.isContaining", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Shapes.closestPointTo.sortFunc", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Shapes_16isContaining(__pyx_self, __pyx_v_self, __pyx_v_othershape); + __pyx_r = __pyx_pf_10collisions_6Shapes_14closestPointTo_sortFunc(__pyx_self, __pyx_v_p); /* function exit code */ { @@ -22289,559 +22256,720 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Shapes_16isContaining(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { - PyObject *__pyx_v_s = NULL; +static PyObject *__pyx_pf_10collisions_6Shapes_14closestPointTo_sortFunc(PyObject *__pyx_self, PyObject *__pyx_v_p) { + struct __pyx_obj_10collisions___pyx_scope_struct__closestPointTo *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct__closestPointTo *__pyx_outer_scope; + PyObject *__pyx_v_op = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - unsigned int __pyx_t_7; - int __pyx_t_8; + unsigned int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("isContaining", 1); + __Pyx_RefNannySetupContext("sortFunc", 1); + __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct__closestPointTo *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; - /* "collisions.py":619 - * bool: Whether the shape is fully enclosed within this shape. - * """ - * for s in self.shapes: # <<<<<<<<<<<<<< - * if s.isContaining(othershape): - * return True + /* "collisions.py":611 + * points.extend(s.closestPointTo(othershape, True)) + * def sortFunc(p): + * op = othershape.closestPointTo(Point(*p), False) # <<<<<<<<<<<<<< + * return math.hypot(p[0]-op[0], p[1]-op[1]) + * return sorted(points, key=sortFunc) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 619, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = 0; - __pyx_t_4 = NULL; - } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 619, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 619, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_othershape)) { __Pyx_RaiseClosureNameError("othershape"); __PYX_ERR(0, 611, __pyx_L1_error) } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_p); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(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_6 = 1; + } } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_4)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 619, __pyx_L1_error) - #endif - if (__pyx_t_3 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 619, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 619, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 619, __pyx_L1_error) - #endif - if (__pyx_t_3 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 619, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 619, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } - } else { - __pyx_t_1 = __pyx_t_4(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 619, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_1); - __pyx_t_1 = 0; - - /* "collisions.py":620 - * """ - * for s in self.shapes: - * if s.isContaining(othershape): # <<<<<<<<<<<<<< - * return True - * return False - */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_isContaining); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(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); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_othershape}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 620, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_8) { - - /* "collisions.py":621 - * for s in self.shapes: - * if s.isContaining(othershape): - * return True # <<<<<<<<<<<<<< - * return False - * - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - goto __pyx_L0; - - /* "collisions.py":620 - * """ - * for s in self.shapes: - * if s.isContaining(othershape): # <<<<<<<<<<<<<< - * return True - * return False - */ - } - - /* "collisions.py":619 - * bool: Whether the shape is fully enclosed within this shape. - * """ - * for s in self.shapes: # <<<<<<<<<<<<<< - * if s.isContaining(othershape): - * return True - */ + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_5, Py_False}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_op = __pyx_t_1; + __pyx_t_1 = 0; - /* "collisions.py":622 - * if s.isContaining(othershape): - * return True - * return False # <<<<<<<<<<<<<< - * - * # TODO: Pick one method: either the dict or the list, not both (see below 2 funcs) + /* "collisions.py":612 + * def sortFunc(p): + * op = othershape.closestPointTo(Point(*p), False) + * return math.hypot(p[0]-op[0], p[1]-op[1]) # <<<<<<<<<<<<<< + * return sorted(points, key=sortFunc) + * else: */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_hypot); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_op, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_op, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyNumber_Subtract(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_5, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_3, __pyx_t_7}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":609 - * return points - * - * def isContaining(self, othershape: Union[Shape,'Shapes',Iterable[Shape]]) -> bool: # <<<<<<<<<<<<<< - * """ - * Finds whether this shape fully encloses `othershape`; if `whereCollides` returns `[]` but `collides` returns True. But more optimised than that. + /* "collisions.py":610 + * for s in self.shapes: + * points.extend(s.closestPointTo(othershape, True)) + * def sortFunc(p): # <<<<<<<<<<<<<< + * op = othershape.closestPointTo(Point(*p), False) + * return math.hypot(p[0]-op[0], p[1]-op[1]) */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("collisions.Shapes.isContaining", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("collisions.Shapes.closestPointTo.sortFunc", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_s); + __Pyx_XDECREF(__pyx_v_op); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":626 - * # TODO: Pick one method: either the dict or the list, not both (see below 2 funcs) +/* "collisions.py":595 + * return points * - * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> Dict[Union[Shape,'Shapes'], bool]: # <<<<<<<<<<<<<< + * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ - * Takes each object and finds whether the input point is on the corner of that object. + * Finds the closest point ON ANY of these objects TO the input shape. */ -static PyObject *__pyx_pf_10collisions_26__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { - PyObject *__pyx_r = NULL; - __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("__defaults__", 1); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_precision); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 626, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 626, __pyx_L1_error); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 626, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("collisions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Shapes_19isCorner(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_6Shapes_18isCorner, "\n Takes each object and finds whether the input point is on the corner of that object.\n\n Args:\n point (pointLike): The point to find if it's on the corner or not\n precision (Number, optional): The decimal places to round to to check. Defaults to 5.\n\n Returns:\n dict[Shape / Shapes: bool]: A dictionary of each object in this and whether the point is a corner on it or not.\n "); -static PyMethodDef __pyx_mdef_10collisions_6Shapes_19isCorner = {"isCorner", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_19isCorner, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Shapes_18isCorner}; -static PyObject *__pyx_pw_10collisions_6Shapes_19isCorner(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_point = 0; - PyObject *__pyx_v_precision = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[3] = {0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("isCorner (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_point,&__pyx_n_s_precision,0}; - __pyx_defaults4 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_self); - values[2] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_precision); - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 626, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 626, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, 1); __PYX_ERR(0, 626, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_precision); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 626, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isCorner") < 0)) __PYX_ERR(0, 626, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_self = values[0]; - __pyx_v_point = values[1]; - __pyx_v_precision = values[2]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 626, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("collisions.Shapes.isCorner", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Shapes_18isCorner(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_precision); - - /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10collisions_6Shapes_18isCorner(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_precision) { - PyObject *__pyx_v_cs = NULL; +static PyObject *__pyx_pf_10collisions_6Shapes_14closestPointTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape, PyObject *__pyx_v_returnAll) { + struct __pyx_obj_10collisions___pyx_scope_struct__closestPointTo *__pyx_cur_scope; + PyObject *__pyx_v_points = NULL; PyObject *__pyx_v_s = NULL; + PyObject *__pyx_v_sortFunc = 0; + PyObject *__pyx_v_point = NULL; + PyObject *__pyx_v_d = NULL; + PyObject *__pyx_v_np = NULL; + PyObject *__pyx_v_op = NULL; + PyObject *__pyx_v_nd = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; + int __pyx_t_1; PyObject *__pyx_t_2 = NULL; - Py_ssize_t __pyx_t_3; - PyObject *(*__pyx_t_4)(PyObject *); - PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); PyObject *__pyx_t_6 = NULL; - unsigned int __pyx_t_7; + PyObject *__pyx_t_7 = NULL; + unsigned int __pyx_t_8; + int __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + int __pyx_t_13; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("isCorner", 1); + __Pyx_RefNannySetupContext("closestPointTo", 0); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct__closestPointTo *)__pyx_tp_new_10collisions___pyx_scope_struct__closestPointTo(__pyx_ptype_10collisions___pyx_scope_struct__closestPointTo, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct__closestPointTo *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 595, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_v_othershape = __pyx_v_othershape; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_othershape); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_othershape); - /* "collisions.py":637 - * dict[Shape / Shapes: bool]: A dictionary of each object in this and whether the point is a corner on it or not. + /* "collisions.py":606 + * Iterable[pointLike]: All the closest point(s) ON each of these objects * """ - * cs = {} # <<<<<<<<<<<<<< - * for s in self.shapes: - * cs[s] = s.isCorner(point, precision) + * if returnAll: # <<<<<<<<<<<<<< + * points = [] + * for s in self.shapes: */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 637, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_cs = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 606, __pyx_L1_error) + if (__pyx_t_1) { - /* "collisions.py":638 + /* "collisions.py":607 * """ - * cs = {} - * for s in self.shapes: # <<<<<<<<<<<<<< - * cs[s] = s.isCorner(point, precision) - * return cs + * if returnAll: + * points = [] # <<<<<<<<<<<<<< + * for s in self.shapes: + * points.extend(s.closestPointTo(othershape, True)) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { - __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = 0; - __pyx_t_4 = NULL; - } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 607, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 638, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - for (;;) { - if (likely(!__pyx_t_4)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 638, __pyx_L1_error) + __pyx_v_points = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + + /* "collisions.py":608 + * if returnAll: + * points = [] + * for s in self.shapes: # <<<<<<<<<<<<<< + * points.extend(s.closestPointTo(othershape, True)) + * def sortFunc(p): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 608, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 608, __pyx_L1_error) + #endif + if (__pyx_t_4 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 608, __pyx_L1_error) + #else + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 608, __pyx_L1_error) + #endif + if (__pyx_t_4 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 608, __pyx_L1_error) + #else + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); #endif - if (__pyx_t_3 >= __pyx_temp) break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 638, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 638, __pyx_L1_error) - #endif - if (__pyx_t_3 >= __pyx_temp) break; + __pyx_t_2 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 608, __pyx_L1_error) + } + break; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 638, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif + __Pyx_GOTREF(__pyx_t_2); } - } else { - __pyx_t_1 = __pyx_t_4(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 638, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_2); + __pyx_t_2 = 0; + + /* "collisions.py":609 + * points = [] + * for s in self.shapes: + * points.extend(s.closestPointTo(othershape, True)) # <<<<<<<<<<<<<< + * def sortFunc(p): + * op = othershape.closestPointTo(Point(*p), False) + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_8 = 1; } - break; } - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_1); - __pyx_t_1 = 0; + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_cur_scope->__pyx_v_othershape, Py_True}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_points, __pyx_t_2); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 609, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":639 - * cs = {} - * for s in self.shapes: - * cs[s] = s.isCorner(point, precision) # <<<<<<<<<<<<<< - * return cs - * + /* "collisions.py":608 + * if returnAll: + * points = [] + * for s in self.shapes: # <<<<<<<<<<<<<< + * points.extend(s.closestPointTo(othershape, True)) + * def sortFunc(p): */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_isCorner); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(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); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_point, __pyx_v_precision}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 639, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - if (unlikely((PyDict_SetItem(__pyx_v_cs, __pyx_v_s, __pyx_t_1) < 0))) __PYX_ERR(0, 639, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":638 - * """ - * cs = {} - * for s in self.shapes: # <<<<<<<<<<<<<< - * cs[s] = s.isCorner(point, precision) - * return cs + /* "collisions.py":610 + * for s in self.shapes: + * points.extend(s.closestPointTo(othershape, True)) + * def sortFunc(p): # <<<<<<<<<<<<<< + * op = othershape.closestPointTo(Point(*p), False) + * return math.hypot(p[0]-op[0], p[1]-op[1]) */ - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_14closestPointTo_1sortFunc, 0, __pyx_n_s_Shapes_closestPointTo_locals_sor, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 610, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_sortFunc = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":640 - * for s in self.shapes: - * cs[s] = s.isCorner(point, precision) - * return cs # <<<<<<<<<<<<<< - * - * def tangent(self, point: pointLike, vel: pointLike) -> Iterable[Number]: + /* "collisions.py":613 + * op = othershape.closestPointTo(Point(*p), False) + * return math.hypot(p[0]-op[0], p[1]-op[1]) + * return sorted(points, key=sortFunc) # <<<<<<<<<<<<<< + * else: + * point = None */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_cs); - __pyx_r = __pyx_v_cs; - goto __pyx_L0; - - /* "collisions.py":626 - * # TODO: Pick one method: either the dict or the list, not both (see below 2 funcs) - * - * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> Dict[Union[Shape,'Shapes'], bool]: # <<<<<<<<<<<<<< - * """ - * Takes each object and finds whether the input point is on the corner of that object. + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_points); + __Pyx_GIVEREF(__pyx_v_points); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_points)) __PYX_ERR(0, 613, __pyx_L1_error); + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_v_sortFunc) < 0) __PYX_ERR(0, 613, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 613, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "collisions.py":606 + * Iterable[pointLike]: All the closest point(s) ON each of these objects + * """ + * if returnAll: # <<<<<<<<<<<<<< + * points = [] + * for s in self.shapes: + */ + } + + /* "collisions.py":615 + * return sorted(points, key=sortFunc) + * else: + * point = None # <<<<<<<<<<<<<< + * d = None + * for s in self.shapes: + */ + /*else*/ { + __Pyx_INCREF(Py_None); + __pyx_v_point = Py_None; + + /* "collisions.py":616 + * else: + * point = None + * d = None # <<<<<<<<<<<<<< + * for s in self.shapes: + * np = s.closestPointTo(othershape, False) + */ + __Pyx_INCREF(Py_None); + __pyx_v_d = Py_None; + + /* "collisions.py":617 + * point = None + * d = None + * for s in self.shapes: # <<<<<<<<<<<<<< + * np = s.closestPointTo(othershape, False) + * op = othershape.closestPointTo(Point(*np), False) + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) { + __pyx_t_2 = __pyx_t_6; __Pyx_INCREF(__pyx_t_2); + __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 617, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 617, __pyx_L1_error) + #endif + if (__pyx_t_4 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 617, __pyx_L1_error) + #else + __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 617, __pyx_L1_error) + #endif + if (__pyx_t_4 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 617, __pyx_L1_error) + #else + __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_5(__pyx_t_2); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 617, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_6); + __pyx_t_6 = 0; + + /* "collisions.py":618 + * d = None + * for s in self.shapes: + * np = s.closestPointTo(othershape, False) # <<<<<<<<<<<<<< + * op = othershape.closestPointTo(Point(*np), False) + * nd = math.hypot(np[0]-op[0], np[1]-op[1]) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 618, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_8 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_cur_scope->__pyx_v_othershape, Py_False}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 618, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_np, __pyx_t_6); + __pyx_t_6 = 0; + + /* "collisions.py":619 + * for s in self.shapes: + * np = s.closestPointTo(othershape, False) + * op = othershape.closestPointTo(Point(*np), False) # <<<<<<<<<<<<<< + * nd = math.hypot(np[0]-op[0], np[1]-op[1]) + * if d is None or nd < d: + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_10 = __Pyx_PySequence_Tuple(__pyx_v_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = NULL; + __pyx_t_8 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_8 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_t_11, Py_False}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 619, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_op, __pyx_t_6); + __pyx_t_6 = 0; + + /* "collisions.py":620 + * np = s.closestPointTo(othershape, False) + * op = othershape.closestPointTo(Point(*np), False) + * nd = math.hypot(np[0]-op[0], np[1]-op[1]) # <<<<<<<<<<<<<< + * if d is None or nd < d: + * d = nd + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_hypot); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_np, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_op, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = PyNumber_Subtract(__pyx_t_3, __pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_np, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_op, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = PyNumber_Subtract(__pyx_t_10, __pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + __pyx_t_8 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_11); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_11, function); + __pyx_t_8 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_7, __pyx_t_12}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 620, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_nd, __pyx_t_6); + __pyx_t_6 = 0; + + /* "collisions.py":621 + * op = othershape.closestPointTo(Point(*np), False) + * nd = math.hypot(np[0]-op[0], np[1]-op[1]) + * if d is None or nd < d: # <<<<<<<<<<<<<< + * d = nd + * point = np + */ + __pyx_t_13 = (__pyx_v_d == Py_None); + if (!__pyx_t_13) { + } else { + __pyx_t_1 = __pyx_t_13; + goto __pyx_L10_bool_binop_done; + } + __pyx_t_6 = PyObject_RichCompare(__pyx_v_nd, __pyx_v_d, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 621, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 621, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_1 = __pyx_t_13; + __pyx_L10_bool_binop_done:; + if (__pyx_t_1) { + + /* "collisions.py":622 + * nd = math.hypot(np[0]-op[0], np[1]-op[1]) + * if d is None or nd < d: + * d = nd # <<<<<<<<<<<<<< + * point = np + * return point + */ + __Pyx_INCREF(__pyx_v_nd); + __Pyx_DECREF_SET(__pyx_v_d, __pyx_v_nd); + + /* "collisions.py":623 + * if d is None or nd < d: + * d = nd + * point = np # <<<<<<<<<<<<<< + * return point + * + */ + __Pyx_INCREF(__pyx_v_np); + __Pyx_DECREF_SET(__pyx_v_point, __pyx_v_np); + + /* "collisions.py":621 + * op = othershape.closestPointTo(Point(*np), False) + * nd = math.hypot(np[0]-op[0], np[1]-op[1]) + * if d is None or nd < d: # <<<<<<<<<<<<<< + * d = nd + * point = np + */ + } + + /* "collisions.py":617 + * point = None + * d = None + * for s in self.shapes: # <<<<<<<<<<<<<< + * np = s.closestPointTo(othershape, False) + * op = othershape.closestPointTo(Point(*np), False) + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "collisions.py":624 + * d = nd + * point = np + * return point # <<<<<<<<<<<<<< + * + * def isContaining(self, othershape: Union[Shape,'Shapes',Iterable[Shape]]) -> bool: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_point); + __pyx_r = __pyx_v_point; + goto __pyx_L0; + } + + /* "collisions.py":595 + * return points + * + * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Iterable[pointLike]: # <<<<<<<<<<<<<< + * """ + * Finds the closest point ON ANY of these objects TO the input shape. */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("collisions.Shapes.isCorner", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("collisions.Shapes.closestPointTo", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_cs); + __Pyx_XDECREF(__pyx_v_points); __Pyx_XDECREF(__pyx_v_s); + __Pyx_XDECREF(__pyx_v_sortFunc); + __Pyx_XDECREF(__pyx_v_point); + __Pyx_XDECREF(__pyx_v_d); + __Pyx_XDECREF(__pyx_v_np); + __Pyx_XDECREF(__pyx_v_op); + __Pyx_XDECREF(__pyx_v_nd); + __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":642 - * return cs +/* "collisions.py":626 + * return point * - * def tangent(self, point: pointLike, vel: pointLike) -> Iterable[Number]: # <<<<<<<<<<<<<< + * def isContaining(self, othershape: Union[Shape,'Shapes',Iterable[Shape]]) -> bool: # <<<<<<<<<<<<<< * """ - * Finds the tangent on each of these objects for the specified point. -90 = normal. + * Finds whether this shape fully encloses `othershape`; if `whereCollides` returns `[]` but `collides` returns True. But more optimised than that. */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Shapes_21tangent(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Shapes_17isContaining(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_6Shapes_20tangent, "\n Finds the tangent on each of these objects for the specified point. -90 = normal.\n\n Args:\n point (pointLike): The point to find the tangent from\n vel (pointLike): Which direction the point is moving (useful for example with lines for finding which side of the line the tangent should be of)\n\n Returns:\n Iterable[Number]: A list of all the tangents to the specified point.\n "); -static PyMethodDef __pyx_mdef_10collisions_6Shapes_21tangent = {"tangent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_21tangent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Shapes_20tangent}; -static PyObject *__pyx_pw_10collisions_6Shapes_21tangent(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_6Shapes_16isContaining, "\n Finds whether this shape fully encloses `othershape`; if `whereCollides` returns `[]` but `collides` returns True. But more optimised than that.\n\n Args:\n othershape (Shape / Shapes / Iterable[Shape]): The shape to check if it is fully enclosed within this shape.\n\n Returns:\n bool: Whether the shape is fully enclosed within this shape.\n "); +static PyMethodDef __pyx_mdef_10collisions_6Shapes_17isContaining = {"isContaining", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_17isContaining, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Shapes_16isContaining}; +static PyObject *__pyx_pw_10collisions_6Shapes_17isContaining(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -22849,19 +22977,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_point = 0; - PyObject *__pyx_v_vel = 0; + PyObject *__pyx_v_othershape = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[3] = {0,0,0}; + PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("tangent (wrapper)", 0); + __Pyx_RefNannySetupContext("isContaining (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -22871,12 +22998,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_point,&__pyx_n_s_vel,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_othershape,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); @@ -22891,47 +23016,35 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 642, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 626, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_othershape)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 642, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 1); __PYX_ERR(0, 642, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vel)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 642, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 626, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 2); __PYX_ERR(0, 642, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("isContaining", 1, 2, 2, 1); __PYX_ERR(0, 626, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tangent") < 0)) __PYX_ERR(0, 642, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isContaining") < 0)) __PYX_ERR(0, 626, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 3)) { + } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_self = values[0]; - __pyx_v_point = values[1]; - __pyx_v_vel = values[2]; + __pyx_v_othershape = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 642, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("isContaining", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 626, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -22941,11 +23054,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Shapes.tangent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Shapes.isContaining", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Shapes_20tangent(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_vel); + __pyx_r = __pyx_pf_10collisions_6Shapes_16isContaining(__pyx_self, __pyx_v_self, __pyx_v_othershape); /* function exit code */ { @@ -22958,8 +23071,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Shapes_20tangent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_vel) { - PyObject *__pyx_v_points = NULL; +static PyObject *__pyx_pf_10collisions_6Shapes_16isContaining(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { PyObject *__pyx_v_s = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -22974,37 +23086,25 @@ static PyObject *__pyx_pf_10collisions_6Shapes_20tangent(CYTHON_UNUSED PyObject int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("tangent", 1); - - /* "collisions.py":653 - * Iterable[Number]: A list of all the tangents to the specified point. - * """ - * points = [] # <<<<<<<<<<<<<< - * for s in self.shapes: - * points.append(s.tangent(point, vel)) - */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 653, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_points = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + __Pyx_RefNannySetupContext("isContaining", 1); - /* "collisions.py":654 + /* "collisions.py":636 + * bool: Whether the shape is fully enclosed within this shape. * """ - * points = [] * for s in self.shapes: # <<<<<<<<<<<<<< - * points.append(s.tangent(point, vel)) - * return points + * if s.isContaining(othershape): + * return True */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 636, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -23013,28 +23113,28 @@ static PyObject *__pyx_pf_10collisions_6Shapes_20tangent(CYTHON_UNUSED PyObject { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 636, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 636, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 654, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 636, __pyx_L1_error) #endif if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 636, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 654, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -23044,7 +23144,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_20tangent(CYTHON_UNUSED PyObject PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 654, __pyx_L1_error) + else __PYX_ERR(0, 636, __pyx_L1_error) } break; } @@ -23053,14 +23153,14 @@ static PyObject *__pyx_pf_10collisions_6Shapes_20tangent(CYTHON_UNUSED PyObject __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":655 - * points = [] + /* "collisions.py":637 + * """ * for s in self.shapes: - * points.append(s.tangent(point, vel)) # <<<<<<<<<<<<<< - * return points - * + * if s.isContaining(othershape): # <<<<<<<<<<<<<< + * return True + * return False */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_tangent); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 655, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_isContaining); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -23077,44 +23177,67 @@ static PyObject *__pyx_pf_10collisions_6Shapes_20tangent(CYTHON_UNUSED PyObject } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_point, __pyx_v_vel}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_othershape}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 655, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_points, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 655, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 637, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_8) { + + /* "collisions.py":638 + * for s in self.shapes: + * if s.isContaining(othershape): + * return True # <<<<<<<<<<<<<< + * return False + * + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L0; - /* "collisions.py":654 + /* "collisions.py":637 + * """ + * for s in self.shapes: + * if s.isContaining(othershape): # <<<<<<<<<<<<<< + * return True + * return False + */ + } + + /* "collisions.py":636 + * bool: Whether the shape is fully enclosed within this shape. * """ - * points = [] * for s in self.shapes: # <<<<<<<<<<<<<< - * points.append(s.tangent(point, vel)) - * return points + * if s.isContaining(othershape): + * return True */ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":656 - * for s in self.shapes: - * points.append(s.tangent(point, vel)) - * return points # <<<<<<<<<<<<<< + /* "collisions.py":639 + * if s.isContaining(othershape): + * return True + * return False # <<<<<<<<<<<<<< * - * # TODO: handleCollisions + * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_points); - __pyx_r = __pyx_v_points; + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":642 - * return cs + /* "collisions.py":626 + * return point * - * def tangent(self, point: pointLike, vel: pointLike) -> Iterable[Number]: # <<<<<<<<<<<<<< + * def isContaining(self, othershape: Union[Shape,'Shapes',Iterable[Shape]]) -> bool: # <<<<<<<<<<<<<< * """ - * Finds the tangent on each of these objects for the specified point. -90 = normal. + * Finds whether this shape fully encloses `othershape`; if `whereCollides` returns `[]` but `collides` returns True. But more optimised than that. */ /* function exit code */ @@ -23123,35 +23246,73 @@ static PyObject *__pyx_pf_10collisions_6Shapes_20tangent(CYTHON_UNUSED PyObject __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("collisions.Shapes.tangent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Shapes.isContaining", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_points); __Pyx_XDECREF(__pyx_v_s); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":662 - * # TODO: to_points and to_lines +/* "collisions.py":641 + * return False * - * def area(self) -> Number: # <<<<<<<<<<<<<< + * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< * """ - * Gets the combined area of all the shapes. + * Finds if the point is a corner on any of the objects. */ +static PyObject *__pyx_pf_10collisions_28__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __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("__defaults__", 1); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 641, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_precision); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_precision); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 641, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 641, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 641, __pyx_L1_error); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 641, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("collisions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Shapes_23area(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Shapes_19isCorner(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_6Shapes_22area, "\n Gets the combined area of all the shapes.\n\n Returns:\n Number: The sum of all the areas of the shapes.\n "); -static PyMethodDef __pyx_mdef_10collisions_6Shapes_23area = {"area", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_23area, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Shapes_22area}; -static PyObject *__pyx_pw_10collisions_6Shapes_23area(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_6Shapes_18isCorner, "\n Finds if the point is a corner on any of the objects.\n\n Args:\n point (pointLike): The point to find if it's on the corner or not\n precision (Number, optional): The decimal places to round to to check. Defaults to 5.\n\n Returns:\n bool: Whether the point is on a corner of any of the objects.\n "); +static PyMethodDef __pyx_mdef_10collisions_6Shapes_19isCorner = {"isCorner", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_19isCorner, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Shapes_18isCorner}; +static PyObject *__pyx_pw_10collisions_6Shapes_19isCorner(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -23159,17 +23320,19 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_point = 0; + PyObject *__pyx_v_precision = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; + PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("area (wrapper)", 0); + __Pyx_RefNannySetupContext("isCorner (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -23179,10 +23342,16 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_point,&__pyx_n_s_precision,0}; + __pyx_defaults5 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self); + values[2] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_precision); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; @@ -23195,23 +23364,47 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 662, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 641, __pyx_L3_error) else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 641, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, 1); __PYX_ERR(0, 641, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_precision); + if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 641, __pyx_L3_error) + } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "area") < 0)) __PYX_ERR(0, 662, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isCorner") < 0)) __PYX_ERR(0, 641, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } } __pyx_v_self = values[0]; + __pyx_v_point = values[1]; + __pyx_v_precision = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 662, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 641, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -23221,11 +23414,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Shapes.area", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Shapes.isCorner", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Shapes_22area(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_6Shapes_18isCorner(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_precision); /* function exit code */ { @@ -23237,135 +23430,97 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10collisions_6Shapes_4area_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - -/* "collisions.py":669 - * Number: The sum of all the areas of the shapes. - * """ - * return sum(s.area() for s in self.shapes) # <<<<<<<<<<<<<< - * - * def rect(self) -> Iterable[Number]: - */ -static PyObject *__pyx_pf_10collisions_6Shapes_4area_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10collisions___pyx_scope_struct__genexpr *__pyx_cur_scope; +static PyObject *__pyx_pf_10collisions_6Shapes_18isCorner(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_precision) { + PyObject *__pyx_v_s = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct__genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct__genexpr(__pyx_ptype_10collisions___pyx_scope_struct__genexpr, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct__genexpr *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 669, __pyx_L1_error) - } else { - __Pyx_GOTREF((PyObject *)__pyx_cur_scope); - } - __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; - __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); - { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_6Shapes_4area_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Shapes_area_locals_genexpr, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 669, __pyx_L1_error) - __Pyx_DECREF(__pyx_cur_scope); - __Pyx_RefNannyFinishContext(); - return (PyObject *) gen; - } - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("collisions.Shapes.area.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_DECREF((PyObject *)__pyx_cur_scope); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_gb_10collisions_6Shapes_4area_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ -{ - struct __pyx_obj_10collisions___pyx_scope_struct__genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct__genexpr *)__pyx_generator->closure); - PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *(*__pyx_t_3)(PyObject *); - PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; unsigned int __pyx_t_7; + int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("genexpr", 0); - switch (__pyx_generator->resume_label) { - case 0: goto __pyx_L3_first_run; - case 1: goto __pyx_L6_resume_from_yield; - default: /* CPython raises the right error here */ - __Pyx_RefNannyFinishContext(); - return NULL; - } - __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 669, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 669, __pyx_L1_error) } - if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { - __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = 0; - __pyx_t_3 = NULL; + __Pyx_RefNannySetupContext("isCorner", 1); + + /* "collisions.py":652 + * bool: Whether the point is on a corner of any of the objects. + * """ + * for s in self.shapes: # <<<<<<<<<<<<<< + * if s.isCorner(point, precision): + * return True + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; + __pyx_t_4 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 669, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 652, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 652, __pyx_L1_error) } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - if (likely(!__pyx_t_3)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 669, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 652, __pyx_L1_error) #endif - if (__pyx_t_2 >= __pyx_temp) break; + if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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_ERR(0, 669, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 652, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); #endif } else { { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 669, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 652, __pyx_L1_error) #endif - if (__pyx_t_2 >= __pyx_temp) break; + if (__pyx_t_3 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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_ERR(0, 669, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 652, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 652, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); #endif } } else { - __pyx_t_4 = __pyx_t_3(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { + __pyx_t_1 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 669, __pyx_L1_error) + else __PYX_ERR(0, 652, __pyx_L1_error) } break; } - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GOTREF(__pyx_t_1); } - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_s, __pyx_n_s_area); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 669, __pyx_L1_error) + __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_1); + __pyx_t_1 = 0; + + /* "collisions.py":653 + * """ + * for s in self.shapes: + * if s.isCorner(point, precision): # <<<<<<<<<<<<<< + * return True + * return False + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_isCorner); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -23382,136 +23537,103 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4area_2generator(__pyx_CoroutineO } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); + PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_point, __pyx_v_precision}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - __Pyx_XGIVEREF(__pyx_t_1); - __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; - __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; - __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - __Pyx_Coroutine_ResetAndClearException(__pyx_generator); - /* return from generator, yielding value */ - __pyx_generator->resume_label = 1; - return __pyx_r; - __pyx_L6_resume_from_yield:; - __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; - __pyx_cur_scope->__pyx_t_0 = 0; - __Pyx_XGOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; - __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 669, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - - /* function exit code */ - PyErr_SetNone(PyExc_StopIteration); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_L0:; - __Pyx_XDECREF(__pyx_r); __pyx_r = 0; - #if !CYTHON_USE_EXC_INFO_STACK - __Pyx_Coroutine_ResetAndClearException(__pyx_generator); - #endif - __pyx_generator->resume_label = -1; - __Pyx_Coroutine_clear((PyObject*)__pyx_generator); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 653, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_8) { -/* "collisions.py":662 - * # TODO: to_points and to_lines + /* "collisions.py":654 + * for s in self.shapes: + * if s.isCorner(point, precision): + * return True # <<<<<<<<<<<<<< + * return False * - * def area(self) -> Number: # <<<<<<<<<<<<<< - * """ - * Gets the combined area of all the shapes. */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L0; -static PyObject *__pyx_pf_10collisions_6Shapes_22area(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_gb_10collisions_6Shapes_4area_2generator = 0; - PyObject *__pyx_r = NULL; - __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("area", 1); + /* "collisions.py":653 + * """ + * for s in self.shapes: + * if s.isCorner(point, precision): # <<<<<<<<<<<<<< + * return True + * return False + */ + } - /* "collisions.py":669 - * Number: The sum of all the areas of the shapes. + /* "collisions.py":652 + * bool: Whether the point is on a corner of any of the objects. * """ - * return sum(s.area() for s in self.shapes) # <<<<<<<<<<<<<< + * for s in self.shapes: # <<<<<<<<<<<<<< + * if s.isCorner(point, precision): + * return True + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "collisions.py":655 + * if s.isCorner(point, precision): + * return True + * return False # <<<<<<<<<<<<<< * - * def rect(self) -> Iterable[Number]: + * def tangent(self, point: pointLike, vel: pointLike) -> Iterable[Number]: # TODO: Make it return just one number */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_pf_10collisions_6Shapes_4area_genexpr(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 669, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __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; + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":662 - * # TODO: to_points and to_lines + /* "collisions.py":641 + * return False * - * def area(self) -> Number: # <<<<<<<<<<<<<< + * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< * """ - * Gets the combined area of all the shapes. + * Finds if the point is a corner on any of the objects. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("collisions.Shapes.area", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("collisions.Shapes.isCorner", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_gb_10collisions_6Shapes_4area_2generator); + __Pyx_XDECREF(__pyx_v_s); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":671 - * return sum(s.area() for s in self.shapes) +/* "collisions.py":657 + * return False * - * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< + * def tangent(self, point: pointLike, vel: pointLike) -> Iterable[Number]: # TODO: Make it return just one number # <<<<<<<<<<<<<< * """ - * Returns the rectangle bounding box surrounding every one of these objects. + * Finds the tangent on each of these objects for the specified point. -90 = normal. */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Shapes_25rect(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Shapes_21tangent(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_6Shapes_24rect, "\n Returns the rectangle bounding box surrounding every one of these objects.\n\n Returns:\n Iterable[Number]: (min x, min y, max x, max y)\n "); -static PyMethodDef __pyx_mdef_10collisions_6Shapes_25rect = {"rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_25rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Shapes_24rect}; -static PyObject *__pyx_pw_10collisions_6Shapes_25rect(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_6Shapes_20tangent, "\n Finds the tangent on each of these objects for the specified point. -90 = normal.\n\n Args:\n point (pointLike): The point to find the tangent from.\n vel (pointLike): Which direction the point is moving (useful for example with lines for finding which side of the line the tangent should be of)\n\n Returns:\n Iterable[Number]: A list of all the tangents to the specified point.\n "); +static PyMethodDef __pyx_mdef_10collisions_6Shapes_21tangent = {"tangent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_21tangent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Shapes_20tangent}; +static PyObject *__pyx_pw_10collisions_6Shapes_21tangent(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -23519,17 +23641,19 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_point = 0; + PyObject *__pyx_v_vel = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; + PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("rect (wrapper)", 0); + __Pyx_RefNannySetupContext("tangent (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -23539,10 +23663,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_point,&__pyx_n_s_vel,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; @@ -23555,23 +23683,47 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 671, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 657, __pyx_L3_error) else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 657, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 1); __PYX_ERR(0, 657, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vel)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 657, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 2); __PYX_ERR(0, 657, __pyx_L3_error) + } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rect") < 0)) __PYX_ERR(0, 671, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tangent") < 0)) __PYX_ERR(0, 657, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 1)) { + } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_self = values[0]; + __pyx_v_point = values[1]; + __pyx_v_vel = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 671, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 657, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -23581,11 +23733,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Shapes.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Shapes.tangent", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Shapes_24rect(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_6Shapes_20tangent(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_vel); /* function exit code */ { @@ -23597,271 +23749,869 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10collisions_6Shapes_4rect_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - -/* "collisions.py":679 - * """ - * rs = [s.rect() for s in self.shapes] - * return min(i[0] for i in rs), min(i[1] for i in rs), max(i[2] for i in rs), max(i[3] for i in rs) # <<<<<<<<<<<<<< - * - * def copy(self) -> 'Shapes': - */ -static PyObject *__pyx_pf_10collisions_6Shapes_4rect_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr *__pyx_cur_scope; +static PyObject *__pyx_pf_10collisions_6Shapes_20tangent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_vel) { + PyObject *__pyx_v_points = NULL; + PyObject *__pyx_v_s = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + unsigned int __pyx_t_7; + int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_1_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 679, __pyx_L1_error) + __Pyx_RefNannySetupContext("tangent", 1); + + /* "collisions.py":668 + * Iterable[Number]: A list of all the tangents to the specified point. + * """ + * points = [] # <<<<<<<<<<<<<< + * for s in self.shapes: + * points.append(s.tangent(point, vel)) + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_points = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "collisions.py":669 + * """ + * points = [] + * for s in self.shapes: # <<<<<<<<<<<<<< + * points.append(s.tangent(point, vel)) + * return points + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; + __pyx_t_4 = NULL; } else { - __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 669, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 669, __pyx_L1_error) } - __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; - __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); - { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_6Shapes_4rect_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Shapes_rect_locals_genexpr, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 679, __pyx_L1_error) - __Pyx_DECREF(__pyx_cur_scope); - __Pyx_RefNannyFinishContext(); - return (PyObject *) gen; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 669, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 669, __pyx_L1_error) + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 669, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 669, __pyx_L1_error) + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 669, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_1); + __pyx_t_1 = 0; + + /* "collisions.py":670 + * points = [] + * for s in self.shapes: + * points.append(s.tangent(point, vel)) # <<<<<<<<<<<<<< + * return points + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_tangent); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 670, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(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); + __pyx_t_7 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_point, __pyx_v_vel}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_points, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 670, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "collisions.py":669 + * """ + * points = [] + * for s in self.shapes: # <<<<<<<<<<<<<< + * points.append(s.tangent(point, vel)) + * return points + */ } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "collisions.py":671 + * for s in self.shapes: + * points.append(s.tangent(point, vel)) + * return points # <<<<<<<<<<<<<< + * + * # TODO: handleCollisions + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_points); + __pyx_r = __pyx_v_points; + goto __pyx_L0; + + /* "collisions.py":657 + * return False + * + * def tangent(self, point: pointLike, vel: pointLike) -> Iterable[Number]: # TODO: Make it return just one number # <<<<<<<<<<<<<< + * """ + * Finds the tangent on each of these objects for the specified point. -90 = normal. + */ /* function exit code */ __pyx_L1_error:; - __Pyx_AddTraceback("collisions.Shapes.rect.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("collisions.Shapes.tangent", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_points); + __Pyx_XDECREF(__pyx_v_s); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10collisions_6Shapes_4rect_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ -{ - struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr *)__pyx_generator->closure); - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *__pyx_t_3 = NULL; +/* "collisions.py":675 + * # TODO: handleCollisions + * + * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< + * """ + * Returns: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_6Shapes_23toPoints(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_10collisions_6Shapes_22toPoints, "\n Returns:\n Iterable[pointLike]: Get a list of all the Points that make up this object. For a few shapes (e.g. circles), this will be empty.\n "); +static PyMethodDef __pyx_mdef_10collisions_6Shapes_23toPoints = {"toPoints", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_23toPoints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Shapes_22toPoints}; +static PyObject *__pyx_pw_10collisions_6Shapes_23toPoints(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; + PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("genexpr", 0); - switch (__pyx_generator->resume_label) { - case 0: goto __pyx_L3_first_run; - case 1: goto __pyx_L6_resume_from_yield; - default: /* CPython raises the right error here */ - __Pyx_RefNannyFinishContext(); - return NULL; + __Pyx_RefNannySetupContext("toPoints (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 675, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toPoints") < 0)) __PYX_ERR(0, 675, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_self = values[0]; } - __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 679, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 679, __pyx_L1_error) } - __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = 0; - for (;;) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 679, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("toPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 675, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 679, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - __Pyx_XGIVEREF(__pyx_t_1); - __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; - __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - __Pyx_Coroutine_ResetAndClearException(__pyx_generator); - /* return from generator, yielding value */ - __pyx_generator->resume_label = 1; - return __pyx_r; - __pyx_L6_resume_from_yield:; - __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; - __pyx_cur_scope->__pyx_t_0 = 0; - __Pyx_XGOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 679, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + __Pyx_AddTraceback("collisions.Shapes.toPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_6Shapes_22toPoints(__pyx_self, __pyx_v_self); /* function exit code */ - PyErr_SetNone(PyExc_StopIteration); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_L0:; - __Pyx_XDECREF(__pyx_r); __pyx_r = 0; - #if !CYTHON_USE_EXC_INFO_STACK - __Pyx_Coroutine_ResetAndClearException(__pyx_generator); - #endif - __pyx_generator->resume_label = -1; - __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10collisions_6Shapes_4rect_5generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -static PyObject *__pyx_pf_10collisions_6Shapes_4rect_3genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr *__pyx_cur_scope; +static PyObject *__pyx_pf_10collisions_6Shapes_22toPoints(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_points = NULL; + PyObject *__pyx_v_s = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + unsigned int __pyx_t_7; + int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_2_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_2_genexpr, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 679, __pyx_L1_error) - } else { - __Pyx_GOTREF((PyObject *)__pyx_cur_scope); - } - __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; - __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); - { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_6Shapes_4rect_5generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Shapes_rect_locals_genexpr, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 679, __pyx_L1_error) - __Pyx_DECREF(__pyx_cur_scope); - __Pyx_RefNannyFinishContext(); - return (PyObject *) gen; - } + __Pyx_RefNannySetupContext("toPoints", 1); - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("collisions.Shapes.rect.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_DECREF((PyObject *)__pyx_cur_scope); + /* "collisions.py":680 + * Iterable[pointLike]: Get a list of all the Points that make up this object. For a few shapes (e.g. circles), this will be empty. + * """ + * points = [] # <<<<<<<<<<<<<< + * for s in self.shapes: + * points.extend(s.toPoints()) + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_points = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "collisions.py":681 + * """ + * points = [] + * for s in self.shapes: # <<<<<<<<<<<<<< + * points.extend(s.toPoints()) + * return points + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 681, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 681, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 681, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + for (;;) { + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 681, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 681, __pyx_L1_error) + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 681, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 681, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 681, __pyx_L1_error) + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 681, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 681, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_1); + __pyx_t_1 = 0; + + /* "collisions.py":682 + * points = [] + * for s in self.shapes: + * points.extend(s.toPoints()) # <<<<<<<<<<<<<< + * return points + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(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); + __pyx_t_7 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_8 = __Pyx_PyList_Extend(__pyx_v_points, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 682, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "collisions.py":681 + * """ + * points = [] + * for s in self.shapes: # <<<<<<<<<<<<<< + * points.extend(s.toPoints()) + * return points + */ + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "collisions.py":683 + * for s in self.shapes: + * points.extend(s.toPoints()) + * return points # <<<<<<<<<<<<<< + * + * def toLines(self) -> Iterable['Line']: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_points); + __pyx_r = __pyx_v_points; + goto __pyx_L0; + + /* "collisions.py":675 + * # TODO: handleCollisions + * + * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< + * """ + * Returns: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("collisions.Shapes.toPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_points); + __Pyx_XDECREF(__pyx_v_s); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10collisions_6Shapes_4rect_5generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ -{ - struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr *)__pyx_generator->closure); +/* "collisions.py":685 + * return points + * + * def toLines(self) -> Iterable['Line']: # <<<<<<<<<<<<<< + * """ + * Returns: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_6Shapes_25toLines(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_10collisions_6Shapes_24toLines, "\n Returns:\n Iterable[Line]: Get a list of all the Lines that make up this object. For anything under a ClosedShape, this will most likely be empty.\n "); +static PyMethodDef __pyx_mdef_10collisions_6Shapes_25toLines = {"toLines", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_25toLines, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Shapes_24toLines}; +static PyObject *__pyx_pw_10collisions_6Shapes_25toLines(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("toLines (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 685, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toLines") < 0)) __PYX_ERR(0, 685, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_self = values[0]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("toLines", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 685, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("collisions.Shapes.toLines", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_6Shapes_24toLines(__pyx_self, __pyx_v_self); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10collisions_6Shapes_24toLines(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_lines = NULL; + PyObject *__pyx_v_s = NULL; PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_2 = NULL; + Py_ssize_t __pyx_t_3; + PyObject *(*__pyx_t_4)(PyObject *); + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + unsigned int __pyx_t_7; + int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("genexpr", 0); - switch (__pyx_generator->resume_label) { - case 0: goto __pyx_L3_first_run; - case 1: goto __pyx_L6_resume_from_yield; - default: /* CPython raises the right error here */ - __Pyx_RefNannyFinishContext(); - return NULL; + __Pyx_RefNannySetupContext("toLines", 1); + + /* "collisions.py":690 + * Iterable[Line]: Get a list of all the Lines that make up this object. For anything under a ClosedShape, this will most likely be empty. + * """ + * lines = [] # <<<<<<<<<<<<<< + * for s in self.shapes: + * lines.extend(s.toLines()) + */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_lines = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "collisions.py":691 + * """ + * lines = [] + * for s in self.shapes: # <<<<<<<<<<<<<< + * lines.extend(s.toLines()) + * return lines + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { + __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = 0; + __pyx_t_4 = NULL; + } else { + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 691, __pyx_L1_error) } - __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 679, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 679, __pyx_L1_error) } - __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 679, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; + if (likely(!__pyx_t_4)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 691, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 691, __pyx_L1_error) + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 691, __pyx_L1_error) + #endif + if (__pyx_t_3 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 691, __pyx_L1_error) + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } + } else { + __pyx_t_1 = __pyx_t_4(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 691, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); + } + __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_1); + __pyx_t_1 = 0; + + /* "collisions.py":692 + * lines = [] + * for s in self.shapes: + * lines.extend(s.toLines()) # <<<<<<<<<<<<<< + * return lines + * + */ + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_toLines); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(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); + __pyx_t_7 = 1; + } } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 679, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); #endif - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - __Pyx_XGIVEREF(__pyx_t_1); - __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; - __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - __Pyx_Coroutine_ResetAndClearException(__pyx_generator); - /* return from generator, yielding value */ - __pyx_generator->resume_label = 1; - return __pyx_r; - __pyx_L6_resume_from_yield:; - __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; - __pyx_cur_scope->__pyx_t_0 = 0; - __Pyx_XGOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 679, __pyx_L1_error) + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_t_8 = __Pyx_PyList_Extend(__pyx_v_lines, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 692, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "collisions.py":691 + * """ + * lines = [] + * for s in self.shapes: # <<<<<<<<<<<<<< + * lines.extend(s.toLines()) + * return lines + */ } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* function exit code */ - PyErr_SetNone(PyExc_StopIteration); + /* "collisions.py":693 + * for s in self.shapes: + * lines.extend(s.toLines()) + * return lines # <<<<<<<<<<<<<< + * + * def area(self) -> Number: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_lines); + __pyx_r = __pyx_v_lines; goto __pyx_L0; + + /* "collisions.py":685 + * return points + * + * def toLines(self) -> Iterable['Line']: # <<<<<<<<<<<<<< + * """ + * Returns: + */ + + /* function exit code */ __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("collisions.Shapes.toLines", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_r); __pyx_r = 0; - #if !CYTHON_USE_EXC_INFO_STACK - __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + __Pyx_XDECREF(__pyx_v_lines); + __Pyx_XDECREF(__pyx_v_s); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":695 + * return lines + * + * def area(self) -> Number: # <<<<<<<<<<<<<< + * """ + * Gets the combined area of all the shapes. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_6Shapes_27area(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_10collisions_6Shapes_26area, "\n Gets the combined area of all the shapes.\n\n Returns:\n Number: The sum of all the areas of the shapes.\n "); +static PyMethodDef __pyx_mdef_10collisions_6Shapes_27area = {"area", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_27area, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Shapes_26area}; +static PyObject *__pyx_pw_10collisions_6Shapes_27area(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif - __pyx_generator->resume_label = -1; - __Pyx_Coroutine_clear((PyObject*)__pyx_generator); + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("area (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 695, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "area") < 0)) __PYX_ERR(0, 695, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_self = values[0]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 695, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("collisions.Shapes.area", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_6Shapes_26area(__pyx_self, __pyx_v_self); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10collisions_6Shapes_4rect_8generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_10collisions_6Shapes_4area_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -static PyObject *__pyx_pf_10collisions_6Shapes_4rect_6genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr *__pyx_cur_scope; +/* "collisions.py":702 + * Number: The sum of all the areas of the shapes. + * """ + * return sum(s.area() for s in self.shapes) # <<<<<<<<<<<<<< + * + * def rect(self) -> Iterable[Number]: + */ + +static PyObject *__pyx_pf_10collisions_6Shapes_4area_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_3_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_1_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 679, __pyx_L1_error) + __PYX_ERR(0, 702, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -23869,7 +24619,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_4rect_6genexpr(CYTHON_UNUSED PyOb __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_6Shapes_4rect_8generator3, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Shapes_rect_locals_genexpr, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 679, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_6Shapes_4area_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Shapes_area_locals_genexpr, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -23877,7 +24627,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_4rect_6genexpr(CYTHON_UNUSED PyOb /* function exit code */ __pyx_L1_error:; - __Pyx_AddTraceback("collisions.Shapes.rect.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Shapes.area.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); @@ -23885,13 +24635,17 @@ static PyObject *__pyx_pf_10collisions_6Shapes_4rect_6genexpr(CYTHON_UNUSED PyOb return __pyx_r; } -static PyObject *__pyx_gb_10collisions_6Shapes_4rect_8generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_10collisions_6Shapes_4area_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; - PyObject *__pyx_t_3 = NULL; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -23905,156 +24659,94 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4rect_8generator3(__pyx_Coroutine return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 679, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 679, __pyx_L1_error) } - __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = 0; - for (;;) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 679, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 679, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_i, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - __Pyx_XGIVEREF(__pyx_t_1); - __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; - __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - __Pyx_Coroutine_ResetAndClearException(__pyx_generator); - /* return from generator, yielding value */ - __pyx_generator->resume_label = 1; - return __pyx_r; - __pyx_L6_resume_from_yield:; - __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; - __pyx_cur_scope->__pyx_t_0 = 0; - __Pyx_XGOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 679, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - - /* function exit code */ - PyErr_SetNone(PyExc_StopIteration); - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_Generator_Replace_StopIteration(0); - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_L0:; - __Pyx_XDECREF(__pyx_r); __pyx_r = 0; - #if !CYTHON_USE_EXC_INFO_STACK - __Pyx_Coroutine_ResetAndClearException(__pyx_generator); - #endif - __pyx_generator->resume_label = -1; - __Pyx_Coroutine_clear((PyObject*)__pyx_generator); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -static PyObject *__pyx_gb_10collisions_6Shapes_4rect_11generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ - -static PyObject *__pyx_pf_10collisions_6Shapes_4rect_9genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr *__pyx_cur_scope; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_4_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_4_genexpr, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 679, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 702, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 702, __pyx_L1_error) } + if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { + __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_3 = NULL; } else { - __Pyx_GOTREF((PyObject *)__pyx_cur_scope); - } - __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; - __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); - { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_6Shapes_4rect_11generator4, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Shapes_rect_locals_genexpr, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 679, __pyx_L1_error) - __Pyx_DECREF(__pyx_cur_scope); - __Pyx_RefNannyFinishContext(); - return (PyObject *) gen; - } - - /* function exit code */ - __pyx_L1_error:; - __Pyx_AddTraceback("collisions.Shapes.rect.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __Pyx_DECREF((PyObject *)__pyx_cur_scope); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_gb_10collisions_6Shapes_4rect_11generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ -{ - struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr *)__pyx_generator->closure); - PyObject *__pyx_r = NULL; - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("genexpr", 0); - switch (__pyx_generator->resume_label) { - case 0: goto __pyx_L3_first_run; - case 1: goto __pyx_L6_resume_from_yield; - default: /* CPython raises the right error here */ - __Pyx_RefNannyFinishContext(); - return NULL; + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 702, __pyx_L1_error) } - __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 679, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 679, __pyx_L1_error) } - __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = 0; for (;;) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 679, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 702, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __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_ERR(0, 702, __pyx_L1_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 702, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __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_ERR(0, 702, __pyx_L1_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 702, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_s, __pyx_n_s_area); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(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); + __pyx_t_7 = 1; + } } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 679, __pyx_L1_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); #endif - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_i, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 702, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + } + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; + __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); @@ -24066,7 +24758,8 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4rect_11generator4(__pyx_Coroutin __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 679, __pyx_L1_error) + __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 702, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -24077,7 +24770,9 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4rect_11generator4(__pyx_Coroutin __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; @@ -24090,235 +24785,85 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4rect_11generator4(__pyx_Coroutin return __pyx_r; } -/* "collisions.py":671 - * return sum(s.area() for s in self.shapes) +/* "collisions.py":695 + * return lines * - * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< + * def area(self) -> Number: # <<<<<<<<<<<<<< * """ - * Returns the rectangle bounding box surrounding every one of these objects. + * Gets the combined area of all the shapes. */ -static PyObject *__pyx_pf_10collisions_6Shapes_24rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_v_rs = NULL; - PyObject *__pyx_8genexpr7__pyx_v_s = NULL; - PyObject *__pyx_gb_10collisions_6Shapes_4rect_2generator1 = 0; - PyObject *__pyx_gb_10collisions_6Shapes_4rect_5generator2 = 0; - PyObject *__pyx_gb_10collisions_6Shapes_4rect_8generator3 = 0; - PyObject *__pyx_gb_10collisions_6Shapes_4rect_11generator4 = 0; +static PyObject *__pyx_pf_10collisions_6Shapes_26area(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_gb_10collisions_6Shapes_4area_2generator = 0; PyObject *__pyx_r = NULL; __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 *); - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("rect", 1); - - /* "collisions.py":678 - * Iterable[Number]: (min x, min y, max x, max y) - * """ - * rs = [s.rect() for s in self.shapes] # <<<<<<<<<<<<<< - * return min(i[0] for i in rs), min(i[1] for i in rs), max(i[2] for i in rs), max(i[3] for i in rs) - * - */ - { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 678, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 678, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_2); - if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { - __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); - __pyx_t_4 = 0; - __pyx_t_5 = NULL; - } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 678, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 678, __pyx_L5_error) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - for (;;) { - if (likely(!__pyx_t_5)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 678, __pyx_L5_error) - #endif - if (__pyx_t_4 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 678, __pyx_L5_error) - #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 678, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_2); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 678, __pyx_L5_error) - #endif - if (__pyx_t_4 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 678, __pyx_L5_error) - #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 678, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_2); - #endif - } - } else { - __pyx_t_2 = __pyx_t_5(__pyx_t_3); - if (unlikely(!__pyx_t_2)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 678, __pyx_L5_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_2); - } - __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_s, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr7__pyx_v_s, __pyx_n_s_rect); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 678, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = NULL; - __pyx_t_8 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_8 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 678, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 678, __pyx_L5_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_s); __pyx_8genexpr7__pyx_v_s = 0; - goto __pyx_L9_exit_scope; - __pyx_L5_error:; - __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_s); __pyx_8genexpr7__pyx_v_s = 0; - goto __pyx_L1_error; - __pyx_L9_exit_scope:; - } /* exit inner scope */ - __pyx_v_rs = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + __Pyx_RefNannySetupContext("area", 1); - /* "collisions.py":679 + /* "collisions.py":702 + * Number: The sum of all the areas of the shapes. * """ - * rs = [s.rect() for s in self.shapes] - * return min(i[0] for i in rs), min(i[1] for i in rs), max(i[2] for i in rs), max(i[3] for i in rs) # <<<<<<<<<<<<<< + * return sum(s.area() for s in self.shapes) # <<<<<<<<<<<<<< * - * def copy(self) -> 'Shapes': + * def rect(self) -> Iterable[Number]: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __pyx_pf_10collisions_6Shapes_4rect_genexpr(NULL, __pyx_v_rs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_pf_10collisions_6Shapes_4rect_3genexpr(NULL, __pyx_v_rs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 679, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 679, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_10collisions_6Shapes_4area_genexpr(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_pf_10collisions_6Shapes_4rect_6genexpr(NULL, __pyx_v_rs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_pf_10collisions_6Shapes_4rect_9genexpr(NULL, __pyx_v_rs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 679, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 702, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 679, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 679, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6)) __PYX_ERR(0, 679, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_7)) __PYX_ERR(0, 679, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_2 = 0; - __pyx_t_6 = 0; - __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":671 - * return sum(s.area() for s in self.shapes) + /* "collisions.py":695 + * return lines * - * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< + * def area(self) -> Number: # <<<<<<<<<<<<<< * """ - * Returns the rectangle bounding box surrounding every one of these objects. + * Gets the combined area of all the shapes. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_AddTraceback("collisions.Shapes.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Shapes.area", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_rs); - __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_s); - __Pyx_XDECREF(__pyx_gb_10collisions_6Shapes_4rect_2generator1); - __Pyx_XDECREF(__pyx_gb_10collisions_6Shapes_4rect_5generator2); - __Pyx_XDECREF(__pyx_gb_10collisions_6Shapes_4rect_8generator3); - __Pyx_XDECREF(__pyx_gb_10collisions_6Shapes_4rect_11generator4); + __Pyx_XDECREF(__pyx_gb_10collisions_6Shapes_4area_2generator); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":681 - * return min(i[0] for i in rs), min(i[1] for i in rs), max(i[2] for i in rs), max(i[3] for i in rs) +/* "collisions.py":704 + * return sum(s.area() for s in self.shapes) * - * def copy(self) -> 'Shapes': # <<<<<<<<<<<<<< + * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ - * Make a copy of this class with a copy of each shape in it. + * Returns the rectangle bounding box surrounding every one of these objects. */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Shapes_27copy(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Shapes_29rect(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_6Shapes_26copy, "\n Make a copy of this class with a copy of each shape in it.\n "); -static PyMethodDef __pyx_mdef_10collisions_6Shapes_27copy = {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_27copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Shapes_26copy}; -static PyObject *__pyx_pw_10collisions_6Shapes_27copy(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_6Shapes_28rect, "\n Returns the rectangle bounding box surrounding every one of these objects.\n\n Returns:\n Iterable[Number]: (min x, min y, max x, max y)\n "); +static PyMethodDef __pyx_mdef_10collisions_6Shapes_29rect = {"rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_29rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Shapes_28rect}; +static PyObject *__pyx_pw_10collisions_6Shapes_29rect(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -24336,7 +24881,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("copy (wrapper)", 0); + __Pyx_RefNannySetupContext("rect (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -24362,12 +24907,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 681, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 704, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(0, 681, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rect") < 0)) __PYX_ERR(0, 704, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -24378,7 +24923,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("copy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 681, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 704, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -24388,11 +24933,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Shapes.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Shapes.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Shapes_26copy(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_6Shapes_28rect(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -24404,29 +24949,29 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_gb_10collisions_6Shapes_4copy_2generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ +static PyObject *__pyx_gb_10collisions_6Shapes_4rect_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "collisions.py":685 - * Make a copy of this class with a copy of each shape in it. +/* "collisions.py":712 * """ - * return Shapes(s.copy() for s in self.shapes) # <<<<<<<<<<<<<< + * rs = [s.rect() for s in self.shapes] + * return min(i[0] for i in rs), min(i[1] for i in rs), max(i[2] for i in rs), max(i[3] for i in rs) # <<<<<<<<<<<<<< * - * def copy_leave_shapes(self) -> 'Shapes': + * def copy(self) -> 'Shapes': */ -static PyObject *__pyx_pf_10collisions_6Shapes_4copy_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr *__pyx_cur_scope; +static PyObject *__pyx_pf_10collisions_6Shapes_4rect_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_5_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_5_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_2_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_2_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 685, __pyx_L1_error) + __PYX_ERR(0, 712, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -24434,7 +24979,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_4copy_genexpr(CYTHON_UNUSED PyObj __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_6Shapes_4copy_2generator5, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Shapes_copy_locals_genexpr, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 685, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_6Shapes_4rect_2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Shapes_rect_locals_genexpr, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -24442,7 +24987,7 @@ static PyObject *__pyx_pf_10collisions_6Shapes_4copy_genexpr(CYTHON_UNUSED PyObj /* function exit code */ __pyx_L1_error:; - __Pyx_AddTraceback("collisions.Shapes.copy.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Shapes.rect.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); @@ -24450,17 +24995,13 @@ static PyObject *__pyx_pf_10collisions_6Shapes_4copy_genexpr(CYTHON_UNUSED PyObj return __pyx_r; } -static PyObject *__pyx_gb_10collisions_6Shapes_4copy_2generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +static PyObject *__pyx_gb_10collisions_6Shapes_4rect_2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_2_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; - PyObject *(*__pyx_t_3)(PyObject *); - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - unsigned int __pyx_t_7; + PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -24474,94 +25015,35 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4copy_2generator5(__pyx_Coroutine return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 685, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 685, __pyx_L1_error) } - if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { - __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = 0; - __pyx_t_3 = NULL; - } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 685, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 685, __pyx_L1_error) - } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 712, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 712, __pyx_L1_error) } + __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; for (;;) { - if (likely(!__pyx_t_3)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 685, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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_ERR(0, 685, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 685, __pyx_L1_error) - #endif - if (__pyx_t_2 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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_ERR(0, 685, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 685, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s); - __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_s, __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 685, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(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); - __pyx_t_7 = 1; - } - } - #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 712, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; } - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 712, __pyx_L1_error) + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; __Pyx_XGIVEREF(__pyx_t_1); __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; - __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); __Pyx_Coroutine_ResetAndClearException(__pyx_generator); @@ -24573,8 +25055,7 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4copy_2generator5(__pyx_Coroutine __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; - __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 685, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 712, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -24585,9 +25066,7 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4copy_2generator5(__pyx_Coroutine __pyx_L1_error:; __Pyx_Generator_Replace_StopIteration(0); __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_3); __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; __Pyx_XDECREF(__pyx_r); __pyx_r = 0; @@ -24599,574 +25078,599 @@ static PyObject *__pyx_gb_10collisions_6Shapes_4copy_2generator5(__pyx_Coroutine __Pyx_RefNannyFinishContext(); return __pyx_r; } +static PyObject *__pyx_gb_10collisions_6Shapes_4rect_5generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "collisions.py":681 - * return min(i[0] for i in rs), min(i[1] for i in rs), max(i[2] for i in rs), max(i[3] for i in rs) - * - * def copy(self) -> 'Shapes': # <<<<<<<<<<<<<< - * """ - * Make a copy of this class with a copy of each shape in it. - */ - -static PyObject *__pyx_pf_10collisions_6Shapes_26copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_gb_10collisions_6Shapes_4copy_2generator5 = 0; +static PyObject *__pyx_pf_10collisions_6Shapes_4rect_3genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("copy", 1); - - /* "collisions.py":685 - * Make a copy of this class with a copy of each shape in it. - * """ - * return Shapes(s.copy() for s in self.shapes) # <<<<<<<<<<<<<< - * - * def copy_leave_shapes(self) -> 'Shapes': - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 685, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 685, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_pf_10collisions_6Shapes_4copy_genexpr(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (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); - __pyx_t_5 = 1; - } + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_3_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 712, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - #endif + __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; + __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 685, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_6Shapes_4rect_5generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Shapes_rect_locals_genexpr, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; } - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "collisions.py":681 - * return min(i[0] for i in rs), min(i[1] for i in rs), max(i[2] for i in rs), max(i[3] for i in rs) - * - * def copy(self) -> 'Shapes': # <<<<<<<<<<<<<< - * """ - * Make a copy of this class with a copy of each shape in it. - */ /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("collisions.Shapes.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Shapes.rect.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_gb_10collisions_6Shapes_4copy_2generator5); + __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":687 - * return Shapes(s.copy() for s in self.shapes) - * - * def copy_leave_shapes(self) -> 'Shapes': # <<<<<<<<<<<<<< - * """ - * Makes a copy of this class but keeps the same shapes. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Shapes_29copy_leave_shapes(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_6Shapes_28copy_leave_shapes, "\n Makes a copy of this class but keeps the same shapes.\n "); -static PyMethodDef __pyx_mdef_10collisions_6Shapes_29copy_leave_shapes = {"copy_leave_shapes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_29copy_leave_shapes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Shapes_28copy_leave_shapes}; -static PyObject *__pyx_pw_10collisions_6Shapes_29copy_leave_shapes(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_self = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; +static PyObject *__pyx_gb_10collisions_6Shapes_4rect_5generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("copy_leave_shapes (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 687, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy_leave_shapes") < 0)) __PYX_ERR(0, 687, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_self = values[0]; + __Pyx_RefNannySetupContext("genexpr", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + case 1: goto __pyx_L6_resume_from_yield; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("copy_leave_shapes", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 687, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 712, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 712, __pyx_L1_error) } + __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; + for (;;) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 712, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 712, __pyx_L1_error) + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_XGIVEREF(__pyx_t_1); + __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; + __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + /* return from generator, yielding value */ + __pyx_generator->resume_label = 1; + return __pyx_r; + __pyx_L6_resume_from_yield:; + __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; + __pyx_cur_scope->__pyx_t_0 = 0; + __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 712, __pyx_L1_error) } - __Pyx_AddTraceback("collisions.Shapes.copy_leave_shapes", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Shapes_28copy_leave_shapes(__pyx_self, __pyx_v_self); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } + PyErr_SetNone(PyExc_StopIteration); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XDECREF(__pyx_r); __pyx_r = 0; + #if !CYTHON_USE_EXC_INFO_STACK + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + #endif + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } +static PyObject *__pyx_gb_10collisions_6Shapes_4rect_8generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -static PyObject *__pyx_pf_10collisions_6Shapes_28copy_leave_shapes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_6Shapes_4rect_6genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr *__pyx_cur_scope; 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("copy_leave_shapes", 1); - - /* "collisions.py":691 - * Makes a copy of this class but keeps the same shapes. - * """ - * return Shapes(*self.shapes) # <<<<<<<<<<<<<< - * - * def __iter__(self): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 691, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 691, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 691, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "collisions.py":687 - * return Shapes(s.copy() for s in self.shapes) - * - * def copy_leave_shapes(self) -> 'Shapes': # <<<<<<<<<<<<<< - * """ - * Makes a copy of this class but keeps the same shapes. - */ + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_4_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_4_genexpr, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 712, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; + __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + { + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_6Shapes_4rect_8generator3, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Shapes_rect_locals_genexpr, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("collisions.Shapes.copy_leave_shapes", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Shapes.rect.genexpr", __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; } -/* "collisions.py":693 - * return Shapes(*self.shapes) - * - * def __iter__(self): # <<<<<<<<<<<<<< - * return iter(self.shapes) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Shapes_31__iter__(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_6Shapes_31__iter__ = {"__iter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_31__iter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Shapes_31__iter__(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_self = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; +static PyObject *__pyx_gb_10collisions_6Shapes_4rect_8generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 693, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__iter__") < 0)) __PYX_ERR(0, 693, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_self = values[0]; + __Pyx_RefNannySetupContext("genexpr", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + case 1: goto __pyx_L6_resume_from_yield; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 693, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 712, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 712, __pyx_L1_error) } + __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; + for (;;) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 712, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 712, __pyx_L1_error) + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_i, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_XGIVEREF(__pyx_t_1); + __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; + __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + /* return from generator, yielding value */ + __pyx_generator->resume_label = 1; + return __pyx_r; + __pyx_L6_resume_from_yield:; + __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; + __pyx_cur_scope->__pyx_t_0 = 0; + __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 712, __pyx_L1_error) } - __Pyx_AddTraceback("collisions.Shapes.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Shapes_30__iter__(__pyx_self, __pyx_v_self); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } + PyErr_SetNone(PyExc_StopIteration); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XDECREF(__pyx_r); __pyx_r = 0; + #if !CYTHON_USE_EXC_INFO_STACK + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + #endif + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } +static PyObject *__pyx_gb_10collisions_6Shapes_4rect_11generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -static PyObject *__pyx_pf_10collisions_6Shapes_30__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_6Shapes_4rect_9genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __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("__iter__", 1); - - /* "collisions.py":694 - * - * def __iter__(self): - * return iter(self.shapes) # <<<<<<<<<<<<<< - * - * def __len__(self): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 694, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 694, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "collisions.py":693 - * return Shapes(*self.shapes) - * - * def __iter__(self): # <<<<<<<<<<<<<< - * return iter(self.shapes) - * - */ + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_5_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_5_genexpr, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 712, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; + __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + { + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_6Shapes_4rect_11generator4, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Shapes_rect_locals_genexpr, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("collisions.Shapes.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Shapes.rect.genexpr", __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; } -/* "collisions.py":696 - * return iter(self.shapes) - * - * def __len__(self): # <<<<<<<<<<<<<< - * return len(self.shapes) - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Shapes_33__len__(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_6Shapes_33__len__ = {"__len__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_33__len__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Shapes_33__len__(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_self = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; +static PyObject *__pyx_gb_10collisions_6Shapes_4rect_11generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 696, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__len__") < 0)) __PYX_ERR(0, 696, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_self = values[0]; + __Pyx_RefNannySetupContext("genexpr", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + case 1: goto __pyx_L6_resume_from_yield; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__len__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 696, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 712, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 712, __pyx_L1_error) } + __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; + for (;;) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 712, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 712, __pyx_L1_error) + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_i, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + __Pyx_XGIVEREF(__pyx_t_1); + __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; + __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + /* return from generator, yielding value */ + __pyx_generator->resume_label = 1; + return __pyx_r; + __pyx_L6_resume_from_yield:; + __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; + __pyx_cur_scope->__pyx_t_0 = 0; + __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 712, __pyx_L1_error) } - __Pyx_AddTraceback("collisions.Shapes.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Shapes_32__len__(__pyx_self, __pyx_v_self); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } + PyErr_SetNone(PyExc_StopIteration); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_L0:; + __Pyx_XDECREF(__pyx_r); __pyx_r = 0; + #if !CYTHON_USE_EXC_INFO_STACK + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + #endif + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Shapes_32__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +/* "collisions.py":704 + * return sum(s.area() for s in self.shapes) + * + * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< + * """ + * Returns the rectangle bounding box surrounding every one of these objects. + */ + +static PyObject *__pyx_pf_10collisions_6Shapes_28rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_rs = NULL; + PyObject *__pyx_8genexpr7__pyx_v_s = NULL; + PyObject *__pyx_gb_10collisions_6Shapes_4rect_2generator1 = 0; + PyObject *__pyx_gb_10collisions_6Shapes_4rect_5generator2 = 0; + PyObject *__pyx_gb_10collisions_6Shapes_4rect_8generator3 = 0; + PyObject *__pyx_gb_10collisions_6Shapes_4rect_11generator4 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + unsigned int __pyx_t_8; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__len__", 1); + __Pyx_RefNannySetupContext("rect", 1); - /* "collisions.py":697 + /* "collisions.py":711 + * Iterable[Number]: (min x, min y, max x, max y) + * """ + * rs = [s.rect() for s in self.shapes] # <<<<<<<<<<<<<< + * return min(i[0] for i in rs), min(i[1] for i in rs), max(i[2] for i in rs), max(i[3] for i in rs) * - * def __len__(self): - * return len(self.shapes) # <<<<<<<<<<<<<< + */ + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = 0; + __pyx_t_5 = NULL; + } else { + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 711, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 711, __pyx_L5_error) + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 711, __pyx_L5_error) + #endif + if (__pyx_t_4 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 711, __pyx_L5_error) + #else + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 711, __pyx_L5_error) + #endif + if (__pyx_t_4 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 711, __pyx_L5_error) + #else + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } + } else { + __pyx_t_2 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 711, __pyx_L5_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_s, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_8genexpr7__pyx_v_s, __pyx_n_s_rect); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 711, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_8 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 711, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 711, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_s); __pyx_8genexpr7__pyx_v_s = 0; + goto __pyx_L9_exit_scope; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_s); __pyx_8genexpr7__pyx_v_s = 0; + goto __pyx_L1_error; + __pyx_L9_exit_scope:; + } /* exit inner scope */ + __pyx_v_rs = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + + /* "collisions.py":712 + * """ + * rs = [s.rect() for s in self.shapes] + * return min(i[0] for i in rs), min(i[1] for i in rs), max(i[2] for i in rs), max(i[3] for i in rs) # <<<<<<<<<<<<<< * - * def __getitem__(self, index: int) -> Union[Shape,'Shapes']: + * def copy(self) -> 'Shapes': */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_10collisions_6Shapes_4rect_genexpr(NULL, __pyx_v_rs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_pf_10collisions_6Shapes_4rect_3genexpr(NULL, __pyx_v_rs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_pf_10collisions_6Shapes_4rect_6genexpr(NULL, __pyx_v_rs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_pf_10collisions_6Shapes_4rect_9genexpr(NULL, __pyx_v_rs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 712, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_6)) __PYX_ERR(0, 712, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_7)) __PYX_ERR(0, 712, __pyx_L1_error); + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_t_6 = 0; + __pyx_t_7 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":696 - * return iter(self.shapes) - * - * def __len__(self): # <<<<<<<<<<<<<< - * return len(self.shapes) + /* "collisions.py":704 + * return sum(s.area() for s in self.shapes) * + * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< + * """ + * Returns the rectangle bounding box surrounding every one of these objects. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("collisions.Shapes.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_AddTraceback("collisions.Shapes.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_rs); + __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_s); + __Pyx_XDECREF(__pyx_gb_10collisions_6Shapes_4rect_2generator1); + __Pyx_XDECREF(__pyx_gb_10collisions_6Shapes_4rect_5generator2); + __Pyx_XDECREF(__pyx_gb_10collisions_6Shapes_4rect_8generator3); + __Pyx_XDECREF(__pyx_gb_10collisions_6Shapes_4rect_11generator4); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":699 - * return len(self.shapes) - * - * def __getitem__(self, index: int) -> Union[Shape,'Shapes']: # <<<<<<<<<<<<<< - * return self.shapes[index] +/* "collisions.py":714 + * return min(i[0] for i in rs), min(i[1] for i in rs), max(i[2] for i in rs), max(i[3] for i in rs) * + * def copy(self) -> 'Shapes': # <<<<<<<<<<<<<< + * """ + * Make a copy of this class with a copy of each shape in it. */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Shapes_35__getitem__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Shapes_31copy(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_6Shapes_35__getitem__ = {"__getitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_35__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Shapes_35__getitem__(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_6Shapes_30copy, "\n Make a copy of this class with a copy of each shape in it.\n "); +static PyMethodDef __pyx_mdef_10collisions_6Shapes_31copy = {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_31copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Shapes_30copy}; +static PyObject *__pyx_pw_10collisions_6Shapes_31copy(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -25174,18 +25678,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_index = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[2] = {0,0}; + PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); + __Pyx_RefNannySetupContext("copy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -25195,12 +25698,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_index,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; @@ -25213,35 +25714,23 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 699, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 714, __pyx_L3_error) else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 699, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 699, __pyx_L3_error) - } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__getitem__") < 0)) __PYX_ERR(0, 699, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(0, 714, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 2)) { + } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; - __pyx_v_index = ((PyObject*)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 699, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("copy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 714, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -25251,18 +25740,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Shapes.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Shapes.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), (&PyInt_Type), 0, "index", 1))) __PYX_ERR(0, 699, __pyx_L1_error) - __pyx_r = __pyx_pf_10collisions_6Shapes_34__getitem__(__pyx_self, __pyx_v_self, __pyx_v_index); + __pyx_r = __pyx_pf_10collisions_6Shapes_30copy(__pyx_self, __pyx_v_self); /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -25272,253 +25756,308 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return __pyx_r; } +static PyObject *__pyx_gb_10collisions_6Shapes_4copy_2generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ + +/* "collisions.py":718 + * Make a copy of this class with a copy of each shape in it. + * """ + * return Shapes(s.copy() for s in self.shapes) # <<<<<<<<<<<<<< + * + * def copy_leave_shapes(self) -> 'Shapes': + */ -static PyObject *__pyx_pf_10collisions_6Shapes_34__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_index) { +static PyObject *__pyx_pf_10collisions_6Shapes_4copy_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { + struct __pyx_obj_10collisions___pyx_scope_struct_6_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __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("__getitem__", 1); - - /* "collisions.py":700 - * - * def __getitem__(self, index: int) -> Union[Shape,'Shapes']: - * return self.shapes[index] # <<<<<<<<<<<<<< - * - * def __setitem__(self, index: int, new: Union[Shape,'Shapes']) -> None: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 700, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 700, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "collisions.py":699 - * return len(self.shapes) - * - * def __getitem__(self, index: int) -> Union[Shape,'Shapes']: # <<<<<<<<<<<<<< - * return self.shapes[index] - * - */ + __Pyx_RefNannySetupContext("genexpr", 0); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_6_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_6_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_6_genexpr, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_6_genexpr *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 718, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; + __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); + { + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_6Shapes_4copy_2generator5, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Shapes_copy_locals_genexpr, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 718, __pyx_L1_error) + __Pyx_DECREF(__pyx_cur_scope); + __Pyx_RefNannyFinishContext(); + return (PyObject *) gen; + } /* function exit code */ __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("collisions.Shapes.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Shapes.copy.genexpr", __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; } -/* "collisions.py":702 - * return self.shapes[index] - * - * def __setitem__(self, index: int, new: Union[Shape,'Shapes']) -> None: # <<<<<<<<<<<<<< - * self.shapes[index] = new - * - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Shapes_37__setitem__(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_6Shapes_37__setitem__ = {"__setitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_37__setitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Shapes_37__setitem__(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_index = 0; - PyObject *__pyx_v_new = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[3] = {0,0,0}; +static PyObject *__pyx_gb_10collisions_6Shapes_4copy_2generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ +{ + struct __pyx_obj_10collisions___pyx_scope_struct_6_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_6_genexpr *)__pyx_generator->closure); + PyObject *__pyx_r = NULL; + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + PyObject *(*__pyx_t_3)(PyObject *); + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_index,&__pyx_n_s_new,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 702, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 702, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 702, __pyx_L3_error) + __Pyx_RefNannySetupContext("genexpr", 0); + switch (__pyx_generator->resume_label) { + case 0: goto __pyx_L3_first_run; + case 1: goto __pyx_L6_resume_from_yield; + default: /* CPython raises the right error here */ + __Pyx_RefNannyFinishContext(); + return NULL; + } + __pyx_L3_first_run:; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 718, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 718, __pyx_L1_error) } + if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { + __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_3 = NULL; + } else { + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 718, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_3)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 718, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_new)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __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_ERR(0, 718, __pyx_L1_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 718, __pyx_L1_error) + #endif + if (__pyx_t_2 >= __pyx_temp) break; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 702, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 702, __pyx_L3_error) + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __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_ERR(0, 718, __pyx_L1_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 718, __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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 718, __pyx_L1_error) } + break; } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(0, 702, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s); + __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_s, __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(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); + __pyx_t_7 = 1; } - } else if (unlikely(__pyx_nargs != 3)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } - __pyx_v_self = values[0]; - __pyx_v_index = ((PyObject*)values[1]); - __pyx_v_new = values[2]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 702, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + __Pyx_XGIVEREF(__pyx_t_1); + __pyx_cur_scope->__pyx_t_0 = __pyx_t_1; + __pyx_cur_scope->__pyx_t_1 = __pyx_t_2; + __pyx_cur_scope->__pyx_t_2 = __pyx_t_3; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + /* return from generator, yielding value */ + __pyx_generator->resume_label = 1; + return __pyx_r; + __pyx_L6_resume_from_yield:; + __pyx_t_1 = __pyx_cur_scope->__pyx_t_0; + __pyx_cur_scope->__pyx_t_0 = 0; + __Pyx_XGOTREF(__pyx_t_1); + __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; + __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 718, __pyx_L1_error) } - __Pyx_AddTraceback("collisions.Shapes.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), (&PyInt_Type), 0, "index", 1))) __PYX_ERR(0, 702, __pyx_L1_error) - __pyx_r = __pyx_pf_10collisions_6Shapes_36__setitem__(__pyx_self, __pyx_v_self, __pyx_v_index, __pyx_v_new); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); /* function exit code */ + PyErr_SetNone(PyExc_StopIteration); goto __pyx_L0; __pyx_L1_error:; - __pyx_r = NULL; + __Pyx_Generator_Replace_StopIteration(0); + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } + __Pyx_XDECREF(__pyx_r); __pyx_r = 0; + #if !CYTHON_USE_EXC_INFO_STACK + __Pyx_Coroutine_ResetAndClearException(__pyx_generator); + #endif + __pyx_generator->resume_label = -1; + __Pyx_Coroutine_clear((PyObject*)__pyx_generator); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Shapes_36__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_new) { +/* "collisions.py":714 + * return min(i[0] for i in rs), min(i[1] for i in rs), max(i[2] for i in rs), max(i[3] for i in rs) + * + * def copy(self) -> 'Shapes': # <<<<<<<<<<<<<< + * """ + * Make a copy of this class with a copy of each shape in it. + */ + +static PyObject *__pyx_pf_10collisions_6Shapes_30copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_gb_10collisions_6Shapes_4copy_2generator5 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__setitem__", 1); + __Pyx_RefNannySetupContext("copy", 1); - /* "collisions.py":703 - * - * def __setitem__(self, index: int, new: Union[Shape,'Shapes']) -> None: - * self.shapes[index] = new # <<<<<<<<<<<<<< + /* "collisions.py":718 + * Make a copy of this class with a copy of each shape in it. + * """ + * return Shapes(s.copy() for s in self.shapes) # <<<<<<<<<<<<<< * - * def __repr__(self): return str(self) + * def copy_leave_shapes(self) -> 'Shapes': */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_index, __pyx_v_new) < 0))) __PYX_ERR(0, 703, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __pyx_pf_10collisions_6Shapes_4copy_genexpr(NULL, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (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); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 718, __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; - /* "collisions.py":702 - * return self.shapes[index] - * - * def __setitem__(self, index: int, new: Union[Shape,'Shapes']) -> None: # <<<<<<<<<<<<<< - * self.shapes[index] = new + /* "collisions.py":714 + * return min(i[0] for i in rs), min(i[1] for i in rs), max(i[2] for i in rs), max(i[3] for i in rs) * + * def copy(self) -> 'Shapes': # <<<<<<<<<<<<<< + * """ + * Make a copy of this class with a copy of each shape in it. */ /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); - goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("collisions.Shapes.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("collisions.Shapes.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_gb_10collisions_6Shapes_4copy_2generator5); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":705 - * self.shapes[index] = new - * - * def __repr__(self): return str(self) # <<<<<<<<<<<<<< +/* "collisions.py":720 + * return Shapes(s.copy() for s in self.shapes) * - * def __str__(self): + * def copy_leave_shapes(self) -> 'Shapes': # <<<<<<<<<<<<<< + * """ + * Makes a copy of this class but keeps the same shapes. */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Shapes_39__repr__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Shapes_33copy_leave_shapes(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_6Shapes_39__repr__ = {"__repr__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_39__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Shapes_39__repr__(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_6Shapes_32copy_leave_shapes, "\n Makes a copy of this class but keeps the same shapes.\n "); +static PyMethodDef __pyx_mdef_10collisions_6Shapes_33copy_leave_shapes = {"copy_leave_shapes", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_33copy_leave_shapes, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Shapes_32copy_leave_shapes}; +static PyObject *__pyx_pw_10collisions_6Shapes_33copy_leave_shapes(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -25536,7 +26075,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); + __Pyx_RefNannySetupContext("copy_leave_shapes (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -25562,12 +26101,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 705, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 720, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__repr__") < 0)) __PYX_ERR(0, 705, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy_leave_shapes") < 0)) __PYX_ERR(0, 720, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -25578,7 +26117,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 705, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("copy_leave_shapes", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 720, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -25588,11 +26127,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Shapes.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Shapes.copy_leave_shapes", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Shapes_38__repr__(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_6Shapes_32copy_leave_shapes(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -25605,25 +26144,54 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Shapes_38__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_6Shapes_32copy_leave_shapes(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("__repr__", 1); + __Pyx_RefNannySetupContext("copy_leave_shapes", 1); + + /* "collisions.py":724 + * Makes a copy of this class but keeps the same shapes. + * """ + * return Shapes(*self.shapes) # <<<<<<<<<<<<<< + * + * def __iter__(self): + */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; + /* "collisions.py":720 + * return Shapes(s.copy() for s in self.shapes) + * + * def copy_leave_shapes(self) -> 'Shapes': # <<<<<<<<<<<<<< + * """ + * Makes a copy of this class but keeps the same shapes. + */ + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("collisions.Shapes.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("collisions.Shapes.copy_leave_shapes", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -25631,24 +26199,24 @@ static PyObject *__pyx_pf_10collisions_6Shapes_38__repr__(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":707 - * def __repr__(self): return str(self) +/* "collisions.py":726 + * return Shapes(*self.shapes) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * return iter(self.shapes) * - * def __str__(self): # <<<<<<<<<<<<<< - * shpTyps = str([i.__class__.__name__ for i in self.shapes]).replace("'", "") - * return f'' */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Shapes_41__str__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Shapes_35__iter__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_6Shapes_41__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_41__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Shapes_41__str__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_6Shapes_35__iter__ = {"__iter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_35__iter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_6Shapes_35__iter__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -25666,7 +26234,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -25692,12 +26260,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 707, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 726, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 707, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__iter__") < 0)) __PYX_ERR(0, 726, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -25708,7 +26276,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 707, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 726, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -25718,11 +26286,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Shapes.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Shapes.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Shapes_40__str__(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_6Shapes_34__iter__(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -25735,233 +26303,71 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Shapes_40__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_v_shpTyps = NULL; - PyObject *__pyx_9genexpr13__pyx_v_i = NULL; +static PyObject *__pyx_pf_10collisions_6Shapes_34__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __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 *); - PyObject *__pyx_t_6 = NULL; - Py_UCS4 __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__str__", 1); + __Pyx_RefNannySetupContext("__iter__", 1); - /* "collisions.py":708 - * - * def __str__(self): - * shpTyps = str([i.__class__.__name__ for i in self.shapes]).replace("'", "") # <<<<<<<<<<<<<< - * return f'' + /* "collisions.py":727 * - */ - { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 708, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 708, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_2); - if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { - __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); - __pyx_t_4 = 0; - __pyx_t_5 = NULL; - } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 708, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 708, __pyx_L5_error) - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - for (;;) { - if (likely(!__pyx_t_5)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 708, __pyx_L5_error) - #endif - if (__pyx_t_4 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 708, __pyx_L5_error) - #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 708, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_2); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 708, __pyx_L5_error) - #endif - if (__pyx_t_4 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 708, __pyx_L5_error) - #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 708, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_2); - #endif - } - } else { - __pyx_t_2 = __pyx_t_5(__pyx_t_3); - if (unlikely(!__pyx_t_2)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 708, __pyx_L5_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_2); - } - __Pyx_XDECREF_SET(__pyx_9genexpr13__pyx_v_i, __pyx_t_2); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr13__pyx_v_i, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 708, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 708, __pyx_L5_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 708, __pyx_L5_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_i); __pyx_9genexpr13__pyx_v_i = 0; - goto __pyx_L9_exit_scope; - __pyx_L5_error:; - __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_i); __pyx_9genexpr13__pyx_v_i = 0; - goto __pyx_L1_error; - __pyx_L9_exit_scope:; - } /* exit inner scope */ - __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 708, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyUnicode_Replace(((PyObject*)__pyx_t_3), __pyx_kp_u__3, __pyx_kp_u__4, -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 708, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_shpTyps = __pyx_t_1; - __pyx_t_1 = 0; - - /* "collisions.py":709 - * def __str__(self): - * shpTyps = str([i.__class__.__name__ for i in self.shapes]).replace("'", "") - * return f'' # <<<<<<<<<<<<<< + * def __iter__(self): + * return iter(self.shapes) # <<<<<<<<<<<<<< * - * # The below are in order of collision: + * def __len__(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 709, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = 0; - __pyx_t_7 = 127; - __Pyx_INCREF(__pyx_kp_u_Shapes_with_shapes); - __pyx_t_4 += 21; - __Pyx_GIVEREF(__pyx_kp_u_Shapes_with_shapes); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Shapes_with_shapes); - __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_shpTyps, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 709, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_7; - __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); - __pyx_t_3 = 0; - __Pyx_INCREF(__pyx_kp_u__5); - __pyx_t_4 += 1; - __Pyx_GIVEREF(__pyx_kp_u__5); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__5); - __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 709, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 727, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":707 - * def __repr__(self): return str(self) + /* "collisions.py":726 + * return Shapes(*self.shapes) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * return iter(self.shapes) * - * def __str__(self): # <<<<<<<<<<<<<< - * shpTyps = str([i.__class__.__name__ for i in self.shapes]).replace("'", "") - * return f'' */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("collisions.Shapes.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Shapes.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_shpTyps); - __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_i); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":718 - * TYPE = ShpTyps.Point - * """An infintesimally small point in space defined by an x and y coordinate.""" - * def __init__(self, x: Number, y: Number, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< - * """ - * Args: +/* "collisions.py":729 + * return iter(self.shapes) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return len(self.shapes) + * */ -static PyObject *__pyx_pf_10collisions_28__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { - PyObject *__pyx_r = NULL; - __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("__defaults__", 1); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 718, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 718, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 718, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 718, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 718, __pyx_L1_error); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None)) __PYX_ERR(0, 718, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("collisions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Point_1__init__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Shapes_37__len__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_5Point___init__, "\n Args:\n x (Number): The x ordinate of this object.\n y (Number): The y ordinate of this object.\n bounciness (float, optional): How bouncy this object is. 1 = rebounds perfectly, <1 = eventually will stop, >1 = will bounce more each time. Defaults to 0.7.\n "); -static PyMethodDef __pyx_mdef_10collisions_5Point_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Point___init__}; -static PyObject *__pyx_pw_10collisions_5Point_1__init__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_6Shapes_37__len__ = {"__len__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_37__len__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_6Shapes_37__len__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -25969,20 +26375,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_x = 0; - PyObject *__pyx_v_y = 0; - double __pyx_v_bounciness; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[4] = {0,0,0,0}; + PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + __Pyx_RefNannySetupContext("__len__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -25992,17 +26395,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_bounciness,0}; - __pyx_defaults5 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_self); + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; @@ -26015,63 +26411,23 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 718, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 729, __pyx_L3_error) else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 718, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); __PYX_ERR(0, 718, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 718, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); __PYX_ERR(0, 718, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bounciness); - if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 718, __pyx_L3_error) - } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 718, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__len__") < 0)) __PYX_ERR(0, 729, __pyx_L3_error) } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; } else { - switch (__pyx_nargs) { - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; - __pyx_v_x = values[1]; - __pyx_v_y = values[2]; - if (values[3]) { - __pyx_v_bounciness = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_bounciness == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 718, __pyx_L3_error) - } else { - __pyx_v_bounciness = __pyx_dynamic_args->__pyx_arg_bounciness; - } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 718, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__len__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 729, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -26081,11 +26437,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Point.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Shapes.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Point___init__(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_y, __pyx_v_bounciness); + __pyx_r = __pyx_pf_10collisions_6Shapes_36__len__(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -26098,103 +26454,46 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Point___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, double __pyx_v_bounciness) { +static PyObject *__pyx_pf_10collisions_6Shapes_36__len__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - unsigned int __pyx_t_5; + Py_ssize_t __pyx_t_2; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("__len__", 1); - /* "collisions.py":725 - * bounciness (float, optional): How bouncy this object is. 1 = rebounds perfectly, <1 = eventually will stop, >1 = will bounce more each time. Defaults to 0.7. - * """ - * super().__init__(bounciness) # <<<<<<<<<<<<<< - * self.x, self.y = x, y + /* "collisions.py":730 * - */ - __pyx_t_2 = __Pyx_CyFunction_GetClassObj(__pyx_self); - if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 725, __pyx_L1_error) } - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_self); - __Pyx_GIVEREF(__pyx_v_self); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(0, 725, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 725, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 725, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "collisions.py":726 - * """ - * super().__init__(bounciness) - * self.x, self.y = x, y # <<<<<<<<<<<<<< + * def __len__(self): + * return len(self.shapes) # <<<<<<<<<<<<<< * - * def rect(self) -> Iterable[Number]: + * def __getitem__(self, index: int) -> Union[Shape,'Shapes']: */ - __pyx_t_1 = __pyx_v_x; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_3 = __pyx_v_y; - __Pyx_INCREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_1) < 0) __PYX_ERR(0, 726, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 730, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_3) < 0) __PYX_ERR(0, 726, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "collisions.py":718 - * TYPE = ShpTyps.Point - * """An infintesimally small point in space defined by an x and y coordinate.""" - * def __init__(self, x: Number, y: Number, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< - * """ - * Args: + /* "collisions.py":729 + * return iter(self.shapes) + * + * def __len__(self): # <<<<<<<<<<<<<< + * return len(self.shapes) + * */ /* 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_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("collisions.Point.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Shapes.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -26202,25 +26501,24 @@ static PyObject *__pyx_pf_10collisions_5Point___init__(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":728 - * self.x, self.y = x, y +/* "collisions.py":732 + * return len(self.shapes) + * + * def __getitem__(self, index: int) -> Union[Shape,'Shapes']: # <<<<<<<<<<<<<< + * return self.shapes[index] * - * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< - * """ - * Returns the rectangle bounding box surrounding this point. */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Point_3rect(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Shapes_39__getitem__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_5Point_2rect, "\n Returns the rectangle bounding box surrounding this point.\n\n Returns:\n Iterable[Number]: (min x, min y, max x, max y)\n "); -static PyMethodDef __pyx_mdef_10collisions_5Point_3rect = {"rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_3rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Point_2rect}; -static PyObject *__pyx_pw_10collisions_5Point_3rect(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_6Shapes_39__getitem__ = {"__getitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_39__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_6Shapes_39__getitem__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -26228,17 +26526,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_index = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; + PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("rect (wrapper)", 0); + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -26248,10 +26547,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_index,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; @@ -26264,23 +26565,35 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 728, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 732, __pyx_L3_error) else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 732, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 732, __pyx_L3_error) + } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rect") < 0)) __PYX_ERR(0, 728, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__getitem__") < 0)) __PYX_ERR(0, 732, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 1)) { + } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; + __pyx_v_index = ((PyObject*)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 728, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 732, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -26290,13 +26603,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Point.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Shapes.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Point_2rect(__pyx_self, __pyx_v_self); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), (&PyInt_Type), 0, "index", 1))) __PYX_ERR(0, 732, __pyx_L1_error) + __pyx_r = __pyx_pf_10collisions_6Shapes_38__getitem__(__pyx_self, __pyx_v_self, __pyx_v_index); /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -26307,69 +26625,46 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Point_2rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_6Shapes_38__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_index) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("rect", 1); + __Pyx_RefNannySetupContext("__getitem__", 1); - /* "collisions.py":735 - * Iterable[Number]: (min x, min y, max x, max y) - * """ - * return self.x, self.y, self.x, self.y # <<<<<<<<<<<<<< + /* "collisions.py":733 * - * def area(self) -> Number: + * def __getitem__(self, index: int) -> Union[Shape,'Shapes']: + * return self.shapes[index] # <<<<<<<<<<<<<< + * + * def __setitem__(self, index: int, new: Union[Shape,'Shapes']) -> None: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 735, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 733, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 735, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 735, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(0, 735, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(0, 735, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4)) __PYX_ERR(0, 735, __pyx_L1_error); - __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_t_4 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; goto __pyx_L0; - /* "collisions.py":728 - * self.x, self.y = x, y + /* "collisions.py":732 + * return len(self.shapes) + * + * def __getitem__(self, index: int) -> Union[Shape,'Shapes']: # <<<<<<<<<<<<<< + * return self.shapes[index] * - * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< - * """ - * Returns the rectangle bounding box surrounding this point. */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("collisions.Point.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Shapes.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -26377,43 +26672,44 @@ static PyObject *__pyx_pf_10collisions_5Point_2rect(CYTHON_UNUSED PyObject *__py return __pyx_r; } -/* "collisions.py":737 - * return self.x, self.y, self.x, self.y +/* "collisions.py":735 + * return self.shapes[index] + * + * def __setitem__(self, index: int, new: Union[Shape,'Shapes']) -> None: # <<<<<<<<<<<<<< + * self.shapes[index] = new * - * def area(self) -> Number: # <<<<<<<<<<<<<< - * """ - * Gets the area of the shape; 0. */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Point_5area(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Shapes_41__setitem__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_5Point_4area, "\n Gets the area of the shape; 0.\n\n Returns:\n Number: The area of the shape\n "); -static PyMethodDef __pyx_mdef_10collisions_5Point_5area = {"area", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_5area, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Point_4area}; -static PyObject *__pyx_pw_10collisions_5Point_5area(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_6Shapes_41__setitem__ = {"__setitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_41__setitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_6Shapes_41__setitem__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - CYTHON_UNUSED PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_index = 0; + PyObject *__pyx_v_new = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; + PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("area (wrapper)", 0); + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -26423,10 +26719,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_index,&__pyx_n_s_new,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; @@ -26439,23 +26739,47 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 737, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 735, __pyx_L3_error) else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_index)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 735, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 735, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_new)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 735, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 735, __pyx_L3_error) + } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "area") < 0)) __PYX_ERR(0, 737, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(0, 735, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 1)) { + } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_self = values[0]; + __pyx_v_index = ((PyObject*)values[1]); + __pyx_v_new = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 737, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 735, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -26465,13 +26789,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Point.area", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Shapes.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Point_4area(__pyx_self, __pyx_v_self); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_index), (&PyInt_Type), 0, "index", 1))) __PYX_ERR(0, 735, __pyx_L1_error) + __pyx_r = __pyx_pf_10collisions_6Shapes_40__setitem__(__pyx_self, __pyx_v_self, __pyx_v_index, __pyx_v_new); /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -26482,57 +26811,66 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Point_4area(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_6Shapes_40__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_new) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("area", 1); + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__setitem__", 1); - /* "collisions.py":744 - * Number: The area of the shape - * """ - * return 0.0 # <<<<<<<<<<<<<< + /* "collisions.py":736 * - * def toPoints(self) -> Iterable[pointLike]: + * def __setitem__(self, index: int, new: Union[Shape,'Shapes']) -> None: + * self.shapes[index] = new # <<<<<<<<<<<<<< + * + * def __repr__(self): return str(self) */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_float_0_0); - __pyx_r = __pyx_float_0_0; - goto __pyx_L0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 736, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_index, __pyx_v_new) < 0))) __PYX_ERR(0, 736, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":737 - * return self.x, self.y, self.x, self.y + /* "collisions.py":735 + * return self.shapes[index] + * + * def __setitem__(self, index: int, new: Union[Shape,'Shapes']) -> None: # <<<<<<<<<<<<<< + * self.shapes[index] = new * - * def area(self) -> Number: # <<<<<<<<<<<<<< - * """ - * Gets the area of the shape; 0. */ /* function exit code */ + __pyx_r = Py_None; __Pyx_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("collisions.Shapes.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":746 - * return 0.0 +/* "collisions.py":738 + * self.shapes[index] = new * - * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * """ - * Returns: + * def __repr__(self): return str(self) # <<<<<<<<<<<<<< + * + * def __str__(self): */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Point_7toPoints(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Shapes_43__repr__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_5Point_6toPoints, "\n Returns:\n Iterable[pointLike]: Get a list of all the Points that make up this object; i.e. just this one point.\n "); -static PyMethodDef __pyx_mdef_10collisions_5Point_7toPoints = {"toPoints", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_7toPoints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Point_6toPoints}; -static PyObject *__pyx_pw_10collisions_5Point_7toPoints(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_6Shapes_43__repr__ = {"__repr__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_43__repr__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_6Shapes_43__repr__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -26550,7 +26888,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("toPoints (wrapper)", 0); + __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -26576,12 +26914,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 746, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 738, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toPoints") < 0)) __PYX_ERR(0, 746, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__repr__") < 0)) __PYX_ERR(0, 738, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -26592,7 +26930,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("toPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 746, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__repr__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 738, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -26602,11 +26940,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Point.toPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Shapes.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Point_6toPoints(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_6Shapes_42__repr__(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -26619,44 +26957,25 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Point_6toPoints(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_6Shapes_42__repr__(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("toPoints", 1); - - /* "collisions.py":751 - * Iterable[pointLike]: Get a list of all the Points that make up this object; i.e. just this one point. - * """ - * return [self] # <<<<<<<<<<<<<< - * - * def _collides(self, othershape: Shape) -> bool: - */ + __Pyx_RefNannySetupContext("__repr__", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 751, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_self); - __Pyx_GIVEREF(__pyx_v_self); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_self)) __PYX_ERR(0, 751, __pyx_L1_error); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":746 - * return 0.0 - * - * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * """ - * Returns: - */ - /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("collisions.Point.toPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Shapes.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -26664,24 +26983,24 @@ static PyObject *__pyx_pf_10collisions_5Point_6toPoints(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "collisions.py":753 - * return [self] +/* "collisions.py":740 + * def __repr__(self): return str(self) * - * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * if checkShpType(othershape, ShpTyps.Point): - * return self.x == othershape.x and self.y == othershape.y + * def __str__(self): # <<<<<<<<<<<<<< + * shpTyps = str([i.__class__.__name__ for i in self.shapes]).replace("'", "") + * return f'' */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Point_9_collides(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Shapes_45__str__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_5Point_9_collides = {"_collides", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_9_collides, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_5Point_9_collides(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_6Shapes_45__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Shapes_45__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_6Shapes_45__str__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -26689,18 +27008,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_othershape = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[2] = {0,0}; + PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_collides (wrapper)", 0); + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -26710,12 +27028,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_othershape,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; @@ -26728,35 +27044,23 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 753, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 740, __pyx_L3_error) else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_othershape)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 753, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 753, __pyx_L3_error) - } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_collides") < 0)) __PYX_ERR(0, 753, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 740, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 2)) { + } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; - __pyx_v_othershape = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 753, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 740, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -26766,11 +27070,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Point._collides", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Shapes.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Point_8_collides(__pyx_self, __pyx_v_self, __pyx_v_othershape); + __pyx_r = __pyx_pf_10collisions_6Shapes_44__str__(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -26783,151 +27087,155 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Point_8_collides(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { +static PyObject *__pyx_pf_10collisions_6Shapes_44__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_v_shpTyps = NULL; + PyObject *__pyx_9genexpr13__pyx_v_i = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - unsigned int __pyx_t_5; - int __pyx_t_6; + Py_ssize_t __pyx_t_4; + PyObject *(*__pyx_t_5)(PyObject *); + PyObject *__pyx_t_6 = NULL; + Py_UCS4 __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_collides", 1); + __Pyx_RefNannySetupContext("__str__", 1); - /* "collisions.py":754 + /* "collisions.py":741 * - * def _collides(self, othershape: Shape) -> bool: - * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< - * return self.x == othershape.x and self.y == othershape.y - * return othershape._collides(self) - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 754, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 754, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (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); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_othershape, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 754, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 754, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_6) { - - /* "collisions.py":755 - * def _collides(self, othershape: Shape) -> bool: - * if checkShpType(othershape, ShpTyps.Point): - * return self.x == othershape.x and self.y == othershape.y # <<<<<<<<<<<<<< - * return othershape._collides(self) + * def __str__(self): + * shpTyps = str([i.__class__.__name__ for i in self.shapes]).replace("'", "") # <<<<<<<<<<<<<< + * return f'' * */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 755, __pyx_L1_error) + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 741, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_shapes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 741, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 755, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 755, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 755, __pyx_L1_error) - if (__pyx_t_6) { - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); + __pyx_t_4 = 0; + __pyx_t_5 = NULL; } else { - __Pyx_INCREF(__pyx_t_3); - __pyx_t_1 = __pyx_t_3; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - goto __pyx_L4_bool_binop_done; + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 741, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 741, __pyx_L5_error) } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 755, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 755, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 755, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_INCREF(__pyx_t_2); - __pyx_t_1 = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_L4_bool_binop_done:; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "collisions.py":754 - * - * def _collides(self, othershape: Shape) -> bool: - * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< - * return self.x == othershape.x and self.y == othershape.y - * return othershape._collides(self) - */ - } + for (;;) { + if (likely(!__pyx_t_5)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 741, __pyx_L5_error) + #endif + if (__pyx_t_4 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 741, __pyx_L5_error) + #else + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 741, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 741, __pyx_L5_error) + #endif + if (__pyx_t_4 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 741, __pyx_L5_error) + #else + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 741, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + } + } else { + __pyx_t_2 = __pyx_t_5(__pyx_t_3); + if (unlikely(!__pyx_t_2)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 741, __pyx_L5_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_2); + } + __Pyx_XDECREF_SET(__pyx_9genexpr13__pyx_v_i, __pyx_t_2); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr13__pyx_v_i, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 741, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 741, __pyx_L5_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 741, __pyx_L5_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_i); __pyx_9genexpr13__pyx_v_i = 0; + goto __pyx_L9_exit_scope; + __pyx_L5_error:; + __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_i); __pyx_9genexpr13__pyx_v_i = 0; + goto __pyx_L1_error; + __pyx_L9_exit_scope:; + } /* exit inner scope */ + __pyx_t_3 = __Pyx_PyObject_Unicode(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyUnicode_Replace(((PyObject*)__pyx_t_3), __pyx_kp_u__5, __pyx_kp_u__6, -1L); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_shpTyps = __pyx_t_1; + __pyx_t_1 = 0; - /* "collisions.py":756 - * if checkShpType(othershape, ShpTyps.Point): - * return self.x == othershape.x and self.y == othershape.y - * return othershape._collides(self) # <<<<<<<<<<<<<< + /* "collisions.py":742 + * def __str__(self): + * shpTyps = str([i.__class__.__name__ for i in self.shapes]).replace("'", "") + * return f'' # <<<<<<<<<<<<<< * - * def _where(self, othershape: Shape) -> Iterable[pointLike]: + * # The below are in order of collision: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 756, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(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; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_self}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 756, __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; + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = 0; + __pyx_t_7 = 127; + __Pyx_INCREF(__pyx_kp_u_Shapes_with_shapes); + __pyx_t_4 += 21; + __Pyx_GIVEREF(__pyx_kp_u_Shapes_with_shapes); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Shapes_with_shapes); + __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_shpTyps, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_7; + __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); + __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_kp_u__7); + __pyx_t_4 += 1; + __Pyx_GIVEREF(__pyx_kp_u__7); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__7); + __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 742, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":753 - * return [self] + /* "collisions.py":740 + * def __repr__(self): return str(self) * - * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * if checkShpType(othershape, ShpTyps.Point): - * return self.x == othershape.x and self.y == othershape.y + * def __str__(self): # <<<<<<<<<<<<<< + * shpTyps = str([i.__class__.__name__ for i in self.shapes]).replace("'", "") + * return f'' */ /* function exit code */ @@ -26935,33 +27243,77 @@ static PyObject *__pyx_pf_10collisions_5Point_8_collides(CYTHON_UNUSED PyObject __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("collisions.Point._collides", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("collisions.Shapes.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_shpTyps); + __Pyx_XDECREF(__pyx_9genexpr13__pyx_v_i); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":758 - * return othershape._collides(self) - * - * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * if checkShpType(othershape, ShpTyps.Point): - * return [[self.x, self.y]] if (self.x == othershape.x and self.y == othershape.y) else [] +/* "collisions.py":751 + * TYPE = ShpTyps.Point + * """An infintesimally small point in space defined by an x and y coordinate.""" + * def __init__(self, x: Number, y: Number, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< + * """ + * Args: */ +static PyObject *__pyx_pf_10collisions_30__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __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("__defaults__", 1); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 751, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 751, __pyx_L1_error); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None)) __PYX_ERR(0, 751, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("collisions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Point_11_where(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Point_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_5Point_11_where = {"_where", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_11_where, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_5Point_11_where(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_5Point___init__, "\n Args:\n x (Number): The x ordinate of this object.\n y (Number): The y ordinate of this object.\n bounciness (float, optional): How bouncy this object is. 1 = rebounds perfectly, <1 = eventually will stop, >1 = will bounce more each time. Defaults to 0.7.\n "); +static PyMethodDef __pyx_mdef_10collisions_5Point_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Point___init__}; +static PyObject *__pyx_pw_10collisions_5Point_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -26969,18 +27321,20 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_othershape = 0; + PyObject *__pyx_v_x = 0; + PyObject *__pyx_v_y = 0; + double __pyx_v_bounciness; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[2] = {0,0}; + PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_where (wrapper)", 0); + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -26990,10 +27344,15 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_othershape,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_bounciness,0}; + __pyx_defaults6 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); @@ -27008,35 +27367,63 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 758, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 751, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_othershape)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 758, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 751, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); __PYX_ERR(0, 751, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 751, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, 1); __PYX_ERR(0, 758, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); __PYX_ERR(0, 751, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bounciness); + if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 751, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_where") < 0)) __PYX_ERR(0, 758, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 751, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 2)) { - goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } } __pyx_v_self = values[0]; - __pyx_v_othershape = values[1]; + __pyx_v_x = values[1]; + __pyx_v_y = values[2]; + if (values[3]) { + __pyx_v_bounciness = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_bounciness == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 751, __pyx_L3_error) + } else { + __pyx_v_bounciness = __pyx_dynamic_args->__pyx_arg_bounciness; + } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 758, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 751, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -27046,11 +27433,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Point._where", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Point.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Point_10_where(__pyx_self, __pyx_v_self, __pyx_v_othershape); + __pyx_r = __pyx_pf_10collisions_5Point___init__(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_y, __pyx_v_bounciness); /* function exit code */ { @@ -27063,7 +27450,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Point_10_where(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { +static PyObject *__pyx_pf_10collisions_5Point___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, double __pyx_v_bounciness) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -27071,177 +27458,95 @@ static PyObject *__pyx_pf_10collisions_5Point_10_where(CYTHON_UNUSED PyObject *_ PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_where", 1); + __Pyx_RefNannySetupContext("__init__", 1); - /* "collisions.py":759 + /* "collisions.py":758 + * bounciness (float, optional): How bouncy this object is. 1 = rebounds perfectly, <1 = eventually will stop, >1 = will bounce more each time. Defaults to 0.7. + * """ + * super().__init__(bounciness) # <<<<<<<<<<<<<< + * self.x, self.y = x, y * - * def _where(self, othershape: Shape) -> Iterable[pointLike]: - * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< - * return [[self.x, self.y]] if (self.x == othershape.x and self.y == othershape.y) else [] - * return othershape._where(self) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 759, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 759, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_GetClassObj(__pyx_self); + if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 758, __pyx_L1_error) } + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 758, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 759, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 758, __pyx_L1_error); + __Pyx_INCREF(__pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(0, 758, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 758, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 758, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 758, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (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); + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); + __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_othershape, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 759, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 759, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_6) { - - /* "collisions.py":760 - * def _where(self, othershape: Shape) -> Iterable[pointLike]: - * if checkShpType(othershape, ShpTyps.Point): - * return [[self.x, self.y]] if (self.x == othershape.x and self.y == othershape.y) else [] # <<<<<<<<<<<<<< - * return othershape._where(self) - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 760, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 760, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_7) { - } else { - __pyx_t_6 = __pyx_t_7; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 760, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 758, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 760, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __pyx_t_7; - __pyx_L4_bool_binop_done:; - if (__pyx_t_6) { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 760, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 760, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 760, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_t_4 = 0; - __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 760, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_1 = __pyx_t_4; - __pyx_t_4 = 0; - } else { - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 760, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __pyx_t_4; - __pyx_t_4 = 0; - } - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "collisions.py":759 - * - * def _where(self, othershape: Shape) -> Iterable[pointLike]: - * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< - * return [[self.x, self.y]] if (self.x == othershape.x and self.y == othershape.y) else [] - * return othershape._where(self) - */ } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":761 - * if checkShpType(othershape, ShpTyps.Point): - * return [[self.x, self.y]] if (self.x == othershape.x and self.y == othershape.y) else [] - * return othershape._where(self) # <<<<<<<<<<<<<< + /* "collisions.py":759 + * """ + * super().__init__(bounciness) + * self.x, self.y = x, y # <<<<<<<<<<<<<< * - * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike, Iterable[pointLike]]: + * def rect(self) -> Iterable[Number]: */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_where); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 761, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 761, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_1 = __pyx_v_x; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_v_y; + __Pyx_INCREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_1) < 0) __PYX_ERR(0, 759, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_3) < 0) __PYX_ERR(0, 759, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":758 - * return othershape._collides(self) - * - * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * if checkShpType(othershape, ShpTyps.Point): - * return [[self.x, self.y]] if (self.x == othershape.x and self.y == othershape.y) else [] + /* "collisions.py":751 + * TYPE = ShpTyps.Point + * """An infintesimally small point in space defined by an x and y coordinate.""" + * def __init__(self, x: Number, y: Number, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< + * """ + * Args: */ /* 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_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("collisions.Point._where", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Point.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -27249,25 +27554,25 @@ static PyObject *__pyx_pf_10collisions_5Point_10_where(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":763 - * return othershape._where(self) +/* "collisions.py":761 + * self.x, self.y = x, y * - * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike, Iterable[pointLike]]: # <<<<<<<<<<<<<< + * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ - * Finds the closest point ON this object TO the other shape + * Returns the rectangle bounding box surrounding this point. */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Point_13closestPointTo(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Point_3rect(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_5Point_12closestPointTo, "\n Finds the closest point ON this object TO the other shape\n\n Args:\n othershape (Shape): The other shape to find the closest point towards\n returnAll (bool, optional): Whether to return ALL the possible options in order of closeness (True) or just the closest (False). Defaults to False.\n\n Returns:\n pointLike / Iterable[pointLike]: The closest points ON this object TO the other object\n "); -static PyMethodDef __pyx_mdef_10collisions_5Point_13closestPointTo = {"closestPointTo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_13closestPointTo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Point_12closestPointTo}; -static PyObject *__pyx_pw_10collisions_5Point_13closestPointTo(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_5Point_2rect, "\n Returns the rectangle bounding box surrounding this point.\n\n Returns:\n Iterable[Number]: (min x, min y, max x, max y)\n "); +static PyMethodDef __pyx_mdef_10collisions_5Point_3rect = {"rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_3rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Point_2rect}; +static PyObject *__pyx_pw_10collisions_5Point_3rect(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -27275,19 +27580,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - CYTHON_UNUSED PyObject *__pyx_v_othershape = 0; - PyObject *__pyx_v_returnAll = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[3] = {0,0,0}; + PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("closestPointTo (wrapper)", 0); + __Pyx_RefNannySetupContext("rect (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -27297,15 +27600,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_othershape,&__pyx_n_s_returnAll,0}; - values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; @@ -27318,47 +27616,23 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 763, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 761, __pyx_L3_error) else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_othershape)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 763, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, 1); __PYX_ERR(0, 763, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_returnAll); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 763, __pyx_L3_error) - } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "closestPointTo") < 0)) __PYX_ERR(0, 763, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rect") < 0)) __PYX_ERR(0, 761, __pyx_L3_error) } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; } else { - switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } __pyx_v_self = values[0]; - __pyx_v_othershape = values[1]; - __pyx_v_returnAll = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 763, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 761, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -27368,11 +27642,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Point.closestPointTo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Point.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Point_12closestPointTo(__pyx_self, __pyx_v_self, __pyx_v_othershape, __pyx_v_returnAll); + __pyx_r = __pyx_pf_10collisions_5Point_2rect(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -27385,104 +27659,69 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Point_12closestPointTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_othershape, PyObject *__pyx_v_returnAll) { +static PyObject *__pyx_pf_10collisions_5Point_2rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - int __pyx_t_1; + PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("closestPointTo", 1); - - /* "collisions.py":774 - * pointLike / Iterable[pointLike]: The closest points ON this object TO the other object - * """ - * if returnAll: # <<<<<<<<<<<<<< - * return [(self.x, self.y)] - * return (self.x, self.y) - */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 774, __pyx_L1_error) - if (__pyx_t_1) { - - /* "collisions.py":775 - * """ - * if returnAll: - * return [(self.x, self.y)] # <<<<<<<<<<<<<< - * return (self.x, self.y) - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 775, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 775, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 775, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 775, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 775, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 775, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 775, __pyx_L1_error); - __pyx_t_4 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; + __Pyx_RefNannySetupContext("rect", 1); - /* "collisions.py":774 - * pointLike / Iterable[pointLike]: The closest points ON this object TO the other object + /* "collisions.py":768 + * Iterable[Number]: (min x, min y, max x, max y) * """ - * if returnAll: # <<<<<<<<<<<<<< - * return [(self.x, self.y)] - * return (self.x, self.y) - */ - } - - /* "collisions.py":776 - * if returnAll: - * return [(self.x, self.y)] - * return (self.x, self.y) # <<<<<<<<<<<<<< + * return self.x, self.y, self.x, self.y # <<<<<<<<<<<<<< * - * def getTuple(self) -> tuple[Number]: + * def area(self) -> Number: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 776, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 776, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 776, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 768, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(0, 768, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 776, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3)) __PYX_ERR(0, 768, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4)) __PYX_ERR(0, 776, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4)) __PYX_ERR(0, 768, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; - /* "collisions.py":763 - * return othershape._where(self) + /* "collisions.py":761 + * self.x, self.y = x, y * - * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike, Iterable[pointLike]]: # <<<<<<<<<<<<<< + * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ - * Finds the closest point ON this object TO the other shape + * Returns the rectangle bounding box surrounding this point. */ /* function exit code */ __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("collisions.Point.closestPointTo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("collisions.Point.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -27490,32 +27729,32 @@ static PyObject *__pyx_pf_10collisions_5Point_12closestPointTo(CYTHON_UNUSED PyO return __pyx_r; } -/* "collisions.py":778 - * return (self.x, self.y) +/* "collisions.py":770 + * return self.x, self.y, self.x, self.y * - * def getTuple(self) -> tuple[Number]: # <<<<<<<<<<<<<< + * def area(self) -> Number: # <<<<<<<<<<<<<< * """ - * Gets this object in a tuple format: (x, y). + * Gets the area of the shape; 0. */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Point_15getTuple(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Point_5area(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_5Point_14getTuple, "\n Gets this object in a tuple format: (x, y).\n Do you get the point?\n "); -static PyMethodDef __pyx_mdef_10collisions_5Point_15getTuple = {"getTuple", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_15getTuple, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Point_14getTuple}; -static PyObject *__pyx_pw_10collisions_5Point_15getTuple(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_5Point_4area, "\n Gets the area of the shape; 0.\n\n Returns:\n Number: The area of the shape\n "); +static PyMethodDef __pyx_mdef_10collisions_5Point_5area = {"area", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_5area, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Point_4area}; +static PyObject *__pyx_pw_10collisions_5Point_5area(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_self = 0; + CYTHON_UNUSED PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -27526,7 +27765,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("getTuple (wrapper)", 0); + __Pyx_RefNannySetupContext("area (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -27552,12 +27791,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 778, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 770, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getTuple") < 0)) __PYX_ERR(0, 778, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "area") < 0)) __PYX_ERR(0, 770, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -27568,7 +27807,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("getTuple", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 778, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 770, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -27578,11 +27817,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Point.getTuple", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Point.area", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Point_14getTuple(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_5Point_4area(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -27595,99 +27834,75 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Point_14getTuple(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_5Point_4area(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__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("getTuple", 1); + __Pyx_RefNannySetupContext("area", 1); - /* "collisions.py":783 - * Do you get the point? + /* "collisions.py":777 + * Number: The area of the shape * """ - * return (self.x, self.y) # <<<<<<<<<<<<<< + * return 0.0 # <<<<<<<<<<<<<< * - * def _contains(self, othershape: Shape) -> bool: + * def toPoints(self) -> Iterable[pointLike]: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 783, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 783, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_2 = 0; - __pyx_r = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; + __Pyx_INCREF(__pyx_float_0_0); + __pyx_r = __pyx_float_0_0; goto __pyx_L0; - /* "collisions.py":778 - * return (self.x, self.y) + /* "collisions.py":770 + * return self.x, self.y, self.x, self.y * - * def getTuple(self) -> tuple[Number]: # <<<<<<<<<<<<<< + * def area(self) -> Number: # <<<<<<<<<<<<<< * """ - * Gets this object in a tuple format: (x, y). + * Gets the area of the shape; 0. */ /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("collisions.Point.getTuple", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":785 - * return (self.x, self.y) - * - * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * return False +/* "collisions.py":779 + * return 0.0 * + * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< + * """ + * Returns: */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Point_17_contains(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Point_7toPoints(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_5Point_17_contains = {"_contains", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_17_contains, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_5Point_17_contains(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_5Point_6toPoints, "\n Returns:\n Iterable[pointLike]: Get a list of all the Points that make up this object; i.e. just this one point.\n "); +static PyMethodDef __pyx_mdef_10collisions_5Point_7toPoints = {"toPoints", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_7toPoints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Point_6toPoints}; +static PyObject *__pyx_pw_10collisions_5Point_7toPoints(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - CYTHON_UNUSED PyObject *__pyx_v_self = 0; - CYTHON_UNUSED PyObject *__pyx_v_othershape = 0; + PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[2] = {0,0}; + PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_contains (wrapper)", 0); + __Pyx_RefNannySetupContext("toPoints (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -27697,12 +27912,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_othershape,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; @@ -27715,35 +27928,23 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 785, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 779, __pyx_L3_error) else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_othershape)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 785, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, 1); __PYX_ERR(0, 785, __pyx_L3_error) - } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_contains") < 0)) __PYX_ERR(0, 785, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toPoints") < 0)) __PYX_ERR(0, 779, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 2)) { + } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; - __pyx_v_othershape = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 785, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("toPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 779, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -27753,11 +27954,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Point._contains", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Point.toPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Point_16_contains(__pyx_self, __pyx_v_self, __pyx_v_othershape); + __pyx_r = __pyx_pf_10collisions_5Point_6toPoints(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -27770,146 +27971,88 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Point_16_contains(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_othershape) { +static PyObject *__pyx_pf_10collisions_5Point_6toPoints(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_contains", 1); + PyObject *__pyx_t_1 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("toPoints", 1); - /* "collisions.py":786 - * - * def _contains(self, othershape: Shape) -> bool: - * return False # <<<<<<<<<<<<<< + /* "collisions.py":784 + * Iterable[pointLike]: Get a list of all the Points that make up this object; i.e. just this one point. + * """ + * return [self] # <<<<<<<<<<<<<< * - * def handleCollisionsPos(self, + * def _collides(self, othershape: Shape) -> bool: */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 784, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_self)) __PYX_ERR(0, 784, __pyx_L1_error); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":785 - * return (self.x, self.y) - * - * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * return False + /* "collisions.py":779 + * return 0.0 * + * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< + * """ + * Returns: */ /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("collisions.Point.toPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":788 - * return False +/* "collisions.py":786 + * return [self] * - * def handleCollisionsPos(self, # <<<<<<<<<<<<<< - * oldPoint: Union['Point',pointLike], - * newPoint: Union['Point', pointLike], + * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Point): + * return self.x == othershape.x and self.y == othershape.y */ -static PyObject *__pyx_pf_10collisions_30__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { - PyObject *__pyx_r = NULL; - __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("__defaults__", 1); - __Pyx_XDECREF(__pyx_r); - - /* "collisions.py":795 - * replaceSelf: bool = True, - * precision: Number = BASEPRECISION, - * verbose: bool = False # <<<<<<<<<<<<<< - * ) -> tuple[pointLike, pointLike, verboseOutput]: - * """ - */ - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 788, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg_vel); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg_vel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg_vel)) __PYX_ERR(0, 788, __pyx_L1_error); - __Pyx_INCREF(((PyObject *)Py_True)); - __Pyx_GIVEREF(((PyObject *)Py_True)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_True))) __PYX_ERR(0, 788, __pyx_L1_error); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg_precision); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 788, __pyx_L1_error); - __Pyx_INCREF(((PyObject *)Py_False)); - __Pyx_GIVEREF(((PyObject *)Py_False)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)Py_False))) __PYX_ERR(0, 788, __pyx_L1_error); - - /* "collisions.py":788 - * return False - * - * def handleCollisionsPos(self, # <<<<<<<<<<<<<< - * oldPoint: Union['Point',pointLike], - * newPoint: Union['Point', pointLike], - */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 788, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 788, __pyx_L1_error); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 788, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("collisions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Point_19handleCollisionsPos(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_5Point_18handleCollisionsPos, "\n Handles movement of this point and it bouncing off of other objects.\n It is recommended you use `.handleCollisionsVel` instead of this, as it handles velocity instead of raw movement and is easier to use.\n\n But if you are to use this, remember to still provide the vel param. It will sometimes provide weird results if you don't.\n It could even just be the difference in positions, it just needs to be something realistic.\n\n Args:\n oldPoint (Point / pointLike): The old position of this object.\n newPoint (Point / pointLike): The new position of this object.\n objs (Shapes / Iterable[Shape]): The objects this will bounce off.\n vel (pointLike, optional): The velocity that this object is going. Defaults to [0, 0].\n replaceSelf (bool, optional): Whether to replace self.x and self.y with the new position of the object after bouncing or not. Defaults to True.\n precision (Number, optional): The decimal places to round to to check (for things like corner checking). Defaults to 5.\n verbose (bool, optional): Whether to give verbose output or not. Defaults to False.\n\n Returns:\n tuple[pointLike, pointLike, veboseOutput?]: The new position and vel of this object respectively, and if verbose then the verboseOutput.\n \n VerboseOutput:\n DidReflect (bool): Whether the line reflected off of something\n "); -static PyMethodDef __pyx_mdef_10collisions_5Point_19handleCollisionsPos = {"handleCollisionsPos", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_19handleCollisionsPos, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Point_18handleCollisionsPos}; -static PyObject *__pyx_pw_10collisions_5Point_19handleCollisionsPos(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_oldPoint = 0; - PyObject *__pyx_v_newPoint = 0; - PyObject *__pyx_v_objs = 0; - PyObject *__pyx_v_vel = 0; - PyObject *__pyx_v_replaceSelf = 0; - PyObject *__pyx_v_precision = 0; - PyObject *__pyx_v_verbose = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[8] = {0,0,0,0,0,0,0,0}; +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_5Point_9_collides(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_10collisions_5Point_9_collides = {"_collides", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_9_collides, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_5Point_9_collides(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_othershape = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("handleCollisionsPos (wrapper)", 0); + __Pyx_RefNannySetupContext("_collides (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -27919,27 +28062,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_oldPoint,&__pyx_n_s_newPoint,&__pyx_n_s_objs,&__pyx_n_s_vel,&__pyx_n_s_replaceSelf,&__pyx_n_s_precision,&__pyx_n_s_verbose,0}; - __pyx_defaults6 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_self); - values[4] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_vel); - values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); - values[6] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_precision); - values[7] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_othershape,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - CYTHON_FALLTHROUGH; - case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - CYTHON_FALLTHROUGH; - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); @@ -27954,101 +28080,35 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 788, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 786, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_oldPoint)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_othershape)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 788, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 786, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 1); __PYX_ERR(0, 788, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_newPoint)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 788, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 2); __PYX_ERR(0, 788, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_objs)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 788, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 3); __PYX_ERR(0, 788, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vel); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 788, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 5: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_replaceSelf); - if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 788, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 6: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_precision); - if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 788, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 7: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_verbose); - if (value) { values[7] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 788, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 786, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "handleCollisionsPos") < 0)) __PYX_ERR(0, 788, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_collides") < 0)) __PYX_ERR(0, 786, __pyx_L3_error) } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; } else { - switch (__pyx_nargs) { - case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - CYTHON_FALLTHROUGH; - case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - CYTHON_FALLTHROUGH; - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; - __pyx_v_oldPoint = values[1]; - __pyx_v_newPoint = values[2]; - __pyx_v_objs = values[3]; - __pyx_v_vel = values[4]; - __pyx_v_replaceSelf = values[5]; - __pyx_v_precision = values[6]; - __pyx_v_verbose = values[7]; + __pyx_v_othershape = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, __pyx_nargs); __PYX_ERR(0, 788, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 786, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -28058,11 +28118,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Point.handleCollisionsPos", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Point._collides", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Point_18handleCollisionsPos(__pyx_self, __pyx_v_self, __pyx_v_oldPoint, __pyx_v_newPoint, __pyx_v_objs, __pyx_v_vel, __pyx_v_replaceSelf, __pyx_v_precision, __pyx_v_verbose); + __pyx_r = __pyx_pf_10collisions_5Point_8_collides(__pyx_self, __pyx_v_self, __pyx_v_othershape); /* function exit code */ { @@ -28075,42 +28135,204 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "collisions.py":833 - * return oldPoint, [0, 0], [True] - * return oldPoint, [0, 0] - * points.sort(key=lambda x: abs(x[0][0]-oldPoint[0])**2+abs(x[0][1]-oldPoint[1])**2) # <<<<<<<<<<<<<< - * closestP = points[0][0] - * closestObj = points[0][1] +static PyObject *__pyx_pf_10collisions_5Point_8_collides(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + unsigned int __pyx_t_5; + int __pyx_t_6; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_collides", 1); + + /* "collisions.py":787 + * + * def _collides(self, othershape: Shape) -> bool: + * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< + * return self.x == othershape.x and self.y == othershape.y + * return othershape._collides(self) + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 787, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 787, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 787, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (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); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_othershape, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 787, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 787, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + + /* "collisions.py":788 + * def _collides(self, othershape: Shape) -> bool: + * if checkShpType(othershape, ShpTyps.Point): + * return self.x == othershape.x and self.y == othershape.y # <<<<<<<<<<<<<< + * return othershape._collides(self) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 788, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 788, __pyx_L1_error) + if (__pyx_t_6) { + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } else { + __Pyx_INCREF(__pyx_t_3); + __pyx_t_1 = __pyx_t_3; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 788, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_L4_bool_binop_done:; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "collisions.py":787 + * + * def _collides(self, othershape: Shape) -> bool: + * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< + * return self.x == othershape.x and self.y == othershape.y + * return othershape._collides(self) + */ + } + + /* "collisions.py":789 + * if checkShpType(othershape, ShpTyps.Point): + * return self.x == othershape.x and self.y == othershape.y + * return othershape._collides(self) # <<<<<<<<<<<<<< + * + * def _where(self, othershape: Shape) -> Iterable[pointLike]: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 789, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(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; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_self}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 789, __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; + + /* "collisions.py":786 + * return [self] + * + * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Point): + * return self.x == othershape.x and self.y == othershape.y + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("collisions.Point._collides", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":791 + * return othershape._collides(self) + * + * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Point): + * return [[self.x, self.y]] if (self.x == othershape.x and self.y == othershape.y) else [] */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Point_19handleCollisionsPos_lambda6(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Point_11_where(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_5Point_19handleCollisionsPos_lambda6 = {"lambda6", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_19handleCollisionsPos_lambda6, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_5Point_19handleCollisionsPos_lambda6(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_5Point_11_where = {"_where", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_11_where, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_5Point_11_where(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_x = 0; + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_othershape = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; + PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lambda6 (wrapper)", 0); + __Pyx_RefNannySetupContext("_where (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -28120,10 +28342,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_othershape,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; @@ -28132,27 +28356,39 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 833, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 791, __pyx_L3_error) else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_othershape)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 791, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, 1); __PYX_ERR(0, 791, __pyx_L3_error) + } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda6") < 0)) __PYX_ERR(0, 833, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_where") < 0)) __PYX_ERR(0, 791, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 1)) { + } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } - __pyx_v_x = values[0]; + __pyx_v_self = values[0]; + __pyx_v_othershape = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 833, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 791, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -28162,11 +28398,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Point.handleCollisionsPos.lambda6", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Point._where", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_lambda_funcdef_lambda6(__pyx_self, __pyx_v_x); + __pyx_r = __pyx_pf_10collisions_5Point_10_where(__pyx_self, __pyx_v_self, __pyx_v_othershape); /* function exit code */ { @@ -28179,154 +28415,37 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_lambda_funcdef_lambda6(PyObject *__pyx_self, PyObject *__pyx_v_x) { - struct __pyx_obj_10collisions___pyx_scope_struct_6_handleCollisionsPos *__pyx_cur_scope; - struct __pyx_obj_10collisions___pyx_scope_struct_6_handleCollisionsPos *__pyx_outer_scope; +static PyObject *__pyx_pf_10collisions_5Point_10_where(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("lambda6", 1); - __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_6_handleCollisionsPos *) __Pyx_CyFunction_GetClosure(__pyx_self); - __pyx_cur_scope = __pyx_outer_scope; - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_v_oldPoint)) { __Pyx_RaiseClosureNameError("oldPoint"); __PYX_ERR(0, 833, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_oldPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_v_oldPoint)) { __Pyx_RaiseClosureNameError("oldPoint"); __PYX_ERR(0, 833, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_oldPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("collisions.Point.handleCollisionsPos.lambda6", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "collisions.py":788 - * return False - * - * def handleCollisionsPos(self, # <<<<<<<<<<<<<< - * oldPoint: Union['Point',pointLike], - * newPoint: Union['Point', pointLike], - */ - -static PyObject *__pyx_pf_10collisions_5Point_18handleCollisionsPos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_oldPoint, PyObject *__pyx_v_newPoint, PyObject *__pyx_v_objs, PyObject *__pyx_v_vel, PyObject *__pyx_v_replaceSelf, PyObject *__pyx_v_precision, PyObject *__pyx_v_verbose) { - struct __pyx_obj_10collisions___pyx_scope_struct_6_handleCollisionsPos *__pyx_cur_scope; - PyObject *__pyx_v_mvement = NULL; - PyObject *__pyx_v_points = NULL; - PyObject *__pyx_v_o = NULL; - PyObject *__pyx_v_cs = NULL; - PyObject *__pyx_v_closestP = NULL; - PyObject *__pyx_v_closestObj = NULL; - PyObject *__pyx_v_t = NULL; - PyObject *__pyx_v_normal = NULL; - PyObject *__pyx_v_dist_left = NULL; - PyObject *__pyx_v_x = NULL; - PyObject *__pyx_v_y = NULL; - PyObject *__pyx_v_phi = NULL; - PyObject *__pyx_v_diff = NULL; - PyObject *__pyx_v_pos = NULL; - PyObject *__pyx_v_smallness = NULL; - PyObject *__pyx_v_out = NULL; - PyObject *__pyx_v_outvel = NULL; - CYTHON_UNUSED Py_ssize_t __pyx_9genexpr14__pyx_v__; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - unsigned int __pyx_t_4; - int __pyx_t_5; + unsigned int __pyx_t_5; int __pyx_t_6; - Py_ssize_t __pyx_t_7; - PyObject *(*__pyx_t_8)(PyObject *); - PyObject *__pyx_t_9 = NULL; - Py_ssize_t __pyx_t_10; - Py_ssize_t __pyx_t_11; - Py_ssize_t __pyx_t_12; - int __pyx_t_13; - PyObject *__pyx_t_14 = NULL; - PyObject *__pyx_t_15 = NULL; - PyObject *(*__pyx_t_16)(PyObject *); + int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("handleCollisionsPos", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_6_handleCollisionsPos *)__pyx_tp_new_10collisions___pyx_scope_struct_6_handleCollisionsPos(__pyx_ptype_10collisions___pyx_scope_struct_6_handleCollisionsPos, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_6_handleCollisionsPos *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 788, __pyx_L1_error) - } else { - __Pyx_GOTREF((PyObject *)__pyx_cur_scope); - } - __pyx_cur_scope->__pyx_v_oldPoint = __pyx_v_oldPoint; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_oldPoint); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_oldPoint); - __Pyx_INCREF(__pyx_v_vel); + __Pyx_RefNannySetupContext("_where", 1); - /* "collisions.py":819 - * DidReflect (bool): Whether the line reflected off of something - * """ - * mvement = Line(oldPoint, newPoint) # <<<<<<<<<<<<<< - * if not mvement.collides(objs): - * if verbose: + /* "collisions.py":792 + * + * def _where(self, othershape: Shape) -> Iterable[pointLike]: + * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< + * return [[self.x, self.y]] if (self.x == othershape.x and self.y == othershape.y) else [] + * return othershape._where(self) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 819, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 792, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 792, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; - __pyx_t_4 = 0; + __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_2))) { __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); @@ -28335,1142 +28454,712 @@ static PyObject *__pyx_pf_10collisions_5Point_18handleCollisionsPos(CYTHON_UNUSE __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; + __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_oldPoint, __pyx_v_newPoint}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_othershape, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 819, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_v_mvement = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 792, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { - /* "collisions.py":820 - * """ - * mvement = Line(oldPoint, newPoint) - * if not mvement.collides(objs): # <<<<<<<<<<<<<< - * if verbose: - * return newPoint, vel, [False] + /* "collisions.py":793 + * def _where(self, othershape: Shape) -> Iterable[pointLike]: + * if checkShpType(othershape, ShpTyps.Point): + * return [[self.x, self.y]] if (self.x == othershape.x and self.y == othershape.y) else [] # <<<<<<<<<<<<<< + * return othershape._where(self) + * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_mvement, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 820, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(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); - __pyx_t_4 = 1; + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_7) { + } else { + __pyx_t_6 = __pyx_t_7; + goto __pyx_L4_bool_binop_done; } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_objs}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 820, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 793, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 820, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = (!__pyx_t_5); - if (__pyx_t_6) { - - /* "collisions.py":821 - * mvement = Line(oldPoint, newPoint) - * if not mvement.collides(objs): - * if verbose: # <<<<<<<<<<<<<< - * return newPoint, vel, [False] - * return newPoint, vel - */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 821, __pyx_L1_error) + __pyx_t_6 = __pyx_t_7; + __pyx_L4_bool_binop_done:; if (__pyx_t_6) { - - /* "collisions.py":822 - * if not mvement.collides(objs): - * if verbose: - * return newPoint, vel, [False] # <<<<<<<<<<<<<< - * return newPoint, vel - * points = [] - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 822, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(Py_False); - __Pyx_GIVEREF(Py_False); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, Py_False)) __PYX_ERR(0, 822, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 822, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 793, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_newPoint); - __Pyx_GIVEREF(__pyx_v_newPoint); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_newPoint)) __PYX_ERR(0, 822, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_vel); - __Pyx_GIVEREF(__pyx_v_vel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_vel)) __PYX_ERR(0, 822, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1)) __PYX_ERR(0, 822, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_r = ((PyObject*)__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 793, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_4)) __PYX_ERR(0, 793, __pyx_L1_error); __pyx_t_2 = 0; - goto __pyx_L0; - - /* "collisions.py":821 - * mvement = Line(oldPoint, newPoint) - * if not mvement.collides(objs): - * if verbose: # <<<<<<<<<<<<<< - * return newPoint, vel, [False] - * return newPoint, vel - */ + __pyx_t_4 = 0; + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 793, __pyx_L1_error); + __pyx_t_3 = 0; + __pyx_t_1 = __pyx_t_4; + __pyx_t_4 = 0; + } else { + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 793, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __pyx_t_4; + __pyx_t_4 = 0; } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "collisions.py":823 - * if verbose: - * return newPoint, vel, [False] - * return newPoint, vel # <<<<<<<<<<<<<< - * points = [] - * for o in objs: + /* "collisions.py":792 + * + * def _where(self, othershape: Shape) -> Iterable[pointLike]: + * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< + * return [[self.x, self.y]] if (self.x == othershape.x and self.y == othershape.y) else [] + * return othershape._where(self) */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_newPoint); - __Pyx_GIVEREF(__pyx_v_newPoint); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_newPoint)) __PYX_ERR(0, 823, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_vel); - __Pyx_GIVEREF(__pyx_v_vel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_vel)) __PYX_ERR(0, 823, __pyx_L1_error); - __pyx_r = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - goto __pyx_L0; + } - /* "collisions.py":820 - * """ - * mvement = Line(oldPoint, newPoint) - * if not mvement.collides(objs): # <<<<<<<<<<<<<< - * if verbose: - * return newPoint, vel, [False] + /* "collisions.py":794 + * if checkShpType(othershape, ShpTyps.Point): + * return [[self.x, self.y]] if (self.x == othershape.x and self.y == othershape.y) else [] + * return othershape._where(self) # <<<<<<<<<<<<<< + * + * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike, Iterable[pointLike]]: */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_where); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 794, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 794, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "collisions.py":824 - * return newPoint, vel, [False] - * return newPoint, vel - * points = [] # <<<<<<<<<<<<<< - * for o in objs: - * cs = o.whereCollides(mvement) + /* "collisions.py":791 + * return othershape._collides(self) + * + * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Point): + * return [[self.x, self.y]] if (self.x == othershape.x and self.y == othershape.y) else [] */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 824, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_points = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - /* "collisions.py":825 - * return newPoint, vel - * points = [] - * for o in objs: # <<<<<<<<<<<<<< - * cs = o.whereCollides(mvement) - * points.extend(list(zip(cs, [o for _ in range(len(cs))]))) + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("collisions.Point._where", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":796 + * return othershape._where(self) + * + * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike, Iterable[pointLike]]: # <<<<<<<<<<<<<< + * """ + * Finds the closest point ON this object TO the other shape */ - if (likely(PyList_CheckExact(__pyx_v_objs)) || PyTuple_CheckExact(__pyx_v_objs)) { - __pyx_t_2 = __pyx_v_objs; __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_objs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 825, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 825, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_8)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 825, __pyx_L1_error) - #endif - if (__pyx_t_7 >= __pyx_temp) break; + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_5Point_13closestPointTo(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_10collisions_5Point_12closestPointTo, "\n Finds the closest point ON this object TO the other shape\n\n Args:\n othershape (Shape): The other shape to find the closest point towards\n returnAll (bool, optional): Whether to return ALL the possible options in order of closeness (True) or just the closest (False). Defaults to False.\n\n Returns:\n pointLike / Iterable[pointLike]: The closest points ON this object TO the other object\n "); +static PyMethodDef __pyx_mdef_10collisions_5Point_13closestPointTo = {"closestPointTo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_13closestPointTo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Point_12closestPointTo}; +static PyObject *__pyx_pw_10collisions_5Point_13closestPointTo(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + CYTHON_UNUSED PyObject *__pyx_v_othershape = 0; + PyObject *__pyx_v_returnAll = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("closestPointTo (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_othershape,&__pyx_n_s_returnAll,0}; + values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 825, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 825, __pyx_L1_error) - #endif - if (__pyx_t_7 >= __pyx_temp) break; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 796, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_othershape)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 825, __pyx_L1_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - #endif + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 796, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, 1); __PYX_ERR(0, 796, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_returnAll); + if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 796, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "closestPointTo") < 0)) __PYX_ERR(0, 796, __pyx_L3_error) } } else { - __pyx_t_1 = __pyx_t_8(__pyx_t_2); - if (unlikely(!__pyx_t_1)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 825, __pyx_L1_error) - } + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; - } - __Pyx_GOTREF(__pyx_t_1); - } - __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_1); - __pyx_t_1 = 0; - - /* "collisions.py":826 - * points = [] - * for o in objs: - * cs = o.whereCollides(mvement) # <<<<<<<<<<<<<< - * points.extend(list(zip(cs, [o for _ in range(len(cs))]))) - * # Don't let you move when you're in a wall - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 826, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_4 = 1; + default: goto __pyx_L5_argtuple_error; } } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_mvement}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 826, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_self = values[0]; + __pyx_v_othershape = values[1]; + __pyx_v_returnAll = values[2]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 796, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } - __Pyx_XDECREF_SET(__pyx_v_cs, __pyx_t_1); - __pyx_t_1 = 0; - - /* "collisions.py":827 - * for o in objs: - * cs = o.whereCollides(mvement) - * points.extend(list(zip(cs, [o for _ in range(len(cs))]))) # <<<<<<<<<<<<<< - * # Don't let you move when you're in a wall - * if points == []: - */ - { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = PyObject_Length(__pyx_v_cs); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 827, __pyx_L1_error) - __pyx_t_11 = __pyx_t_10; - for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { - __pyx_9genexpr14__pyx_v__ = __pyx_t_12; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_v_o))) __PYX_ERR(0, 827, __pyx_L1_error) - } - } /* exit inner scope */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_cs); - __Pyx_GIVEREF(__pyx_v_cs); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_cs)) __PYX_ERR(0, 827, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 827, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_13 = __Pyx_PyList_Extend(__pyx_v_points, __pyx_t_3); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "collisions.py":825 - * return newPoint, vel - * points = [] - * for o in objs: # <<<<<<<<<<<<<< - * cs = o.whereCollides(mvement) - * points.extend(list(zip(cs, [o for _ in range(len(cs))]))) - */ } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "collisions.py":829 - * points.extend(list(zip(cs, [o for _ in range(len(cs))]))) - * # Don't let you move when you're in a wall - * if points == []: # <<<<<<<<<<<<<< - * if verbose: - * return oldPoint, [0, 0], [True] - */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_points, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { + __Pyx_AddTraceback("collisions.Point.closestPointTo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_5Point_12closestPointTo(__pyx_self, __pyx_v_self, __pyx_v_othershape, __pyx_v_returnAll); - /* "collisions.py":830 - * # Don't let you move when you're in a wall - * if points == []: - * if verbose: # <<<<<<<<<<<<<< - * return oldPoint, [0, 0], [True] - * return oldPoint, [0, 0] - */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 830, __pyx_L1_error) - if (__pyx_t_6) { + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "collisions.py":831 - * if points == []: - * if verbose: - * return oldPoint, [0, 0], [True] # <<<<<<<<<<<<<< - * return oldPoint, [0, 0] - * points.sort(key=lambda x: abs(x[0][0]-oldPoint[0])**2+abs(x[0][1]-oldPoint[1])**2) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_0)) __PYX_ERR(0, 831, __pyx_L1_error); - __Pyx_INCREF(__pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_0)) __PYX_ERR(0, 831, __pyx_L1_error); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(Py_True); - __Pyx_GIVEREF(Py_True); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, Py_True)) __PYX_ERR(0, 831, __pyx_L1_error); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_oldPoint); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_oldPoint); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_oldPoint)) __PYX_ERR(0, 831, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 831, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_2)) __PYX_ERR(0, 831, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_2 = 0; - __pyx_r = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; - goto __pyx_L0; +static PyObject *__pyx_pf_10collisions_5Point_12closestPointTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_othershape, PyObject *__pyx_v_returnAll) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + int __pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("closestPointTo", 1); - /* "collisions.py":830 - * # Don't let you move when you're in a wall - * if points == []: - * if verbose: # <<<<<<<<<<<<<< - * return oldPoint, [0, 0], [True] - * return oldPoint, [0, 0] + /* "collisions.py":807 + * pointLike / Iterable[pointLike]: The closest points ON this object TO the other object + * """ + * if returnAll: # <<<<<<<<<<<<<< + * return [(self.x, self.y)] + * return (self.x, self.y) */ - } + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 807, __pyx_L1_error) + if (__pyx_t_1) { - /* "collisions.py":832 - * if verbose: - * return oldPoint, [0, 0], [True] - * return oldPoint, [0, 0] # <<<<<<<<<<<<<< - * points.sort(key=lambda x: abs(x[0][0]-oldPoint[0])**2+abs(x[0][1]-oldPoint[1])**2) - * closestP = points[0][0] + /* "collisions.py":808 + * """ + * if returnAll: + * return [(self.x, self.y)] # <<<<<<<<<<<<<< + * return (self.x, self.y) + * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0)) __PYX_ERR(0, 832, __pyx_L1_error); - __Pyx_INCREF(__pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_0)) __PYX_ERR(0, 832, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 832, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 808, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_oldPoint); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_oldPoint); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_oldPoint)) __PYX_ERR(0, 832, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 832, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_r = ((PyObject*)__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 808, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 808, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 808, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 808, __pyx_L1_error); __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 808, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 808, __pyx_L1_error); + __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":829 - * points.extend(list(zip(cs, [o for _ in range(len(cs))]))) - * # Don't let you move when you're in a wall - * if points == []: # <<<<<<<<<<<<<< - * if verbose: - * return oldPoint, [0, 0], [True] + /* "collisions.py":807 + * pointLike / Iterable[pointLike]: The closest points ON this object TO the other object + * """ + * if returnAll: # <<<<<<<<<<<<<< + * return [(self.x, self.y)] + * return (self.x, self.y) */ } - /* "collisions.py":833 - * return oldPoint, [0, 0], [True] - * return oldPoint, [0, 0] - * points.sort(key=lambda x: abs(x[0][0]-oldPoint[0])**2+abs(x[0][1]-oldPoint[1])**2) # <<<<<<<<<<<<<< - * closestP = points[0][0] - * closestObj = points[0][1] + /* "collisions.py":809 + * if returnAll: + * return [(self.x, self.y)] + * return (self.x, self.y) # <<<<<<<<<<<<<< + * + * def getTuple(self) -> tuple[Number]: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_points, __pyx_n_s_sort); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_19handleCollisionsPos_lambda6, 0, __pyx_n_s_Point_handleCollisionsPos_locals, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_t_3) < 0) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "collisions.py":834 - * return oldPoint, [0, 0] - * points.sort(key=lambda x: abs(x[0][0]-oldPoint[0])**2+abs(x[0][1]-oldPoint[1])**2) - * closestP = points[0][0] # <<<<<<<<<<<<<< - * closestObj = points[0][1] - * t = closestObj.tangent(closestP, vel) - */ - __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_points, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_closestP = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 809, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4)) __PYX_ERR(0, 809, __pyx_L1_error); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; - /* "collisions.py":835 - * points.sort(key=lambda x: abs(x[0][0]-oldPoint[0])**2+abs(x[0][1]-oldPoint[1])**2) - * closestP = points[0][0] - * closestObj = points[0][1] # <<<<<<<<<<<<<< - * t = closestObj.tangent(closestP, vel) - * normal = t-90 + /* "collisions.py":796 + * return othershape._where(self) + * + * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike, Iterable[pointLike]]: # <<<<<<<<<<<<<< + * """ + * Finds the closest point ON this object TO the other shape */ - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_points, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_closestObj = __pyx_t_3; - __pyx_t_3 = 0; - /* "collisions.py":836 - * closestP = points[0][0] - * closestObj = points[0][1] - * t = closestObj.tangent(closestP, vel) # <<<<<<<<<<<<<< - * normal = t-90 - * dist_left = math.hypot(newPoint[0]-closestP[0], newPoint[1]-closestP[1]) * closestObj.bounciness + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("collisions.Point.closestPointTo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":811 + * return (self.x, self.y) + * + * def getTuple(self) -> tuple[Number]: # <<<<<<<<<<<<<< + * """ + * Gets this object in a tuple format: (x, y). */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_tangent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_4 = 1; - } - } + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_5Point_15getTuple(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_10collisions_5Point_14getTuple, "\n Gets this object in a tuple format: (x, y).\n Do you get the point?\n "); +static PyMethodDef __pyx_mdef_10collisions_5Point_15getTuple = {"getTuple", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_15getTuple, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Point_14getTuple}; +static PyObject *__pyx_pw_10collisions_5Point_15getTuple(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("getTuple (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_closestP, __pyx_v_vel}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 811, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getTuple") < 0)) __PYX_ERR(0, 811, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_self = values[0]; } - __pyx_v_t = __pyx_t_3; - __pyx_t_3 = 0; - - /* "collisions.py":837 - * closestObj = points[0][1] - * t = closestObj.tangent(closestP, vel) - * normal = t-90 # <<<<<<<<<<<<<< - * dist_left = math.hypot(newPoint[0]-closestP[0], newPoint[1]-closestP[1]) * closestObj.bounciness - * x, y = oldPoint[0] - closestP[0], oldPoint[1] - closestP[1] - */ - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_t, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_v_normal = __pyx_t_3; - __pyx_t_3 = 0; - - /* "collisions.py":838 - * t = closestObj.tangent(closestP, vel) - * normal = t-90 - * dist_left = math.hypot(newPoint[0]-closestP[0], newPoint[1]-closestP[1]) * closestObj.bounciness # <<<<<<<<<<<<<< - * x, y = oldPoint[0] - closestP[0], oldPoint[1] - closestP[1] - * phi = math.degrees(math.atan2(y, x))+90 # Because we have to -90 due to issues and then +180 so it becomes +90 - */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_hypot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_newPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_14 = PyNumber_Subtract(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_newPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_15 = PyNumber_Subtract(__pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_4 = 1; + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("getTuple", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 811, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - #endif + __Pyx_AddTraceback("collisions.Point.getTuple", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_5Point_14getTuple(__pyx_self, __pyx_v_self); + + /* function exit code */ { - PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_14, __pyx_t_15}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = PyNumber_Multiply(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_dist_left = __pyx_t_15; - __pyx_t_15 = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "collisions.py":839 - * normal = t-90 - * dist_left = math.hypot(newPoint[0]-closestP[0], newPoint[1]-closestP[1]) * closestObj.bounciness - * x, y = oldPoint[0] - closestP[0], oldPoint[1] - closestP[1] # <<<<<<<<<<<<<< - * phi = math.degrees(math.atan2(y, x))+90 # Because we have to -90 due to issues and then +180 so it becomes +90 - * diff = (phi-normal) % 360 +static PyObject *__pyx_pf_10collisions_5Point_14getTuple(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("getTuple", 1); + + /* "collisions.py":816 + * Do you get the point? + * """ + * return (self.x, self.y) # <<<<<<<<<<<<<< + * + * def _contains(self, othershape: Shape) -> bool: */ - __pyx_t_15 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_oldPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 839, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_15, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 839, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 816, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_oldPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_14 = PyNumber_Subtract(__pyx_t_2, __pyx_t_15); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_v_x = __pyx_t_3; + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 816, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 816, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_y = __pyx_t_14; - __pyx_t_14 = 0; + goto __pyx_L0; - /* "collisions.py":840 - * dist_left = math.hypot(newPoint[0]-closestP[0], newPoint[1]-closestP[1]) * closestObj.bounciness - * x, y = oldPoint[0] - closestP[0], oldPoint[1] - closestP[1] - * phi = math.degrees(math.atan2(y, x))+90 # Because we have to -90 due to issues and then +180 so it becomes +90 # <<<<<<<<<<<<<< - * diff = (phi-normal) % 360 - * if diff > 180: + /* "collisions.py":811 + * return (self.x, self.y) + * + * def getTuple(self) -> tuple[Number]: # <<<<<<<<<<<<<< + * """ + * Gets this object in a tuple format: (x, y). */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_degrees); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_atan2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_4 = 1; - } - } + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("collisions.Point.getTuple", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":818 + * return (self.x, self.y) + * + * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< + * return False + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_5Point_17_contains(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_10collisions_5Point_17_contains = {"_contains", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_17_contains, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_5Point_17_contains(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + CYTHON_UNUSED PyObject *__pyx_v_self = 0; + CYTHON_UNUSED PyObject *__pyx_v_othershape = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_contains (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_y, __pyx_v_x}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_othershape,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 818, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_othershape)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 818, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, 1); __PYX_ERR(0, 818, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_contains") < 0)) __PYX_ERR(0, 818, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_othershape = values[1]; } - __pyx_t_1 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_15))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_15); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_15, function); - __pyx_t_4 = 1; + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 818, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - #endif + __Pyx_AddTraceback("collisions.Point._contains", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_5Point_16_contains(__pyx_self, __pyx_v_self, __pyx_v_othershape); + + /* function exit code */ { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_3}; - __pyx_t_14 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } } - __pyx_t_15 = __Pyx_PyInt_AddObjC(__pyx_t_14, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_v_phi = __pyx_t_15; - __pyx_t_15 = 0; + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "collisions.py":841 - * x, y = oldPoint[0] - closestP[0], oldPoint[1] - closestP[1] - * phi = math.degrees(math.atan2(y, x))+90 # Because we have to -90 due to issues and then +180 so it becomes +90 - * diff = (phi-normal) % 360 # <<<<<<<<<<<<<< - * if diff > 180: - * diff = diff - 360 - */ - __pyx_t_15 = PyNumber_Subtract(__pyx_v_phi, __pyx_v_normal); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_14 = __Pyx_PyInt_RemainderObjC(__pyx_t_15, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_v_diff = __pyx_t_14; - __pyx_t_14 = 0; +static PyObject *__pyx_pf_10collisions_5Point_16_contains(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_othershape) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_contains", 1); - /* "collisions.py":842 - * phi = math.degrees(math.atan2(y, x))+90 # Because we have to -90 due to issues and then +180 so it becomes +90 - * diff = (phi-normal) % 360 - * if diff > 180: # <<<<<<<<<<<<<< - * diff = diff - 360 - * pos = rotate(closestP, [closestP[0], closestP[1]+dist_left], phi-180-diff*2) + /* "collisions.py":819 + * + * def _contains(self, othershape: Shape) -> bool: + * return False # <<<<<<<<<<<<<< + * + * def handleCollisionsPos(self, */ - __pyx_t_14 = PyObject_RichCompare(__pyx_v_diff, __pyx_int_180, Py_GT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 842, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (__pyx_t_6) { + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; - /* "collisions.py":843 - * diff = (phi-normal) % 360 - * if diff > 180: - * diff = diff - 360 # <<<<<<<<<<<<<< - * pos = rotate(closestP, [closestP[0], closestP[1]+dist_left], phi-180-diff*2) - * vel = list(rotateBy0(vel, 180-diff*2)) + /* "collisions.py":818 + * return (self.x, self.y) + * + * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< + * return False + * */ - __pyx_t_14 = __Pyx_PyInt_SubtractObjC(__pyx_v_diff, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 843, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF_SET(__pyx_v_diff, __pyx_t_14); - __pyx_t_14 = 0; - /* "collisions.py":842 - * phi = math.degrees(math.atan2(y, x))+90 # Because we have to -90 due to issues and then +180 so it becomes +90 - * diff = (phi-normal) % 360 - * if diff > 180: # <<<<<<<<<<<<<< - * diff = diff - 360 - * pos = rotate(closestP, [closestP[0], closestP[1]+dist_left], phi-180-diff*2) - */ - } + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "collisions.py":844 - * if diff > 180: - * diff = diff - 360 - * pos = rotate(closestP, [closestP[0], closestP[1]+dist_left], phi-180-diff*2) # <<<<<<<<<<<<<< - * vel = list(rotateBy0(vel, 180-diff*2)) - * vel = [vel[0]*closestObj.bounciness, vel[1]*closestObj.bounciness] - */ - __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_rotate); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_dist_left); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 844, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 844, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_phi, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_15))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_15); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_15, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_closestP, __pyx_t_1, __pyx_t_9}; - __pyx_t_14 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - } - __pyx_v_pos = __pyx_t_14; - __pyx_t_14 = 0; - - /* "collisions.py":845 - * diff = diff - 360 - * pos = rotate(closestP, [closestP[0], closestP[1]+dist_left], phi-180-diff*2) - * vel = list(rotateBy0(vel, 180-diff*2)) # <<<<<<<<<<<<<< - * vel = [vel[0]*closestObj.bounciness, vel[1]*closestObj.bounciness] - * # HACK - */ - __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_rotateBy0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 845, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_9 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 845, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyInt_SubtractCObj(__pyx_int_180, __pyx_t_9, 0xB4, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 845, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_15))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_15); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_15, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_v_vel, __pyx_t_1}; - __pyx_t_14 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 845, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - } - __pyx_t_15 = __Pyx_PySequence_ListKeepNew(__pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 845, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF_SET(__pyx_v_vel, __pyx_t_15); - __pyx_t_15 = 0; - - /* "collisions.py":846 - * pos = rotate(closestP, [closestP[0], closestP[1]+dist_left], phi-180-diff*2) - * vel = list(rotateBy0(vel, 180-diff*2)) - * vel = [vel[0]*closestObj.bounciness, vel[1]*closestObj.bounciness] # <<<<<<<<<<<<<< - * # HACK - * smallness = rotateBy0([0,AVERYSMALLNUMBER], phi-180-diff*2) - */ - __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 846, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 846, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_15, __pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 846, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 846, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 846, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_9 = PyNumber_Multiply(__pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 846, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyList_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 846, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_15, 0, __pyx_t_1)) __PYX_ERR(0, 846, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyList_SET_ITEM(__pyx_t_15, 1, __pyx_t_9)) __PYX_ERR(0, 846, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_9 = 0; - __Pyx_DECREF_SET(__pyx_v_vel, __pyx_t_15); - __pyx_t_15 = 0; - - /* "collisions.py":848 - * vel = [vel[0]*closestObj.bounciness, vel[1]*closestObj.bounciness] - * # HACK - * smallness = rotateBy0([0,AVERYSMALLNUMBER], phi-180-diff*2) # <<<<<<<<<<<<<< - * out, outvel = self.handleCollisionsPos((closestP[0]+smallness[0], closestP[1]+smallness[1]), pos, objs, vel, False, precision) - * if replaceSelf: - */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rotateBy0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 848, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_AVERYSMALLNUMBER); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 848, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_14 = PyList_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 848, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_INCREF(__pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_14, 0, __pyx_int_0)) __PYX_ERR(0, 848, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_14, 1, __pyx_t_1)) __PYX_ERR(0, 848, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_phi, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 848, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 848, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 848, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_14, __pyx_t_2}; - __pyx_t_15 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 848, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __pyx_v_smallness = __pyx_t_15; - __pyx_t_15 = 0; - - /* "collisions.py":849 - * # HACK - * smallness = rotateBy0([0,AVERYSMALLNUMBER], phi-180-diff*2) - * out, outvel = self.handleCollisionsPos((closestP[0]+smallness[0], closestP[1]+smallness[1]), pos, objs, vel, False, precision) # <<<<<<<<<<<<<< - * if replaceSelf: - * self.x, self.y = out[0], out[1] - */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handleCollisionsPos); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 849, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 849, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_smallness, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 849, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 849, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 849, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_smallness, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 849, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Add(__pyx_t_14, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 849, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 849, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 849, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 849, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_1 = 0; - __pyx_t_1 = NULL; - __pyx_t_4 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - __pyx_t_4 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[7] = {__pyx_t_1, __pyx_t_2, __pyx_v_pos, __pyx_v_objs, __pyx_v_vel, Py_False, __pyx_v_precision}; - __pyx_t_15 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_4, 6+__pyx_t_4); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 849, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - if ((likely(PyTuple_CheckExact(__pyx_t_15))) || (PyList_CheckExact(__pyx_t_15))) { - PyObject* sequence = __pyx_t_15; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 849, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_9 = PyList_GET_ITEM(sequence, 0); - __pyx_t_2 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(__pyx_t_2); - #else - __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 849, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 849, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - #endif - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_1 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 849, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_16 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); - index = 0; __pyx_t_9 = __pyx_t_16(__pyx_t_1); if (unlikely(!__pyx_t_9)) goto __pyx_L13_unpacking_failed; - __Pyx_GOTREF(__pyx_t_9); - index = 1; __pyx_t_2 = __pyx_t_16(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L13_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_1), 2) < 0) __PYX_ERR(0, 849, __pyx_L1_error) - __pyx_t_16 = NULL; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L14_unpacking_done; - __pyx_L13_unpacking_failed:; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_16 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 849, __pyx_L1_error) - __pyx_L14_unpacking_done:; - } - __pyx_v_out = __pyx_t_9; - __pyx_t_9 = 0; - __pyx_v_outvel = __pyx_t_2; - __pyx_t_2 = 0; - - /* "collisions.py":850 - * smallness = rotateBy0([0,AVERYSMALLNUMBER], phi-180-diff*2) - * out, outvel = self.handleCollisionsPos((closestP[0]+smallness[0], closestP[1]+smallness[1]), pos, objs, vel, False, precision) - * if replaceSelf: # <<<<<<<<<<<<<< - * self.x, self.y = out[0], out[1] - * if verbose: - */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_replaceSelf); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 850, __pyx_L1_error) - if (__pyx_t_6) { - - /* "collisions.py":851 - * out, outvel = self.handleCollisionsPos((closestP[0]+smallness[0], closestP[1]+smallness[1]), pos, objs, vel, False, precision) - * if replaceSelf: - * self.x, self.y = out[0], out[1] # <<<<<<<<<<<<<< - * if verbose: - * return out, outvel, [True] - */ - __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_out, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 851, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_out, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 851, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_15) < 0) __PYX_ERR(0, 851, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_2) < 0) __PYX_ERR(0, 851, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "collisions.py":850 - * smallness = rotateBy0([0,AVERYSMALLNUMBER], phi-180-diff*2) - * out, outvel = self.handleCollisionsPos((closestP[0]+smallness[0], closestP[1]+smallness[1]), pos, objs, vel, False, precision) - * if replaceSelf: # <<<<<<<<<<<<<< - * self.x, self.y = out[0], out[1] - * if verbose: - */ - } - - /* "collisions.py":852 - * if replaceSelf: - * self.x, self.y = out[0], out[1] - * if verbose: # <<<<<<<<<<<<<< - * return out, outvel, [True] - * return out, outvel - */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 852, __pyx_L1_error) - if (__pyx_t_6) { - - /* "collisions.py":853 - * self.x, self.y = out[0], out[1] - * if verbose: - * return out, outvel, [True] # <<<<<<<<<<<<<< - * return out, outvel - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 853, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(Py_True); - __Pyx_GIVEREF(Py_True); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, Py_True)) __PYX_ERR(0, 853, __pyx_L1_error); - __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 853, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_INCREF(__pyx_v_out); - __Pyx_GIVEREF(__pyx_v_out); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_out)) __PYX_ERR(0, 853, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_outvel); - __Pyx_GIVEREF(__pyx_v_outvel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_v_outvel)) __PYX_ERR(0, 853, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_2)) __PYX_ERR(0, 853, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_r = ((PyObject*)__pyx_t_15); - __pyx_t_15 = 0; - goto __pyx_L0; - - /* "collisions.py":852 - * if replaceSelf: - * self.x, self.y = out[0], out[1] - * if verbose: # <<<<<<<<<<<<<< - * return out, outvel, [True] - * return out, outvel - */ - } - - /* "collisions.py":854 - * if verbose: - * return out, outvel, [True] - * return out, outvel # <<<<<<<<<<<<<< - * - * def handleCollisionsVel(self, - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 854, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_15); - __Pyx_INCREF(__pyx_v_out); - __Pyx_GIVEREF(__pyx_v_out); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_out)) __PYX_ERR(0, 854, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_outvel); - __Pyx_GIVEREF(__pyx_v_outvel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_v_outvel)) __PYX_ERR(0, 854, __pyx_L1_error); - __pyx_r = ((PyObject*)__pyx_t_15); - __pyx_t_15 = 0; - goto __pyx_L0; - - /* "collisions.py":788 - * return False - * - * def handleCollisionsPos(self, # <<<<<<<<<<<<<< - * oldPoint: Union['Point',pointLike], - * newPoint: Union['Point', pointLike], - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_14); - __Pyx_XDECREF(__pyx_t_15); - __Pyx_AddTraceback("collisions.Point.handleCollisionsPos", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_mvement); - __Pyx_XDECREF(__pyx_v_points); - __Pyx_XDECREF(__pyx_v_o); - __Pyx_XDECREF(__pyx_v_cs); - __Pyx_XDECREF(__pyx_v_closestP); - __Pyx_XDECREF(__pyx_v_closestObj); - __Pyx_XDECREF(__pyx_v_t); - __Pyx_XDECREF(__pyx_v_normal); - __Pyx_XDECREF(__pyx_v_dist_left); - __Pyx_XDECREF(__pyx_v_x); - __Pyx_XDECREF(__pyx_v_y); - __Pyx_XDECREF(__pyx_v_phi); - __Pyx_XDECREF(__pyx_v_diff); - __Pyx_XDECREF(__pyx_v_pos); - __Pyx_XDECREF(__pyx_v_smallness); - __Pyx_XDECREF(__pyx_v_out); - __Pyx_XDECREF(__pyx_v_outvel); - __Pyx_XDECREF(__pyx_v_vel); - __Pyx_DECREF((PyObject *)__pyx_cur_scope); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "collisions.py":856 - * return out, outvel - * - * def handleCollisionsVel(self, # <<<<<<<<<<<<<< - * vel: pointLike, - * objs: Union[Shapes,Iterable[Shape]], +/* "collisions.py":821 + * return False + * + * def handleCollisionsPos(self, # <<<<<<<<<<<<<< + * oldPoint: Union['Point',pointLike], + * newPoint: Union['Point', pointLike], */ static PyObject *__pyx_pf_10collisions_32__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { @@ -29484,39 +29173,42 @@ static PyObject *__pyx_pf_10collisions_32__defaults__(CYTHON_UNUSED PyObject *__ __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - /* "collisions.py":861 - * replaceSelf: bool = True, - * precision: Number = BASEPRECISION, - * verbose: bool = False # <<<<<<<<<<<<<< - * ) -> tuple[pointLike, pointLike, verboseOutput]: + /* "collisions.py":828 + * replaceSelf: bool = True, + * precision: Number = BASEPRECISION, + * verbose: bool = False # <<<<<<<<<<<<<< + * ) -> tuple[pointLike, pointLike, verboseOutput]: * """ */ - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_self)->__pyx_arg_vel); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_self)->__pyx_arg_vel); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_self)->__pyx_arg_vel)) __PYX_ERR(0, 821, __pyx_L1_error); __Pyx_INCREF(((PyObject *)Py_True)); __Pyx_GIVEREF(((PyObject *)Py_True)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_True))) __PYX_ERR(0, 856, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_True))) __PYX_ERR(0, 821, __pyx_L1_error); __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_self)->__pyx_arg_precision); __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_self)->__pyx_arg_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 856, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 821, __pyx_L1_error); __Pyx_INCREF(((PyObject *)Py_False)); __Pyx_GIVEREF(((PyObject *)Py_False)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)Py_False))) __PYX_ERR(0, 856, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)Py_False))) __PYX_ERR(0, 821, __pyx_L1_error); - /* "collisions.py":856 - * return out, outvel + /* "collisions.py":821 + * return False * - * def handleCollisionsVel(self, # <<<<<<<<<<<<<< - * vel: pointLike, - * objs: Union[Shapes,Iterable[Shape]], + * def handleCollisionsPos(self, # <<<<<<<<<<<<<< + * oldPoint: Union['Point',pointLike], + * newPoint: Union['Point', pointLike], */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 856, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 821, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -29535,16 +29227,16 @@ static PyObject *__pyx_pf_10collisions_32__defaults__(CYTHON_UNUSED PyObject *__ } /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Point_21handleCollisionsVel(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Point_19handleCollisionsPos(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_5Point_20handleCollisionsVel, "\n Handles movement of this point via velocity and it bouncing off of other objects.\n\n Args:\n vel (pointLike): The velocity of this point\n objs (Shapes / Iterable[Shape]): The objects to bounce off of\n replaceSelf (bool, optional): Whether or not to replace self.x and self.y with the new position. Defaults to True.\n precision (Number, optional): The decimal places to round to to check (for things like corner checking). Defaults to 5.\n verbose (bool, optional): Whether to give verbose output or not. Defaults to False.\n\n Returns:\n tuple[pointLike, pointLike, veboseOutput?]: The new position and vel of this object respectively, and if verbose then the verboseOutput.\n \n VerboseOutput:\n DidReflect (bool): Whether the line reflected off of something\n "); -static PyMethodDef __pyx_mdef_10collisions_5Point_21handleCollisionsVel = {"handleCollisionsVel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_21handleCollisionsVel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Point_20handleCollisionsVel}; -static PyObject *__pyx_pw_10collisions_5Point_21handleCollisionsVel(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_5Point_18handleCollisionsPos, "\n Handles movement of this point and it bouncing off of other objects.\n It is recommended you use `.handleCollisionsVel` instead of this, as it handles velocity instead of raw movement and is easier to use.\n\n But if you are to use this, remember to still provide the vel param. It will sometimes provide weird results if you don't.\n It could even just be the difference in positions, it just needs to be something realistic.\n\n Args:\n oldPoint (Point / pointLike): The old position of this object.\n newPoint (Point / pointLike): The new position of this object.\n objs (Shapes / Iterable[Shape]): The objects this will bounce off.\n vel (pointLike, optional): The velocity that this object is going. Defaults to [0, 0].\n replaceSelf (bool, optional): Whether to replace self.x and self.y with the new position of the object after bouncing or not. Defaults to True.\n precision (Number, optional): The decimal places to round to to check (for things like corner checking). Defaults to 5.\n verbose (bool, optional): Whether to give verbose output or not. Defaults to False.\n\n Returns:\n tuple[pointLike, pointLike, veboseOutput?]: The new position and vel of this object respectively, and if verbose then the verboseOutput.\n \n VerboseOutput:\n DidReflect (bool): Whether the line reflected off of something\n "); +static PyMethodDef __pyx_mdef_10collisions_5Point_19handleCollisionsPos = {"handleCollisionsPos", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_19handleCollisionsPos, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Point_18handleCollisionsPos}; +static PyObject *__pyx_pw_10collisions_5Point_19handleCollisionsPos(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -29552,8 +29244,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_vel = 0; + PyObject *__pyx_v_oldPoint = 0; + PyObject *__pyx_v_newPoint = 0; PyObject *__pyx_v_objs = 0; + PyObject *__pyx_v_vel = 0; PyObject *__pyx_v_replaceSelf = 0; PyObject *__pyx_v_precision = 0; PyObject *__pyx_v_verbose = 0; @@ -29561,13 +29255,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[6] = {0,0,0,0,0,0}; + PyObject* values[8] = {0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("handleCollisionsVel (wrapper)", 0); + __Pyx_RefNannySetupContext("handleCollisionsPos (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -29577,14 +29271,19 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_vel,&__pyx_n_s_objs,&__pyx_n_s_replaceSelf,&__pyx_n_s_precision,&__pyx_n_s_verbose,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_oldPoint,&__pyx_n_s_newPoint,&__pyx_n_s_objs,&__pyx_n_s_vel,&__pyx_n_s_replaceSelf,&__pyx_n_s_precision,&__pyx_n_s_verbose,0}; __pyx_defaults7 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_self); - values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); - values[4] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_precision); - values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); + values[4] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_vel); + values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); + values[6] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_precision); + values[7] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { + case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); @@ -29607,63 +29306,83 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 856, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 821, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vel)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_oldPoint)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 856, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 821, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 1); __PYX_ERR(0, 856, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 1); __PYX_ERR(0, 821, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_objs)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_newPoint)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 856, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 821, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 2); __PYX_ERR(0, 856, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 2); __PYX_ERR(0, 821, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_replaceSelf); - if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 856, __pyx_L3_error) + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_objs)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 821, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 3); __PYX_ERR(0, 821, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_precision); + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vel); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 856, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 821, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_verbose); + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_replaceSelf); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 856, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 821, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_precision); + if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 821, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_verbose); + if (value) { values[7] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 821, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "handleCollisionsVel") < 0)) __PYX_ERR(0, 856, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "handleCollisionsPos") < 0)) __PYX_ERR(0, 821, __pyx_L3_error) } } else { switch (__pyx_nargs) { + case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; @@ -29671,15 +29390,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } __pyx_v_self = values[0]; - __pyx_v_vel = values[1]; - __pyx_v_objs = values[2]; - __pyx_v_replaceSelf = values[3]; - __pyx_v_precision = values[4]; - __pyx_v_verbose = values[5]; + __pyx_v_oldPoint = values[1]; + __pyx_v_newPoint = values[2]; + __pyx_v_objs = values[3]; + __pyx_v_vel = values[4]; + __pyx_v_replaceSelf = values[5]; + __pyx_v_precision = values[6]; + __pyx_v_verbose = values[7]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, __pyx_nargs); __PYX_ERR(0, 856, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, __pyx_nargs); __PYX_ERR(0, 821, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -29689,11 +29410,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Point.handleCollisionsVel", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Point.handleCollisionsPos", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Point_20handleCollisionsVel(__pyx_self, __pyx_v_self, __pyx_v_vel, __pyx_v_objs, __pyx_v_replaceSelf, __pyx_v_precision, __pyx_v_verbose); + __pyx_r = __pyx_pf_10collisions_5Point_18handleCollisionsPos(__pyx_self, __pyx_v_self, __pyx_v_oldPoint, __pyx_v_newPoint, __pyx_v_objs, __pyx_v_vel, __pyx_v_replaceSelf, __pyx_v_precision, __pyx_v_verbose); /* function exit code */ { @@ -29706,296 +29427,42 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Point_20handleCollisionsVel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_vel, PyObject *__pyx_v_objs, PyObject *__pyx_v_replaceSelf, PyObject *__pyx_v_precision, PyObject *__pyx_v_verbose) { - PyObject *__pyx_v_o = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - unsigned int __pyx_t_7; - int __pyx_t_8; - PyObject *(*__pyx_t_9)(PyObject *); - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("handleCollisionsVel", 1); - - /* "collisions.py":879 - * DidReflect (bool): Whether the line reflected off of something - * """ - * o = self.handleCollisionsPos(self, (self.x+vel[0], self.y+vel[1]), objs, vel, False, precision, verbose) # <<<<<<<<<<<<<< - * if replaceSelf: - * self.x, self.y = o[0] - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handleCollisionsPos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 879, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 879, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 879, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 879, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 879, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 879, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 879, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5)) __PYX_ERR(0, 879, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6)) __PYX_ERR(0, 879, __pyx_L1_error); - __pyx_t_5 = 0; - __pyx_t_6 = 0; - __pyx_t_6 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[8] = {__pyx_t_6, __pyx_v_self, __pyx_t_3, __pyx_v_objs, __pyx_v_vel, Py_False, __pyx_v_precision, __pyx_v_verbose}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 7+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_v_o = __pyx_t_1; - __pyx_t_1 = 0; - - /* "collisions.py":880 - * """ - * o = self.handleCollisionsPos(self, (self.x+vel[0], self.y+vel[1]), objs, vel, False, precision, verbose) - * if replaceSelf: # <<<<<<<<<<<<<< - * self.x, self.y = o[0] - * if verbose: - */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_replaceSelf); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 880, __pyx_L1_error) - if (__pyx_t_8) { - - /* "collisions.py":881 - * o = self.handleCollisionsPos(self, (self.x+vel[0], self.y+vel[1]), objs, vel, False, precision, verbose) - * if replaceSelf: - * self.x, self.y = o[0] # <<<<<<<<<<<<<< - * if verbose: - * return o[0], o[1], o[2] - */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_o, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { - PyObject* sequence = __pyx_t_1; - Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 881, __pyx_L1_error) - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); - } else { - __pyx_t_2 = PyList_GET_ITEM(sequence, 0); - __pyx_t_3 = PyList_GET_ITEM(sequence, 1); - } - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(__pyx_t_3); - #else - __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 881, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 881, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else { - Py_ssize_t index = -1; - __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 881, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); - index = 0; __pyx_t_2 = __pyx_t_9(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; - __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_6), 2) < 0) __PYX_ERR(0, 881, __pyx_L1_error) - __pyx_t_9 = NULL; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - goto __pyx_L5_unpacking_done; - __pyx_L4_unpacking_failed:; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_9 = NULL; - if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 881, __pyx_L1_error) - __pyx_L5_unpacking_done:; - } - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_2) < 0) __PYX_ERR(0, 881, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_3) < 0) __PYX_ERR(0, 881, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "collisions.py":880 - * """ - * o = self.handleCollisionsPos(self, (self.x+vel[0], self.y+vel[1]), objs, vel, False, precision, verbose) - * if replaceSelf: # <<<<<<<<<<<<<< - * self.x, self.y = o[0] - * if verbose: - */ - } - - /* "collisions.py":882 - * if replaceSelf: - * self.x, self.y = o[0] - * if verbose: # <<<<<<<<<<<<<< - * return o[0], o[1], o[2] - * return o[0], o[1] - */ - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 882, __pyx_L1_error) - if (__pyx_t_8) { - - /* "collisions.py":883 - * self.x, self.y = o[0] - * if verbose: - * return o[0], o[1], o[2] # <<<<<<<<<<<<<< - * return o[0], o[1] - * - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_o, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 883, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_o, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 883, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_o, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 883, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 883, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(0, 883, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 883, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_2)) __PYX_ERR(0, 883, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_3 = 0; - __pyx_t_2 = 0; - __pyx_r = ((PyObject*)__pyx_t_6); - __pyx_t_6 = 0; - goto __pyx_L0; - - /* "collisions.py":882 - * if replaceSelf: - * self.x, self.y = o[0] - * if verbose: # <<<<<<<<<<<<<< - * return o[0], o[1], o[2] - * return o[0], o[1] - */ - } - - /* "collisions.py":884 - * if verbose: - * return o[0], o[1], o[2] - * return o[0], o[1] # <<<<<<<<<<<<<< - * - * def copy(self) -> 'Point': - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_o, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 884, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_o, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 884, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 884, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6)) __PYX_ERR(0, 884, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 884, __pyx_L1_error); - __pyx_t_6 = 0; - __pyx_t_2 = 0; - __pyx_r = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; - goto __pyx_L0; - - /* "collisions.py":856 - * return out, outvel - * - * def handleCollisionsVel(self, # <<<<<<<<<<<<<< - * vel: pointLike, - * objs: Union[Shapes,Iterable[Shape]], - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("collisions.Point.handleCollisionsVel", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_o); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "collisions.py":886 - * return o[0], o[1] - * - * def copy(self) -> 'Point': # <<<<<<<<<<<<<< - * """ - * Make a brand new Point with the same values! - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Point_23copy(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_5Point_22copy, "\n Make a brand new Point with the same values!\n "); -static PyMethodDef __pyx_mdef_10collisions_5Point_23copy = {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_23copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Point_22copy}; -static PyObject *__pyx_pw_10collisions_5Point_23copy(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_self = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; +/* "collisions.py":866 + * return oldPoint, [0, 0], [True] + * return oldPoint, [0, 0] + * points.sort(key=lambda x: abs(x[0][0]-oldPoint[0])**2+abs(x[0][1]-oldPoint[1])**2) # <<<<<<<<<<<<<< + * closestP = points[0][0] + * closestObj = points[0][1] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_5Point_19handleCollisionsPos_lambda6(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_10collisions_5Point_19handleCollisionsPos_lambda6 = {"lambda6", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_19handleCollisionsPos_lambda6, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_5Point_19handleCollisionsPos_lambda6(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_x = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("copy (wrapper)", 0); + __Pyx_RefNannySetupContext("lambda6 (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -30005,7 +29472,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -30017,27 +29484,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 886, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 866, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(0, 886, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda6") < 0)) __PYX_ERR(0, 866, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - __pyx_v_self = values[0]; + __pyx_v_x = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("copy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 886, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda6", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 866, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -30047,11 +29514,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Point.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Point.handleCollisionsPos.lambda6", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Point_22copy(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_lambda_funcdef_lambda6(__pyx_self, __pyx_v_x); /* function exit code */ { @@ -30064,83 +29531,73 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_5Point_22copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_lambda_funcdef_lambda6(PyObject *__pyx_self, PyObject *__pyx_v_x) { + struct __pyx_obj_10collisions___pyx_scope_struct_7_handleCollisionsPos *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_7_handleCollisionsPos *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("copy", 1); - - /* "collisions.py":890 - * Make a brand new Point with the same values! - * """ - * return Point(self.x, self.y, self.bounciness) # <<<<<<<<<<<<<< - * - * def __getitem__(self, item: int) -> Number: - */ + __Pyx_RefNannySetupContext("lambda6", 1); + __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_7_handleCollisionsPos *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Point); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 890, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 890, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_oldPoint)) { __Pyx_RaiseClosureNameError("oldPoint"); __PYX_ERR(0, 866, __pyx_L1_error) } + __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_oldPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 866, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 890, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 866, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_oldPoint)) { __Pyx_RaiseClosureNameError("oldPoint"); __PYX_ERR(0, 866, __pyx_L1_error) } + __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_oldPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 866, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 890, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = NULL; - __pyx_t_7 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_7 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_t_3, __pyx_t_4, __pyx_t_5}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 890, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 866, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":886 - * return o[0], o[1] - * - * def copy(self) -> 'Point': # <<<<<<<<<<<<<< - * """ - * Make a brand new Point with the same values! - */ - /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("collisions.Point.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Point.handleCollisionsPos.lambda6", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -30148,898 +29605,1224 @@ static PyObject *__pyx_pf_10collisions_5Point_22copy(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "collisions.py":892 - * return Point(self.x, self.y, self.bounciness) +/* "collisions.py":821 + * return False * - * def __getitem__(self, item: int) -> Number: # <<<<<<<<<<<<<< - * if item == 0: - * return self.x + * def handleCollisionsPos(self, # <<<<<<<<<<<<<< + * oldPoint: Union['Point',pointLike], + * newPoint: Union['Point', pointLike], */ -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Point_25__getitem__(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_5Point_25__getitem__ = {"__getitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_25__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_5Point_25__getitem__(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_item = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[2] = {0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_item,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 892, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_item)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 892, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 892, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__getitem__") < 0)) __PYX_ERR(0, 892, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 2)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - } - __pyx_v_self = values[0]; - __pyx_v_item = ((PyObject*)values[1]); - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 892, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("collisions.Point.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_item), (&PyInt_Type), 0, "item", 1))) __PYX_ERR(0, 892, __pyx_L1_error) - __pyx_r = __pyx_pf_10collisions_5Point_24__getitem__(__pyx_self, __pyx_v_self, __pyx_v_item); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10collisions_5Point_24__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item) { +static PyObject *__pyx_pf_10collisions_5Point_18handleCollisionsPos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_oldPoint, PyObject *__pyx_v_newPoint, PyObject *__pyx_v_objs, PyObject *__pyx_v_vel, PyObject *__pyx_v_replaceSelf, PyObject *__pyx_v_precision, PyObject *__pyx_v_verbose) { + struct __pyx_obj_10collisions___pyx_scope_struct_7_handleCollisionsPos *__pyx_cur_scope; + PyObject *__pyx_v_mvement = NULL; + PyObject *__pyx_v_points = NULL; + PyObject *__pyx_v_o = NULL; + PyObject *__pyx_v_cs = NULL; + PyObject *__pyx_v_closestP = NULL; + PyObject *__pyx_v_closestObj = NULL; + PyObject *__pyx_v_t = NULL; + PyObject *__pyx_v_normal = NULL; + PyObject *__pyx_v_dist_left = NULL; + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_y = NULL; + PyObject *__pyx_v_phi = NULL; + PyObject *__pyx_v_diff = NULL; + PyObject *__pyx_v_pos = NULL; + PyObject *__pyx_v_smallness = NULL; + PyObject *__pyx_v_out = NULL; + PyObject *__pyx_v_outvel = NULL; + CYTHON_UNUSED Py_ssize_t __pyx_9genexpr14__pyx_v__; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; + PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; + unsigned int __pyx_t_4; + int __pyx_t_5; + int __pyx_t_6; + Py_ssize_t __pyx_t_7; + PyObject *(*__pyx_t_8)(PyObject *); + PyObject *__pyx_t_9 = NULL; + Py_ssize_t __pyx_t_10; + Py_ssize_t __pyx_t_11; + Py_ssize_t __pyx_t_12; + int __pyx_t_13; + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *(*__pyx_t_16)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__getitem__", 1); - - /* "collisions.py":893 - * - * def __getitem__(self, item: int) -> Number: - * if item == 0: # <<<<<<<<<<<<<< - * return self.x - * elif item == 1: - */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 893, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 893, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_2) { + __Pyx_RefNannySetupContext("handleCollisionsPos", 0); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_7_handleCollisionsPos *)__pyx_tp_new_10collisions___pyx_scope_struct_7_handleCollisionsPos(__pyx_ptype_10collisions___pyx_scope_struct_7_handleCollisionsPos, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_7_handleCollisionsPos *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 821, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_v_oldPoint = __pyx_v_oldPoint; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_oldPoint); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_oldPoint); + __Pyx_INCREF(__pyx_v_vel); - /* "collisions.py":894 - * def __getitem__(self, item: int) -> Number: - * if item == 0: - * return self.x # <<<<<<<<<<<<<< - * elif item == 1: - * return self.y + /* "collisions.py":852 + * DidReflect (bool): Whether the line reflected off of something + * """ + * mvement = Line(oldPoint, newPoint) # <<<<<<<<<<<<<< + * if not mvement.collides(objs): + * if verbose: */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 894, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 852, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (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); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_oldPoint, __pyx_v_newPoint}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_v_mvement = __pyx_t_1; + __pyx_t_1 = 0; - /* "collisions.py":893 - * - * def __getitem__(self, item: int) -> Number: - * if item == 0: # <<<<<<<<<<<<<< - * return self.x - * elif item == 1: + /* "collisions.py":853 + * """ + * mvement = Line(oldPoint, newPoint) + * if not mvement.collides(objs): # <<<<<<<<<<<<<< + * if verbose: + * return newPoint, vel, [False] */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_mvement, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 853, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(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); + __pyx_t_4 = 1; + } } - - /* "collisions.py":895 - * if item == 0: - * return self.x - * elif item == 1: # <<<<<<<<<<<<<< - * return self.y - * else: - */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 895, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 895, __pyx_L1_error) + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_objs}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 853, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 853, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (likely(__pyx_t_2)) { + __pyx_t_6 = (!__pyx_t_5); + if (__pyx_t_6) { - /* "collisions.py":896 - * return self.x - * elif item == 1: - * return self.y # <<<<<<<<<<<<<< - * else: - * raise IndexError( + /* "collisions.py":854 + * mvement = Line(oldPoint, newPoint) + * if not mvement.collides(objs): + * if verbose: # <<<<<<<<<<<<<< + * return newPoint, vel, [False] + * return newPoint, vel */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 896, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 854, __pyx_L1_error) + if (__pyx_t_6) { - /* "collisions.py":895 - * if item == 0: - * return self.x - * elif item == 1: # <<<<<<<<<<<<<< - * return self.y - * else: + /* "collisions.py":855 + * if not mvement.collides(objs): + * if verbose: + * return newPoint, vel, [False] # <<<<<<<<<<<<<< + * return newPoint, vel + * points = [] */ - } + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(Py_False); + __Pyx_GIVEREF(Py_False); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, Py_False)) __PYX_ERR(0, 855, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 855, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_newPoint); + __Pyx_GIVEREF(__pyx_v_newPoint); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_newPoint)) __PYX_ERR(0, 855, __pyx_L1_error); + __Pyx_INCREF(__pyx_v_vel); + __Pyx_GIVEREF(__pyx_v_vel); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_vel)) __PYX_ERR(0, 855, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1)) __PYX_ERR(0, 855, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_r = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L0; - /* "collisions.py":898 - * return self.y - * else: - * raise IndexError( # <<<<<<<<<<<<<< - * 'List index out of range! Must be 0-1, found: '+str(item) - * ) + /* "collisions.py":854 + * mvement = Line(oldPoint, newPoint) + * if not mvement.collides(objs): + * if verbose: # <<<<<<<<<<<<<< + * return newPoint, vel, [False] + * return newPoint, vel */ - /*else*/ { + } - /* "collisions.py":899 - * else: - * raise IndexError( - * 'List index out of range! Must be 0-1, found: '+str(item) # <<<<<<<<<<<<<< - * ) - * + /* "collisions.py":856 + * if verbose: + * return newPoint, vel, [False] + * return newPoint, vel # <<<<<<<<<<<<<< + * points = [] + * for o in objs: */ - __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_List_index_out_of_range_Must_be, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 899, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 856, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_newPoint); + __Pyx_GIVEREF(__pyx_v_newPoint); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_newPoint)) __PYX_ERR(0, 856, __pyx_L1_error); + __Pyx_INCREF(__pyx_v_vel); + __Pyx_GIVEREF(__pyx_v_vel); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_vel)) __PYX_ERR(0, 856, __pyx_L1_error); + __pyx_r = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L0; - /* "collisions.py":898 - * return self.y - * else: - * raise IndexError( # <<<<<<<<<<<<<< - * 'List index out of range! Must be 0-1, found: '+str(item) - * ) + /* "collisions.py":853 + * """ + * mvement = Line(oldPoint, newPoint) + * if not mvement.collides(objs): # <<<<<<<<<<<<<< + * if verbose: + * return newPoint, vel, [False] */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 898, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 898, __pyx_L1_error) } - /* "collisions.py":892 - * return Point(self.x, self.y, self.bounciness) - * - * def __getitem__(self, item: int) -> Number: # <<<<<<<<<<<<<< - * if item == 0: - * return self.x + /* "collisions.py":857 + * return newPoint, vel, [False] + * return newPoint, vel + * points = [] # <<<<<<<<<<<<<< + * for o in objs: + * cs = o.whereCollides(mvement) */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 857, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_points = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("collisions.Point.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "collisions.py":902 - * ) - * - * def __setitem__(self, item: int, new: Number) -> None: # <<<<<<<<<<<<<< - * if item == 0: - * self.x = new + /* "collisions.py":858 + * return newPoint, vel + * points = [] + * for o in objs: # <<<<<<<<<<<<<< + * cs = o.whereCollides(mvement) + * points.extend(list(zip(cs, [o for _ in range(len(cs))]))) */ - -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Point_27__setitem__(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_5Point_27__setitem__ = {"__setitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_27__setitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_5Point_27__setitem__(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_item = 0; - PyObject *__pyx_v_new = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[3] = {0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_item,&__pyx_n_s_new,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 902, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_item)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 902, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 902, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_new)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; + if (likely(PyList_CheckExact(__pyx_v_objs)) || PyTuple_CheckExact(__pyx_v_objs)) { + __pyx_t_2 = __pyx_v_objs; __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_objs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 858, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_8)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 858, __pyx_L1_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 902, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 902, __pyx_L3_error) + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 858, __pyx_L1_error) + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 858, __pyx_L1_error) + #endif + if (__pyx_t_7 >= __pyx_temp) break; } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 858, __pyx_L1_error) + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + #endif } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(0, 902, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 3)) { - goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - } - __pyx_v_self = values[0]; - __pyx_v_item = ((PyObject*)values[1]); - __pyx_v_new = values[2]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 902, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("collisions.Point.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_item), (&PyInt_Type), 0, "item", 1))) __PYX_ERR(0, 902, __pyx_L1_error) - __pyx_r = __pyx_pf_10collisions_5Point_26__setitem__(__pyx_self, __pyx_v_self, __pyx_v_item, __pyx_v_new); - - /* function exit code */ - goto __pyx_L0; - __pyx_L1_error:; - __pyx_r = NULL; - __pyx_L0:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + __pyx_t_1 = __pyx_t_8(__pyx_t_2); + if (unlikely(!__pyx_t_1)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 858, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_1); } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10collisions_5Point_26__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_new) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__setitem__", 1); + __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_1); + __pyx_t_1 = 0; - /* "collisions.py":903 - * - * def __setitem__(self, item: int, new: Number) -> None: - * if item == 0: # <<<<<<<<<<<<<< - * self.x = new - * elif item == 1: + /* "collisions.py":859 + * points = [] + * for o in objs: + * cs = o.whereCollides(mvement) # <<<<<<<<<<<<<< + * points.extend(list(zip(cs, [o for _ in range(len(cs))]))) + * # Don't let you move when you're in a wall */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 903, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 903, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_2) { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 859, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_mvement}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 859, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_cs, __pyx_t_1); + __pyx_t_1 = 0; - /* "collisions.py":904 - * def __setitem__(self, item: int, new: Number) -> None: - * if item == 0: - * self.x = new # <<<<<<<<<<<<<< - * elif item == 1: - * self.y = new + /* "collisions.py":860 + * for o in objs: + * cs = o.whereCollides(mvement) + * points.extend(list(zip(cs, [o for _ in range(len(cs))]))) # <<<<<<<<<<<<<< + * # Don't let you move when you're in a wall + * if points == []: */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_v_new) < 0) __PYX_ERR(0, 904, __pyx_L1_error) + { /* enter inner scope */ + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 860, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = PyObject_Length(__pyx_v_cs); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_t_11 = __pyx_t_10; + for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) { + __pyx_9genexpr14__pyx_v__ = __pyx_t_12; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_v_o))) __PYX_ERR(0, 860, __pyx_L1_error) + } + } /* exit inner scope */ + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 860, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_cs); + __Pyx_GIVEREF(__pyx_v_cs); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_cs)) __PYX_ERR(0, 860, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 860, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 860, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 860, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_13 = __Pyx_PyList_Extend(__pyx_v_points, __pyx_t_3); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 860, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":903 - * - * def __setitem__(self, item: int, new: Number) -> None: - * if item == 0: # <<<<<<<<<<<<<< - * self.x = new - * elif item == 1: + /* "collisions.py":858 + * return newPoint, vel + * points = [] + * for o in objs: # <<<<<<<<<<<<<< + * cs = o.whereCollides(mvement) + * points.extend(list(zip(cs, [o for _ in range(len(cs))]))) */ - goto __pyx_L3; } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":905 - * if item == 0: - * self.x = new - * elif item == 1: # <<<<<<<<<<<<<< - * self.y = new - * else: + /* "collisions.py":862 + * points.extend(list(zip(cs, [o for _ in range(len(cs))]))) + * # Don't let you move when you're in a wall + * if points == []: # <<<<<<<<<<<<<< + * if verbose: + * return oldPoint, [0, 0], [True] */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 905, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 905, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (likely(__pyx_t_2)) { + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 862, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_points, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 862, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 862, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { - /* "collisions.py":906 - * self.x = new - * elif item == 1: - * self.y = new # <<<<<<<<<<<<<< - * else: - * raise IndexError( + /* "collisions.py":863 + * # Don't let you move when you're in a wall + * if points == []: + * if verbose: # <<<<<<<<<<<<<< + * return oldPoint, [0, 0], [True] + * return oldPoint, [0, 0] */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_v_new) < 0) __PYX_ERR(0, 906, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 863, __pyx_L1_error) + if (__pyx_t_6) { - /* "collisions.py":905 - * if item == 0: - * self.x = new - * elif item == 1: # <<<<<<<<<<<<<< - * self.y = new - * else: + /* "collisions.py":864 + * if points == []: + * if verbose: + * return oldPoint, [0, 0], [True] # <<<<<<<<<<<<<< + * return oldPoint, [0, 0] + * points.sort(key=lambda x: abs(x[0][0]-oldPoint[0])**2+abs(x[0][1]-oldPoint[1])**2) */ - goto __pyx_L3; - } + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 864, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_0)) __PYX_ERR(0, 864, __pyx_L1_error); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_0)) __PYX_ERR(0, 864, __pyx_L1_error); + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 864, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(Py_True); + __Pyx_GIVEREF(Py_True); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, Py_True)) __PYX_ERR(0, 864, __pyx_L1_error); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 864, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_oldPoint); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_oldPoint); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_oldPoint)) __PYX_ERR(0, 864, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 864, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_2)) __PYX_ERR(0, 864, __pyx_L1_error); + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; + goto __pyx_L0; - /* "collisions.py":908 - * self.y = new - * else: - * raise IndexError( # <<<<<<<<<<<<<< - * 'List index out of range! Must be 0-1, found: '+str(item) - * ) + /* "collisions.py":863 + * # Don't let you move when you're in a wall + * if points == []: + * if verbose: # <<<<<<<<<<<<<< + * return oldPoint, [0, 0], [True] + * return oldPoint, [0, 0] */ - /*else*/ { + } - /* "collisions.py":909 - * else: - * raise IndexError( - * 'List index out of range! Must be 0-1, found: '+str(item) # <<<<<<<<<<<<<< - * ) - * + /* "collisions.py":865 + * if verbose: + * return oldPoint, [0, 0], [True] + * return oldPoint, [0, 0] # <<<<<<<<<<<<<< + * points.sort(key=lambda x: abs(x[0][0]-oldPoint[0])**2+abs(x[0][1]-oldPoint[1])**2) + * closestP = points[0][0] */ - __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 909, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_List_index_out_of_range_Must_be, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 909, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0)) __PYX_ERR(0, 865, __pyx_L1_error); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_0)) __PYX_ERR(0, 865, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 865, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_oldPoint); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_oldPoint); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_oldPoint)) __PYX_ERR(0, 865, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 865, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_r = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; + goto __pyx_L0; - /* "collisions.py":908 - * self.y = new - * else: - * raise IndexError( # <<<<<<<<<<<<<< - * 'List index out of range! Must be 0-1, found: '+str(item) - * ) + /* "collisions.py":862 + * points.extend(list(zip(cs, [o for _ in range(len(cs))]))) + * # Don't let you move when you're in a wall + * if points == []: # <<<<<<<<<<<<<< + * if verbose: + * return oldPoint, [0, 0], [True] */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_1, 0, 0, 0); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 908, __pyx_L1_error) } - __pyx_L3:; - /* "collisions.py":902 - * ) - * - * def __setitem__(self, item: int, new: Number) -> None: # <<<<<<<<<<<<<< - * if item == 0: - * self.x = new + /* "collisions.py":866 + * return oldPoint, [0, 0], [True] + * return oldPoint, [0, 0] + * points.sort(key=lambda x: abs(x[0][0]-oldPoint[0])**2+abs(x[0][1]-oldPoint[1])**2) # <<<<<<<<<<<<<< + * closestP = points[0][0] + * closestObj = points[0][1] */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_points, __pyx_n_s_sort); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 866, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_19handleCollisionsPos_lambda6, 0, __pyx_n_s_Point_handleCollisionsPos_locals, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 866, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_t_3) < 0) __PYX_ERR(0, 866, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 866, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* 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_3); - __Pyx_AddTraceback("collisions.Point.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "collisions.py":867 + * return oldPoint, [0, 0] + * points.sort(key=lambda x: abs(x[0][0]-oldPoint[0])**2+abs(x[0][1]-oldPoint[1])**2) + * closestP = points[0][0] # <<<<<<<<<<<<<< + * closestObj = points[0][1] + * t = closestObj.tangent(closestP, vel) + */ + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_points, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 867, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 867, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_closestP = __pyx_t_1; + __pyx_t_1 = 0; -/* "collisions.py":912 - * ) - * - * def __iter__(self): # <<<<<<<<<<<<<< - * return iter([self.x, self.y]) - * + /* "collisions.py":868 + * points.sort(key=lambda x: abs(x[0][0]-oldPoint[0])**2+abs(x[0][1]-oldPoint[1])**2) + * closestP = points[0][0] + * closestObj = points[0][1] # <<<<<<<<<<<<<< + * t = closestObj.tangent(closestP, vel) + * normal = t-90 */ + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_points, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 868, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 868, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_closestObj = __pyx_t_3; + __pyx_t_3 = 0; -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Point_29__iter__(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_5Point_29__iter__ = {"__iter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_29__iter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_5Point_29__iter__(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_self = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 912, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__iter__") < 0)) __PYX_ERR(0, 912, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_self = values[0]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 912, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + /* "collisions.py":869 + * closestP = points[0][0] + * closestObj = points[0][1] + * t = closestObj.tangent(closestP, vel) # <<<<<<<<<<<<<< + * normal = t-90 + * dist_left = math.hypot(newPoint[0]-closestP[0], newPoint[1]-closestP[1]) * closestObj.bounciness + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_tangent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 869, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_4 = 1; } } - __Pyx_AddTraceback("collisions.Point.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Point_28__iter__(__pyx_self, __pyx_v_self); - - /* function exit code */ + #endif { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_closestP, __pyx_v_vel}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 869, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + __pyx_v_t = __pyx_t_3; + __pyx_t_3 = 0; -static PyObject *__pyx_pf_10collisions_5Point_28__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("__iter__", 1); + /* "collisions.py":870 + * closestObj = points[0][1] + * t = closestObj.tangent(closestP, vel) + * normal = t-90 # <<<<<<<<<<<<<< + * dist_left = math.hypot(newPoint[0]-closestP[0], newPoint[1]-closestP[1]) * closestObj.bounciness + * x, y = oldPoint[0] - closestP[0], oldPoint[1] - closestP[1] + */ + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_t, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 870, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_normal = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":913 - * - * def __iter__(self): - * return iter([self.x, self.y]) # <<<<<<<<<<<<<< - * - * def __str__(self): + /* "collisions.py":871 + * t = closestObj.tangent(closestP, vel) + * normal = t-90 + * dist_left = math.hypot(newPoint[0]-closestP[0], newPoint[1]-closestP[1]) * closestObj.bounciness # <<<<<<<<<<<<<< + * x, y = oldPoint[0] - closestP[0], oldPoint[1] - closestP[1] + * phi = math.degrees(math.atan2(y, x))+90 # Because we have to -90 due to issues and then +180 so it becomes +90 */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 913, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 913, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_hypot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 913, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 913, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 913, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 913, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_newPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 871, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_14 = PyNumber_Subtract(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 871, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_newPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 871, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 871, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_15 = PyNumber_Subtract(__pyx_t_9, __pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 871, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_14, __pyx_t_15}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); + __pyx_t_15 = PyNumber_Multiply(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 871, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_dist_left = __pyx_t_15; + __pyx_t_15 = 0; - /* "collisions.py":912 - * ) - * - * def __iter__(self): # <<<<<<<<<<<<<< - * return iter([self.x, self.y]) - * + /* "collisions.py":872 + * normal = t-90 + * dist_left = math.hypot(newPoint[0]-closestP[0], newPoint[1]-closestP[1]) * closestObj.bounciness + * x, y = oldPoint[0] - closestP[0], oldPoint[1] - closestP[1] # <<<<<<<<<<<<<< + * phi = math.degrees(math.atan2(y, x))+90 # Because we have to -90 due to issues and then +180 so it becomes +90 + * diff = (phi-normal) % 360 */ + __pyx_t_15 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_oldPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 872, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 872, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Subtract(__pyx_t_15, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 872, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_oldPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 872, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 872, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_14 = PyNumber_Subtract(__pyx_t_2, __pyx_t_15); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 872, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_v_x = __pyx_t_3; + __pyx_t_3 = 0; + __pyx_v_y = __pyx_t_14; + __pyx_t_14 = 0; - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("collisions.Point.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "collisions.py":915 - * return iter([self.x, self.y]) - * - * def __str__(self): # <<<<<<<<<<<<<< - * return f'' - * + /* "collisions.py":873 + * dist_left = math.hypot(newPoint[0]-closestP[0], newPoint[1]-closestP[1]) * closestObj.bounciness + * x, y = oldPoint[0] - closestP[0], oldPoint[1] - closestP[1] + * phi = math.degrees(math.atan2(y, x))+90 # Because we have to -90 due to issues and then +180 so it becomes +90 # <<<<<<<<<<<<<< + * diff = (phi-normal) % 360 + * if diff > 180: */ - -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_5Point_31__str__(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_5Point_31__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_31__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_5Point_31__str__(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_self = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 915, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 915, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 873, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_degrees); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 873, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 873, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_atan2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 873, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_4 = 1; } - __pyx_v_self = values[0]; } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 915, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; + #endif { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_y, __pyx_v_x}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 873, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_t_1 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_15))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_15); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_15, function); + __pyx_t_4 = 1; } } - __Pyx_AddTraceback("collisions.Point.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_5Point_30__str__(__pyx_self, __pyx_v_self); - - /* function exit code */ + #endif { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_3}; + __pyx_t_14 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 873, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10collisions_5Point_30__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - Py_UCS4 __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__str__", 1); + __pyx_t_15 = __Pyx_PyInt_AddObjC(__pyx_t_14, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 873, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_v_phi = __pyx_t_15; + __pyx_t_15 = 0; - /* "collisions.py":916 - * - * def __str__(self): - * return f'' # <<<<<<<<<<<<<< - * - * class Line(Shape): + /* "collisions.py":874 + * x, y = oldPoint[0] - closestP[0], oldPoint[1] - closestP[1] + * phi = math.degrees(math.atan2(y, x))+90 # Because we have to -90 due to issues and then +180 so it becomes +90 + * diff = (phi-normal) % 360 # <<<<<<<<<<<<<< + * if diff > 180: + * diff = diff - 360 */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = 0; - __pyx_t_3 = 127; - __Pyx_INCREF(__pyx_kp_u_Point_2); - __pyx_t_2 += 10; - __Pyx_GIVEREF(__pyx_kp_u_Point_2); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Point_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 916, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 916, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; - __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); - __pyx_t_5 = 0; - __Pyx_INCREF(__pyx_kp_u__6); - __pyx_t_2 += 2; - __Pyx_GIVEREF(__pyx_kp_u__6); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 916, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 916, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; - __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4); - __pyx_t_4 = 0; - __Pyx_INCREF(__pyx_kp_u__7); - __pyx_t_2 += 2; - __Pyx_GIVEREF(__pyx_kp_u__7); - PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__7); - __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 916, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; + __pyx_t_15 = PyNumber_Subtract(__pyx_v_phi, __pyx_v_normal); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 874, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_14 = __Pyx_PyInt_RemainderObjC(__pyx_t_15, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 874, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_v_diff = __pyx_t_14; + __pyx_t_14 = 0; - /* "collisions.py":915 - * return iter([self.x, self.y]) - * - * def __str__(self): # <<<<<<<<<<<<<< - * return f'' - * + /* "collisions.py":875 + * phi = math.degrees(math.atan2(y, x))+90 # Because we have to -90 due to issues and then +180 so it becomes +90 + * diff = (phi-normal) % 360 + * if diff > 180: # <<<<<<<<<<<<<< + * diff = diff - 360 + * pos = rotate(closestP, [closestP[0], closestP[1]+dist_left], phi-180-diff*2) */ + __pyx_t_14 = PyObject_RichCompare(__pyx_v_diff, __pyx_int_180, Py_GT); __Pyx_XGOTREF(__pyx_t_14); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 875, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 875, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (__pyx_t_6) { - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("collisions.Point.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + /* "collisions.py":876 + * diff = (phi-normal) % 360 + * if diff > 180: + * diff = diff - 360 # <<<<<<<<<<<<<< + * pos = rotate(closestP, [closestP[0], closestP[1]+dist_left], phi-180-diff*2) + * vel = list(rotateBy0(vel, 180-diff*2)) + */ + __pyx_t_14 = __Pyx_PyInt_SubtractObjC(__pyx_v_diff, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 876, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF_SET(__pyx_v_diff, __pyx_t_14); + __pyx_t_14 = 0; + + /* "collisions.py":875 + * phi = math.degrees(math.atan2(y, x))+90 # Because we have to -90 due to issues and then +180 so it becomes +90 + * diff = (phi-normal) % 360 + * if diff > 180: # <<<<<<<<<<<<<< + * diff = diff - 360 + * pos = rotate(closestP, [closestP[0], closestP[1]+dist_left], phi-180-diff*2) + */ + } + + /* "collisions.py":877 + * if diff > 180: + * diff = diff - 360 + * pos = rotate(closestP, [closestP[0], closestP[1]+dist_left], phi-180-diff*2) # <<<<<<<<<<<<<< + * vel = list(rotateBy0(vel, 180-diff*2)) + * vel = [vel[0]*closestObj.bounciness, vel[1]*closestObj.bounciness] + */ + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_rotate); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 877, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 877, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_dist_left); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 877, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 877, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 877, __pyx_L1_error); + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_phi, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 877, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 877, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 877, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_15))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_15); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_15, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_closestP, __pyx_t_1, __pyx_t_9}; + __pyx_t_14 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 877, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } + __pyx_v_pos = __pyx_t_14; + __pyx_t_14 = 0; + + /* "collisions.py":878 + * diff = diff - 360 + * pos = rotate(closestP, [closestP[0], closestP[1]+dist_left], phi-180-diff*2) + * vel = list(rotateBy0(vel, 180-diff*2)) # <<<<<<<<<<<<<< + * vel = [vel[0]*closestObj.bounciness, vel[1]*closestObj.bounciness] + * # HACK + */ + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_rotateBy0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_9 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyInt_SubtractCObj(__pyx_int_180, __pyx_t_9, 0xB4, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_15))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_15); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_15, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_v_vel, __pyx_t_1}; + __pyx_t_14 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } + __pyx_t_15 = __Pyx_PySequence_ListKeepNew(__pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 878, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF_SET(__pyx_v_vel, __pyx_t_15); + __pyx_t_15 = 0; + + /* "collisions.py":879 + * pos = rotate(closestP, [closestP[0], closestP[1]+dist_left], phi-180-diff*2) + * vel = list(rotateBy0(vel, 180-diff*2)) + * vel = [vel[0]*closestObj.bounciness, vel[1]*closestObj.bounciness] # <<<<<<<<<<<<<< + * # HACK + * smallness = rotateBy0([0,AVERYSMALLNUMBER], phi-180-diff*2) + */ + __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_1 = PyNumber_Multiply(__pyx_t_15, __pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_9 = PyNumber_Multiply(__pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_15 = PyList_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 879, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_15, 0, __pyx_t_1)) __PYX_ERR(0, 879, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_9); + if (__Pyx_PyList_SET_ITEM(__pyx_t_15, 1, __pyx_t_9)) __PYX_ERR(0, 879, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_9 = 0; + __Pyx_DECREF_SET(__pyx_v_vel, __pyx_t_15); + __pyx_t_15 = 0; + + /* "collisions.py":881 + * vel = [vel[0]*closestObj.bounciness, vel[1]*closestObj.bounciness] + * # HACK + * smallness = rotateBy0([0,AVERYSMALLNUMBER], phi-180-diff*2) # <<<<<<<<<<<<<< + * out, outvel = self.handleCollisionsPos((closestP[0]+smallness[0], closestP[1]+smallness[1]), pos, objs, vel, False, precision) + * if replaceSelf: + */ + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_rotateBy0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 881, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_AVERYSMALLNUMBER); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_14 = PyList_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 881, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + if (__Pyx_PyList_SET_ITEM(__pyx_t_14, 0, __pyx_int_0)) __PYX_ERR(0, 881, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_14, 1, __pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_phi, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 881, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 881, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_14, __pyx_t_2}; + __pyx_t_15 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 881, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __pyx_v_smallness = __pyx_t_15; + __pyx_t_15 = 0; + + /* "collisions.py":882 + * # HACK + * smallness = rotateBy0([0,AVERYSMALLNUMBER], phi-180-diff*2) + * out, outvel = self.handleCollisionsPos((closestP[0]+smallness[0], closestP[1]+smallness[1]), pos, objs, vel, False, precision) # <<<<<<<<<<<<<< + * if replaceSelf: + * self.x, self.y = out[0], out[1] + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handleCollisionsPos); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_smallness, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_14); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_smallness, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyNumber_Add(__pyx_t_14, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 882, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error); + __pyx_t_3 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = NULL; + __pyx_t_4 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + __pyx_t_4 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[7] = {__pyx_t_1, __pyx_t_2, __pyx_v_pos, __pyx_v_objs, __pyx_v_vel, Py_False, __pyx_v_precision}; + __pyx_t_15 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_4, 6+__pyx_t_4); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + if ((likely(PyTuple_CheckExact(__pyx_t_15))) || (PyList_CheckExact(__pyx_t_15))) { + PyObject* sequence = __pyx_t_15; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 882, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_9 = PyList_GET_ITEM(sequence, 0); + __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(__pyx_t_2); + #else + __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + #endif + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_1 = PyObject_GetIter(__pyx_t_15); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + __pyx_t_16 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); + index = 0; __pyx_t_9 = __pyx_t_16(__pyx_t_1); if (unlikely(!__pyx_t_9)) goto __pyx_L13_unpacking_failed; + __Pyx_GOTREF(__pyx_t_9); + index = 1; __pyx_t_2 = __pyx_t_16(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L13_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_16(__pyx_t_1), 2) < 0) __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_t_16 = NULL; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L14_unpacking_done; + __pyx_L13_unpacking_failed:; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_16 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 882, __pyx_L1_error) + __pyx_L14_unpacking_done:; + } + __pyx_v_out = __pyx_t_9; + __pyx_t_9 = 0; + __pyx_v_outvel = __pyx_t_2; + __pyx_t_2 = 0; + + /* "collisions.py":883 + * smallness = rotateBy0([0,AVERYSMALLNUMBER], phi-180-diff*2) + * out, outvel = self.handleCollisionsPos((closestP[0]+smallness[0], closestP[1]+smallness[1]), pos, objs, vel, False, precision) + * if replaceSelf: # <<<<<<<<<<<<<< + * self.x, self.y = out[0], out[1] + * if verbose: + */ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_replaceSelf); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 883, __pyx_L1_error) + if (__pyx_t_6) { + + /* "collisions.py":884 + * out, outvel = self.handleCollisionsPos((closestP[0]+smallness[0], closestP[1]+smallness[1]), pos, objs, vel, False, precision) + * if replaceSelf: + * self.x, self.y = out[0], out[1] # <<<<<<<<<<<<<< + * if verbose: + * return out, outvel, [True] + */ + __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_out, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 884, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_out, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 884, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_15) < 0) __PYX_ERR(0, 884, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_2) < 0) __PYX_ERR(0, 884, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "collisions.py":883 + * smallness = rotateBy0([0,AVERYSMALLNUMBER], phi-180-diff*2) + * out, outvel = self.handleCollisionsPos((closestP[0]+smallness[0], closestP[1]+smallness[1]), pos, objs, vel, False, precision) + * if replaceSelf: # <<<<<<<<<<<<<< + * self.x, self.y = out[0], out[1] + * if verbose: + */ + } + + /* "collisions.py":885 + * if replaceSelf: + * self.x, self.y = out[0], out[1] + * if verbose: # <<<<<<<<<<<<<< + * return out, outvel, [True] + * return out, outvel + */ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 885, __pyx_L1_error) + if (__pyx_t_6) { + + /* "collisions.py":886 + * self.x, self.y = out[0], out[1] + * if verbose: + * return out, outvel, [True] # <<<<<<<<<<<<<< + * return out, outvel + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 886, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(Py_True); + __Pyx_GIVEREF(Py_True); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, Py_True)) __PYX_ERR(0, 886, __pyx_L1_error); + __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 886, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_INCREF(__pyx_v_out); + __Pyx_GIVEREF(__pyx_v_out); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_out)) __PYX_ERR(0, 886, __pyx_L1_error); + __Pyx_INCREF(__pyx_v_outvel); + __Pyx_GIVEREF(__pyx_v_outvel); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_v_outvel)) __PYX_ERR(0, 886, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_2)) __PYX_ERR(0, 886, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_r = ((PyObject*)__pyx_t_15); + __pyx_t_15 = 0; + goto __pyx_L0; + + /* "collisions.py":885 + * if replaceSelf: + * self.x, self.y = out[0], out[1] + * if verbose: # <<<<<<<<<<<<<< + * return out, outvel, [True] + * return out, outvel + */ + } + + /* "collisions.py":887 + * if verbose: + * return out, outvel, [True] + * return out, outvel # <<<<<<<<<<<<<< + * + * def handleCollisionsVel(self, + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 887, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_15); + __Pyx_INCREF(__pyx_v_out); + __Pyx_GIVEREF(__pyx_v_out); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_out)) __PYX_ERR(0, 887, __pyx_L1_error); + __Pyx_INCREF(__pyx_v_outvel); + __Pyx_GIVEREF(__pyx_v_outvel); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_v_outvel)) __PYX_ERR(0, 887, __pyx_L1_error); + __pyx_r = ((PyObject*)__pyx_t_15); + __pyx_t_15 = 0; + goto __pyx_L0; + + /* "collisions.py":821 + * return False + * + * def handleCollisionsPos(self, # <<<<<<<<<<<<<< + * oldPoint: Union['Point',pointLike], + * newPoint: Union['Point', pointLike], + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_14); + __Pyx_XDECREF(__pyx_t_15); + __Pyx_AddTraceback("collisions.Point.handleCollisionsPos", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_mvement); + __Pyx_XDECREF(__pyx_v_points); + __Pyx_XDECREF(__pyx_v_o); + __Pyx_XDECREF(__pyx_v_cs); + __Pyx_XDECREF(__pyx_v_closestP); + __Pyx_XDECREF(__pyx_v_closestObj); + __Pyx_XDECREF(__pyx_v_t); + __Pyx_XDECREF(__pyx_v_normal); + __Pyx_XDECREF(__pyx_v_dist_left); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_y); + __Pyx_XDECREF(__pyx_v_phi); + __Pyx_XDECREF(__pyx_v_diff); + __Pyx_XDECREF(__pyx_v_pos); + __Pyx_XDECREF(__pyx_v_smallness); + __Pyx_XDECREF(__pyx_v_out); + __Pyx_XDECREF(__pyx_v_outvel); + __Pyx_XDECREF(__pyx_v_vel); + __Pyx_DECREF((PyObject *)__pyx_cur_scope); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":922 - * GROUPS = {ShpGroups.LINES} - * TYPE = ShpTyps.Line - * def __init__(self, p1: pointLike, p2: pointLike, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< - * """ - * Args: +/* "collisions.py":889 + * return out, outvel + * + * def handleCollisionsVel(self, # <<<<<<<<<<<<<< + * vel: pointLike, + * objs: Union[Shapes,Iterable[Shape]], */ static PyObject *__pyx_pf_10collisions_34__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { @@ -31052,23 +30835,43 @@ static PyObject *__pyx_pf_10collisions_34__defaults__(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 922, __pyx_L1_error) + + /* "collisions.py":894 + * replaceSelf: bool = True, + * precision: Number = BASEPRECISION, + * verbose: bool = False # <<<<<<<<<<<<<< + * ) -> tuple[pointLike, pointLike, verboseOutput]: + * """ + */ + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 922, __pyx_L1_error) + __Pyx_INCREF(((PyObject *)Py_True)); + __Pyx_GIVEREF(((PyObject *)Py_True)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_True))) __PYX_ERR(0, 889, __pyx_L1_error); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self)->__pyx_arg_precision); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self)->__pyx_arg_precision); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 889, __pyx_L1_error); + __Pyx_INCREF(((PyObject *)Py_False)); + __Pyx_GIVEREF(((PyObject *)Py_False)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)Py_False))) __PYX_ERR(0, 889, __pyx_L1_error); + + /* "collisions.py":889 + * return out, outvel + * + * def handleCollisionsVel(self, # <<<<<<<<<<<<<< + * vel: pointLike, + * objs: Union[Shapes,Iterable[Shape]], + */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 922, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 922, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 922, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 889, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None)) __PYX_ERR(0, 922, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 889, __pyx_L1_error); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ @@ -31084,16 +30887,16 @@ static PyObject *__pyx_pf_10collisions_34__defaults__(CYTHON_UNUSED PyObject *__ } /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_1__init__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Point_21handleCollisionsVel(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_4Line___init__, "\n Args:\n p1 (pointLike): The start point of this line\n p2 (pointLike): The end point of this line\n bounciness (float, optional): How bouncy this object is. 1 = rebounds perfectly, <1 = eventually will stop, >1 = will bounce more each time. Defaults to 0.7.\n "); -static PyMethodDef __pyx_mdef_10collisions_4Line_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line___init__}; -static PyObject *__pyx_pw_10collisions_4Line_1__init__(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_5Point_20handleCollisionsVel, "\n Handles movement of this point via velocity and it bouncing off of other objects.\n\n Args:\n vel (pointLike): The velocity of this point\n objs (Shapes / Iterable[Shape]): The objects to bounce off of\n replaceSelf (bool, optional): Whether or not to replace self.x and self.y with the new position. Defaults to True.\n precision (Number, optional): The decimal places to round to to check (for things like corner checking). Defaults to 5.\n verbose (bool, optional): Whether to give verbose output or not. Defaults to False.\n\n Returns:\n tuple[pointLike, pointLike, veboseOutput?]: The new position and vel of this object respectively, and if verbose then the verboseOutput.\n \n VerboseOutput:\n DidReflect (bool): Whether the line reflected off of something\n "); +static PyMethodDef __pyx_mdef_10collisions_5Point_21handleCollisionsVel = {"handleCollisionsVel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_21handleCollisionsVel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Point_20handleCollisionsVel}; +static PyObject *__pyx_pw_10collisions_5Point_21handleCollisionsVel(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -31101,20 +30904,22 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_p1 = 0; - PyObject *__pyx_v_p2 = 0; - double __pyx_v_bounciness; + PyObject *__pyx_v_vel = 0; + PyObject *__pyx_v_objs = 0; + PyObject *__pyx_v_replaceSelf = 0; + PyObject *__pyx_v_precision = 0; + PyObject *__pyx_v_verbose = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[4] = {0,0,0,0}; + PyObject* values[6] = {0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + __Pyx_RefNannySetupContext("handleCollisionsVel (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -31124,11 +30929,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_p1,&__pyx_n_s_p2,&__pyx_n_s_bounciness,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_vel,&__pyx_n_s_objs,&__pyx_n_s_replaceSelf,&__pyx_n_s_precision,&__pyx_n_s_verbose,0}; __pyx_defaults8 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_self); + values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); + values[4] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_precision); + values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { + case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); @@ -31147,42 +30959,60 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 922, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p1)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vel)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 922, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); __PYX_ERR(0, 922, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 1); __PYX_ERR(0, 889, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p2)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_objs)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 922, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); __PYX_ERR(0, 922, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 2); __PYX_ERR(0, 889, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bounciness); + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_replaceSelf); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 922, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_precision); + if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_verbose); + if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 922, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "handleCollisionsVel") < 0)) __PYX_ERR(0, 889, __pyx_L3_error) } } else { switch (__pyx_nargs) { + case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); @@ -31193,17 +31023,15 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } } __pyx_v_self = values[0]; - __pyx_v_p1 = values[1]; - __pyx_v_p2 = values[2]; - if (values[3]) { - __pyx_v_bounciness = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_bounciness == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 922, __pyx_L3_error) - } else { - __pyx_v_bounciness = __pyx_dynamic_args->__pyx_arg_bounciness; - } + __pyx_v_vel = values[1]; + __pyx_v_objs = values[2]; + __pyx_v_replaceSelf = values[3]; + __pyx_v_precision = values[4]; + __pyx_v_verbose = values[5]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 922, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, __pyx_nargs); __PYX_ERR(0, 889, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -31213,11 +31041,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Line.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Point.handleCollisionsVel", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line___init__(__pyx_self, __pyx_v_self, __pyx_v_p1, __pyx_v_p2, __pyx_v_bounciness); + __pyx_r = __pyx_pf_10collisions_5Point_20handleCollisionsVel(__pyx_self, __pyx_v_self, __pyx_v_vel, __pyx_v_objs, __pyx_v_replaceSelf, __pyx_v_precision, __pyx_v_verbose); /* function exit code */ { @@ -31230,129 +31058,278 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_4Line___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2, double __pyx_v_bounciness) { +static PyObject *__pyx_pf_10collisions_5Point_20handleCollisionsVel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_vel, PyObject *__pyx_v_objs, PyObject *__pyx_v_replaceSelf, PyObject *__pyx_v_precision, PyObject *__pyx_v_verbose) { + PyObject *__pyx_v_o = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - unsigned int __pyx_t_5; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + unsigned int __pyx_t_7; + int __pyx_t_8; + PyObject *(*__pyx_t_9)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("handleCollisionsVel", 1); - /* "collisions.py":929 - * bounciness (float, optional): How bouncy this object is. 1 = rebounds perfectly, <1 = eventually will stop, >1 = will bounce more each time. Defaults to 0.7. + /* "collisions.py":912 + * DidReflect (bool): Whether the line reflected off of something * """ - * super().__init__(bounciness) # <<<<<<<<<<<<<< - * self.p1, self.p2 = p1, p2 - * + * o = self.handleCollisionsPos(self, (self.x+vel[0], self.y+vel[1]), objs, vel, False, precision, verbose) # <<<<<<<<<<<<<< + * if replaceSelf: + * self.x, self.y = o[0] */ - __pyx_t_2 = __Pyx_CyFunction_GetClassObj(__pyx_self); - if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 929, __pyx_L1_error) } - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 929, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 929, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_self); - __Pyx_GIVEREF(__pyx_v_self); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(0, 929, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 929, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handleCollisionsPos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 912, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 929, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 912, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 929, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; + __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5)) __PYX_ERR(0, 912, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6)) __PYX_ERR(0, 912, __pyx_L1_error); __pyx_t_5 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = NULL; + __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); + if (likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_7 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + PyObject *__pyx_callargs[8] = {__pyx_t_6, __pyx_v_self, __pyx_t_3, __pyx_v_objs, __pyx_v_vel, Py_False, __pyx_v_precision, __pyx_v_verbose}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 7+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 912, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 929, __pyx_L1_error) + } + __pyx_v_o = __pyx_t_1; + __pyx_t_1 = 0; + + /* "collisions.py":913 + * """ + * o = self.handleCollisionsPos(self, (self.x+vel[0], self.y+vel[1]), objs, vel, False, precision, verbose) + * if replaceSelf: # <<<<<<<<<<<<<< + * self.x, self.y = o[0] + * if verbose: + */ + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_replaceSelf); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 913, __pyx_L1_error) + if (__pyx_t_8) { + + /* "collisions.py":914 + * o = self.handleCollisionsPos(self, (self.x+vel[0], self.y+vel[1]), objs, vel, False, precision, verbose) + * if replaceSelf: + * self.x, self.y = o[0] # <<<<<<<<<<<<<< + * if verbose: + * return o[0], o[1], o[2] + */ + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_o, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) { + PyObject* sequence = __pyx_t_1; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 914, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 914, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); + index = 0; __pyx_t_2 = __pyx_t_9(__pyx_t_6); if (unlikely(!__pyx_t_2)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_9(__pyx_t_6); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_6), 2) < 0) __PYX_ERR(0, 914, __pyx_L1_error) + __pyx_t_9 = NULL; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + goto __pyx_L5_unpacking_done; + __pyx_L4_unpacking_failed:; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_9 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 914, __pyx_L1_error) + __pyx_L5_unpacking_done:; + } + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_2) < 0) __PYX_ERR(0, 914, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_3) < 0) __PYX_ERR(0, 914, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":930 + /* "collisions.py":913 * """ - * super().__init__(bounciness) - * self.p1, self.p2 = p1, p2 # <<<<<<<<<<<<<< + * o = self.handleCollisionsPos(self, (self.x+vel[0], self.y+vel[1]), objs, vel, False, precision, verbose) + * if replaceSelf: # <<<<<<<<<<<<<< + * self.x, self.y = o[0] + * if verbose: + */ + } + + /* "collisions.py":915 + * if replaceSelf: + * self.x, self.y = o[0] + * if verbose: # <<<<<<<<<<<<<< + * return o[0], o[1], o[2] + * return o[0], o[1] + */ + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 915, __pyx_L1_error) + if (__pyx_t_8) { + + /* "collisions.py":916 + * self.x, self.y = o[0] + * if verbose: + * return o[0], o[1], o[2] # <<<<<<<<<<<<<< + * return o[0], o[1] * - * def area(self) -> Number: */ - __pyx_t_1 = __pyx_v_p1; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_3 = __pyx_v_p2; - __Pyx_INCREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p1, __pyx_t_1) < 0) __PYX_ERR(0, 930, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p2, __pyx_t_3) < 0) __PYX_ERR(0, 930, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_o, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_o, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 916, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_o, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 916, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_3)) __PYX_ERR(0, 916, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_3 = 0; + __pyx_t_2 = 0; + __pyx_r = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + goto __pyx_L0; - /* "collisions.py":922 - * GROUPS = {ShpGroups.LINES} - * TYPE = ShpTyps.Line - * def __init__(self, p1: pointLike, p2: pointLike, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< - * """ - * Args: + /* "collisions.py":915 + * if replaceSelf: + * self.x, self.y = o[0] + * if verbose: # <<<<<<<<<<<<<< + * return o[0], o[1], o[2] + * return o[0], o[1] */ + } - /* function exit code */ - __pyx_r = Py_None; __Pyx_INCREF(Py_None); + /* "collisions.py":917 + * if verbose: + * return o[0], o[1], o[2] + * return o[0], o[1] # <<<<<<<<<<<<<< + * + * def copy(self) -> 'Point': + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_o, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_o, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 917, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6)) __PYX_ERR(0, 917, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 917, __pyx_L1_error); + __pyx_t_6 = 0; + __pyx_t_2 = 0; + __pyx_r = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; goto __pyx_L0; + + /* "collisions.py":889 + * return out, outvel + * + * def handleCollisionsVel(self, # <<<<<<<<<<<<<< + * vel: pointLike, + * objs: Union[Shapes,Iterable[Shape]], + */ + + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("collisions.Line.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_AddTraceback("collisions.Point.handleCollisionsVel", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_o); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":932 - * self.p1, self.p2 = p1, p2 +/* "collisions.py":919 + * return o[0], o[1] * - * def area(self) -> Number: # <<<<<<<<<<<<<< + * def copy(self) -> 'Point': # <<<<<<<<<<<<<< * """ - * Gets the area of the shape; the distance between the 2 points making up the line. + * Make a brand new Point with the same values! */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_3area(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Point_23copy(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_4Line_2area, "\n Gets the area of the shape; the distance between the 2 points making up the line.\n\n Returns:\n Number: The distance between the 2 points.\n "); -static PyMethodDef __pyx_mdef_10collisions_4Line_3area = {"area", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_3area, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_2area}; -static PyObject *__pyx_pw_10collisions_4Line_3area(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_5Point_22copy, "\n Make a brand new Point with the same values!\n "); +static PyMethodDef __pyx_mdef_10collisions_5Point_23copy = {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_23copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_5Point_22copy}; +static PyObject *__pyx_pw_10collisions_5Point_23copy(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -31370,7 +31347,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("area (wrapper)", 0); + __Pyx_RefNannySetupContext("copy (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -31396,12 +31373,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 932, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 919, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "area") < 0)) __PYX_ERR(0, 932, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(0, 919, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -31412,7 +31389,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 932, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("copy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 919, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -31422,11 +31399,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Line.area", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Point.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_2area(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_5Point_22copy(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -31439,7 +31416,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_4Line_2area(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_5Point_22copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -31452,83 +31429,59 @@ static PyObject *__pyx_pf_10collisions_4Line_2area(CYTHON_UNUSED PyObject *__pyx int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("area", 1); + __Pyx_RefNannySetupContext("copy", 1); - /* "collisions.py":939 - * Number: The distance between the 2 points. + /* "collisions.py":923 + * Make a brand new Point with the same values! * """ - * return math.hypot(self.p1[0]-self.p2[0], self.p1[1]-self.p2[1]) # <<<<<<<<<<<<<< + * return Point(self.x, self.y, self.bounciness) # <<<<<<<<<<<<<< * - * @property + * def __getitem__(self, item: int) -> Number: */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 939, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Point); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 923, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_hypot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 939, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 939, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 939, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 939, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 939, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 939, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 939, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 939, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 923, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 939, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 923, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 939, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Subtract(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 939, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; __pyx_t_7 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_7 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_2, __pyx_t_5}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); + PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_t_3, __pyx_t_4, __pyx_t_5}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_7, 3+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 939, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":932 - * self.p1, self.p2 = p1, p2 + /* "collisions.py":919 + * return o[0], o[1] * - * def area(self) -> Number: # <<<<<<<<<<<<<< + * def copy(self) -> 'Point': # <<<<<<<<<<<<<< * """ - * Gets the area of the shape; the distance between the 2 points making up the line. + * Make a brand new Point with the same values! */ /* function exit code */ @@ -31539,7 +31492,7 @@ static PyObject *__pyx_pf_10collisions_4Line_2area(CYTHON_UNUSED PyObject *__pyx __Pyx_XDECREF(__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("collisions.Line.area", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Point.copy", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -31547,25 +31500,24 @@ static PyObject *__pyx_pf_10collisions_4Line_2area(CYTHON_UNUSED PyObject *__pyx return __pyx_r; } -/* "collisions.py":941 - * return math.hypot(self.p1[0]-self.p2[0], self.p1[1]-self.p2[1]) +/* "collisions.py":925 + * return Point(self.x, self.y, self.bounciness) * - * @property # <<<<<<<<<<<<<< - * def x(self): - * """One of the line's points' x value. Changing this will move the other point by the difference!""" + * def __getitem__(self, item: int) -> Number: # <<<<<<<<<<<<<< + * if item == 0: + * return self.x */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_5x(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Point_25__getitem__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_4Line_4x, "One of the line's points' x value. Changing this will move the other point by the difference!"); -static PyMethodDef __pyx_mdef_10collisions_4Line_5x = {"x", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_5x, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_4x}; -static PyObject *__pyx_pw_10collisions_4Line_5x(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_5Point_25__getitem__ = {"__getitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_25__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_5Point_25__getitem__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -31573,17 +31525,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_item = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; + PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("x (wrapper)", 0); + __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -31593,10 +31546,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_item,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; @@ -31609,23 +31564,35 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 941, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 925, __pyx_L3_error) else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_item)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 925, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 925, __pyx_L3_error) + } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "x") < 0)) __PYX_ERR(0, 941, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__getitem__") < 0)) __PYX_ERR(0, 925, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 1)) { + } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; + __pyx_v_item = ((PyObject*)values[1]); } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("x", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 941, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 925, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -31635,13 +31602,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Line.x", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Point.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_4x(__pyx_self, __pyx_v_self); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_item), (&PyInt_Type), 0, "item", 1))) __PYX_ERR(0, 925, __pyx_L1_error) + __pyx_r = __pyx_pf_10collisions_5Point_24__getitem__(__pyx_self, __pyx_v_self, __pyx_v_item); /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -31652,46 +31624,137 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_4Line_4x(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_5Point_24__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; + int __pyx_t_2; + PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("x", 1); + __Pyx_RefNannySetupContext("__getitem__", 1); - /* "collisions.py":944 - * def x(self): - * """One of the line's points' x value. Changing this will move the other point by the difference!""" - * return self.p1[0] # <<<<<<<<<<<<<< - * @x.setter - * def x(self, value): + /* "collisions.py":926 + * + * def __getitem__(self, item: int) -> Number: + * if item == 0: # <<<<<<<<<<<<<< + * return self.x + * elif item == 1: */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 944, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 926, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 926, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; + if (__pyx_t_2) { - /* "collisions.py":941 - * return math.hypot(self.p1[0]-self.p2[0], self.p1[1]-self.p2[1]) + /* "collisions.py":927 + * def __getitem__(self, item: int) -> Number: + * if item == 0: + * return self.x # <<<<<<<<<<<<<< + * elif item == 1: + * return self.y + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 927, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "collisions.py":926 * - * @property # <<<<<<<<<<<<<< - * def x(self): - * """One of the line's points' x value. Changing this will move the other point by the difference!""" + * def __getitem__(self, item: int) -> Number: + * if item == 0: # <<<<<<<<<<<<<< + * return self.x + * elif item == 1: + */ + } + + /* "collisions.py":928 + * if item == 0: + * return self.x + * elif item == 1: # <<<<<<<<<<<<<< + * return self.y + * else: + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 928, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 928, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (likely(__pyx_t_2)) { + + /* "collisions.py":929 + * return self.x + * elif item == 1: + * return self.y # <<<<<<<<<<<<<< + * else: + * raise IndexError( + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 929, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "collisions.py":928 + * if item == 0: + * return self.x + * elif item == 1: # <<<<<<<<<<<<<< + * return self.y + * else: + */ + } + + /* "collisions.py":931 + * return self.y + * else: + * raise IndexError( # <<<<<<<<<<<<<< + * 'List index out of range! Must be 0-1, found: '+str(item) + * ) + */ + /*else*/ { + + /* "collisions.py":932 + * else: + * raise IndexError( + * 'List index out of range! Must be 0-1, found: '+str(item) # <<<<<<<<<<<<<< + * ) + * + */ + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_List_index_out_of_range_Must_be, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 932, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "collisions.py":931 + * return self.y + * else: + * raise IndexError( # <<<<<<<<<<<<<< + * 'List index out of range! Must be 0-1, found: '+str(item) + * ) + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 931, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 931, __pyx_L1_error) + } + + /* "collisions.py":925 + * return Point(self.x, self.y, self.bounciness) + * + * def __getitem__(self, item: int) -> Number: # <<<<<<<<<<<<<< + * if item == 0: + * return self.x */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("collisions.Line.x", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("collisions.Point.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -31699,24 +31762,24 @@ static PyObject *__pyx_pf_10collisions_4Line_4x(CYTHON_UNUSED PyObject *__pyx_se return __pyx_r; } -/* "collisions.py":945 - * """One of the line's points' x value. Changing this will move the other point by the difference!""" - * return self.p1[0] - * @x.setter # <<<<<<<<<<<<<< - * def x(self, value): - * diff = value - self.p1[0] +/* "collisions.py":935 + * ) + * + * def __setitem__(self, item: int, new: Number) -> None: # <<<<<<<<<<<<<< + * if item == 0: + * self.x = new */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_7x(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Point_27__setitem__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_4Line_7x = {"x", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_7x, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_4Line_7x(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_5Point_27__setitem__ = {"__setitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_27__setitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_5Point_27__setitem__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -31724,18 +31787,19 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_value = 0; + PyObject *__pyx_v_item = 0; + PyObject *__pyx_v_new = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[2] = {0,0}; + PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("x (wrapper)", 0); + __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -31745,10 +31809,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_item,&__pyx_n_s_new,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); @@ -31763,35 +31829,47 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 945, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 935, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_item)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 945, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 935, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 935, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_new)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 935, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("x", 1, 2, 2, 1); __PYX_ERR(0, 945, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 935, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "x") < 0)) __PYX_ERR(0, 945, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(0, 935, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 2)) { + } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } __pyx_v_self = values[0]; - __pyx_v_value = values[1]; + __pyx_v_item = ((PyObject*)values[1]); + __pyx_v_new = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("x", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 945, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 935, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -31801,13 +31879,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Line.x", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Point.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_6x(__pyx_self, __pyx_v_self, __pyx_v_value); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_item), (&PyInt_Type), 0, "item", 1))) __PYX_ERR(0, 935, __pyx_L1_error) + __pyx_r = __pyx_pf_10collisions_5Point_26__setitem__(__pyx_self, __pyx_v_self, __pyx_v_item, __pyx_v_new); /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -31818,96 +31901,123 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_4Line_6x(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - PyObject *__pyx_v_diff = NULL; +static PyObject *__pyx_pf_10collisions_5Point_26__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_new) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; + int __pyx_t_2; PyObject *__pyx_t_3 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("x", 1); + __Pyx_RefNannySetupContext("__setitem__", 1); - /* "collisions.py":947 - * @x.setter - * def x(self, value): - * diff = value - self.p1[0] # <<<<<<<<<<<<<< - * self.p1 = [value, self.p1[1]] - * self.p2 = [self.p2[0]+diff, self.p2[1]] + /* "collisions.py":936 + * + * def __setitem__(self, item: int, new: Number) -> None: + * if item == 0: # <<<<<<<<<<<<<< + * self.x = new + * elif item == 1: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 947, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 947, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 936, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Subtract(__pyx_v_value, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 947, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_diff = __pyx_t_1; - __pyx_t_1 = 0; + if (__pyx_t_2) { - /* "collisions.py":948 - * def x(self, value): - * diff = value - self.p1[0] - * self.p1 = [value, self.p1[1]] # <<<<<<<<<<<<<< - * self.p2 = [self.p2[0]+diff, self.p2[1]] - * + /* "collisions.py":937 + * def __setitem__(self, item: int, new: Number) -> None: + * if item == 0: + * self.x = new # <<<<<<<<<<<<<< + * elif item == 1: + * self.y = new */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 948, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_value)) __PYX_ERR(0, 948, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 948, __pyx_L1_error); - __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p1, __pyx_t_1) < 0) __PYX_ERR(0, 948, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_v_new) < 0) __PYX_ERR(0, 937, __pyx_L1_error) - /* "collisions.py":949 - * diff = value - self.p1[0] - * self.p1 = [value, self.p1[1]] - * self.p2 = [self.p2[0]+diff, self.p2[1]] # <<<<<<<<<<<<<< + /* "collisions.py":936 * - * @property + * def __setitem__(self, item: int, new: Number) -> None: + * if item == 0: # <<<<<<<<<<<<<< + * self.x = new + * elif item == 1: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 949, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 949, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + goto __pyx_L3; + } + + /* "collisions.py":938 + * if item == 0: + * self.x = new + * elif item == 1: # <<<<<<<<<<<<<< + * self.y = new + * else: + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 938, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 938, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_diff); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 949, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 949, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 949, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 949, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 949, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_3)) __PYX_ERR(0, 949, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_3 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p2, __pyx_t_2) < 0) __PYX_ERR(0, 949, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (likely(__pyx_t_2)) { - /* "collisions.py":945 - * """One of the line's points' x value. Changing this will move the other point by the difference!""" - * return self.p1[0] - * @x.setter # <<<<<<<<<<<<<< - * def x(self, value): - * diff = value - self.p1[0] + /* "collisions.py":939 + * self.x = new + * elif item == 1: + * self.y = new # <<<<<<<<<<<<<< + * else: + * raise IndexError( + */ + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_v_new) < 0) __PYX_ERR(0, 939, __pyx_L1_error) + + /* "collisions.py":938 + * if item == 0: + * self.x = new + * elif item == 1: # <<<<<<<<<<<<<< + * self.y = new + * else: + */ + goto __pyx_L3; + } + + /* "collisions.py":941 + * self.y = new + * else: + * raise IndexError( # <<<<<<<<<<<<<< + * 'List index out of range! Must be 0-1, found: '+str(item) + * ) + */ + /*else*/ { + + /* "collisions.py":942 + * else: + * raise IndexError( + * 'List index out of range! Must be 0-1, found: '+str(item) # <<<<<<<<<<<<<< + * ) + * + */ + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 942, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_List_index_out_of_range_Must_be, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 942, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "collisions.py":941 + * self.y = new + * else: + * raise IndexError( # <<<<<<<<<<<<<< + * 'List index out of range! Must be 0-1, found: '+str(item) + * ) + */ + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 941, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_Raise(__pyx_t_1, 0, 0, 0); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __PYX_ERR(0, 941, __pyx_L1_error) + } + __pyx_L3:; + + /* "collisions.py":935 + * ) + * + * def __setitem__(self, item: int, new: Number) -> None: # <<<<<<<<<<<<<< + * if item == 0: + * self.x = new */ /* function exit code */ @@ -31915,36 +32025,33 @@ static PyObject *__pyx_pf_10collisions_4Line_6x(CYTHON_UNUSED PyObject *__pyx_se goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("collisions.Line.x", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Point.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_diff); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":951 - * self.p2 = [self.p2[0]+diff, self.p2[1]] +/* "collisions.py":945 + * ) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * return iter([self.x, self.y]) * - * @property # <<<<<<<<<<<<<< - * def y(self): - * """One of the line's points' y value. Changing this will move the other point by the difference!""" */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_9y(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Point_29__iter__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_4Line_8y, "One of the line's points' y value. Changing this will move the other point by the difference!"); -static PyMethodDef __pyx_mdef_10collisions_4Line_9y = {"y", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_9y, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_8y}; -static PyObject *__pyx_pw_10collisions_4Line_9y(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_5Point_29__iter__ = {"__iter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_29__iter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_5Point_29__iter__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -31962,7 +32069,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("y (wrapper)", 0); + __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -31988,12 +32095,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 951, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 945, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "y") < 0)) __PYX_ERR(0, 951, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__iter__") < 0)) __PYX_ERR(0, 945, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -32004,7 +32111,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("y", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 951, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 945, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -32014,11 +32121,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Line.y", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Point.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_8y(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_5Point_28__iter__(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -32031,46 +32138,58 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_4Line_8y(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_5Point_28__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("y", 1); + __Pyx_RefNannySetupContext("__iter__", 1); - /* "collisions.py":954 - * def y(self): - * """One of the line's points' y value. Changing this will move the other point by the difference!""" - * return self.p1[1] # <<<<<<<<<<<<<< - * @y.setter - * def y(self, value): + /* "collisions.py":946 + * + * def __iter__(self): + * return iter([self.x, self.y]) # <<<<<<<<<<<<<< + * + * def __str__(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 954, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 946, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 954, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 946, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 946, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 946, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 946, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 946, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":951 - * self.p2 = [self.p2[0]+diff, self.p2[1]] + /* "collisions.py":945 + * ) + * + * def __iter__(self): # <<<<<<<<<<<<<< + * return iter([self.x, self.y]) * - * @property # <<<<<<<<<<<<<< - * def y(self): - * """One of the line's points' y value. Changing this will move the other point by the difference!""" */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("collisions.Line.y", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("collisions.Point.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -32078,24 +32197,24 @@ static PyObject *__pyx_pf_10collisions_4Line_8y(CYTHON_UNUSED PyObject *__pyx_se return __pyx_r; } -/* "collisions.py":955 - * """One of the line's points' y value. Changing this will move the other point by the difference!""" - * return self.p1[1] - * @y.setter # <<<<<<<<<<<<<< - * def y(self, value): - * diff = value - self.p1[1] +/* "collisions.py":948 + * return iter([self.x, self.y]) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return f'' + * */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_11y(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_5Point_31__str__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_4Line_11y = {"y", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_11y, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_4Line_11y(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_5Point_31__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_5Point_31__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_5Point_31__str__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -32103,18 +32222,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_value = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[2] = {0,0}; + PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("y (wrapper)", 0); + __Pyx_RefNannySetupContext("__str__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -32124,12 +32242,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; @@ -32142,35 +32258,23 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 955, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 948, __pyx_L3_error) else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 955, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("y", 1, 2, 2, 1); __PYX_ERR(0, 955, __pyx_L3_error) - } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "y") < 0)) __PYX_ERR(0, 955, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 948, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 2)) { + } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; - __pyx_v_value = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("y", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 955, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 948, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -32180,11 +32284,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Line.y", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Point.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_10y(__pyx_self, __pyx_v_self, __pyx_v_value); + __pyx_r = __pyx_pf_10collisions_5Point_30__str__(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -32197,153 +32301,172 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_4Line_10y(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value) { - PyObject *__pyx_v_diff = NULL; +static PyObject *__pyx_pf_10collisions_5Point_30__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; + Py_ssize_t __pyx_t_2; + Py_UCS4 __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("y", 1); - - /* "collisions.py":957 - * @y.setter - * def y(self, value): - * diff = value - self.p1[1] # <<<<<<<<<<<<<< - * self.p1 = [self.p1[0], value] - * self.p2 = [self.p2[0], self.p2[1]+diff] - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 957, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 957, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Subtract(__pyx_v_value, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 957, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_diff = __pyx_t_1; - __pyx_t_1 = 0; + __Pyx_RefNannySetupContext("__str__", 1); - /* "collisions.py":958 - * def y(self, value): - * diff = value - self.p1[1] - * self.p1 = [self.p1[0], value] # <<<<<<<<<<<<<< - * self.p2 = [self.p2[0], self.p2[1]+diff] + /* "collisions.py":949 + * + * def __str__(self): + * return f'' # <<<<<<<<<<<<<< * + * class Line(Shape): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 958, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 958, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 958, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 958, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_value); - __Pyx_GIVEREF(__pyx_v_value); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_v_value)) __PYX_ERR(0, 958, __pyx_L1_error); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p1, __pyx_t_1) < 0) __PYX_ERR(0, 958, __pyx_L1_error) + __pyx_t_3 = 127; + __Pyx_INCREF(__pyx_kp_u_Point_2); + __pyx_t_2 += 10; + __Pyx_GIVEREF(__pyx_kp_u_Point_2); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Point_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 949, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 949, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; + __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_INCREF(__pyx_kp_u__8); + __pyx_t_2 += 2; + __Pyx_GIVEREF(__pyx_kp_u__8); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__8); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 949, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 949, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; + __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_kp_u__9); + __pyx_t_2 += 2; + __Pyx_GIVEREF(__pyx_kp_u__9); + PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__9); + __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 949, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; - /* "collisions.py":959 - * diff = value - self.p1[1] - * self.p1 = [self.p1[0], value] - * self.p2 = [self.p2[0], self.p2[1]+diff] # <<<<<<<<<<<<<< + /* "collisions.py":948 + * return iter([self.x, self.y]) * - * # Some code yoinked off of https://www.geeksforgeeks.org/check-if-two-given-line-segments-intersect/ modified for this use case and debugged + * def __str__(self): # <<<<<<<<<<<<<< + * return f'' + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("collisions.Point.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":955 + * GROUPS = {ShpGroups.LINES} + * TYPE = ShpTyps.Line + * def __init__(self, p1: pointLike, p2: pointLike, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< + * """ + * Args: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error) + +static PyObject *__pyx_pf_10collisions_36__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __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("__defaults__", 1); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 959, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_v_diff); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 955, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 959, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 959, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 955, __pyx_L1_error); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None)) __PYX_ERR(0, 955, __pyx_L1_error); __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p2, __pyx_t_3) < 0) __PYX_ERR(0, 959, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "collisions.py":955 - * """One of the line's points' y value. Changing this will move the other point by the difference!""" - * return self.p1[1] - * @y.setter # <<<<<<<<<<<<<< - * def y(self, value): - * diff = value - self.p1[1] - */ + goto __pyx_L0; /* 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_3); - __Pyx_AddTraceback("collisions.Line.y", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_diff); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":963 - * # Some code yoinked off of https://www.geeksforgeeks.org/check-if-two-given-line-segments-intersect/ modified for this use case and debugged - * - * @staticmethod # <<<<<<<<<<<<<< - * def _onSegment(p, a, b): - * """ - */ - /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_13_onSegment(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_4Line_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_4Line_12_onSegment, "\n Given three collinear points p, a, b, the function checks if point p lies on line segment 'ab'\n "); -static PyMethodDef __pyx_mdef_10collisions_4Line_13_onSegment = {"_onSegment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_13_onSegment, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_12_onSegment}; -static PyObject *__pyx_pw_10collisions_4Line_13_onSegment(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_4Line___init__, "\n Args:\n p1 (pointLike): The start point of this line\n p2 (pointLike): The end point of this line\n bounciness (float, optional): How bouncy this object is. 1 = rebounds perfectly, <1 = eventually will stop, >1 = will bounce more each time. Defaults to 0.7.\n "); +static PyMethodDef __pyx_mdef_10collisions_4Line_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line___init__}; +static PyObject *__pyx_pw_10collisions_4Line_1__init__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_p = 0; - PyObject *__pyx_v_a = 0; - PyObject *__pyx_v_b = 0; + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_p1 = 0; + PyObject *__pyx_v_p2 = 0; + double __pyx_v_bounciness; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[3] = {0,0,0}; + PyObject* values[4] = {0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_onSegment (wrapper)", 0); + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -32353,10 +32476,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_a,&__pyx_n_s_b,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_p1,&__pyx_n_s_p2,&__pyx_n_s_bounciness,0}; + __pyx_defaults9 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_self); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); @@ -32369,51 +32495,67 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 963, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 955, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 963, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 955, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_onSegment", 1, 3, 3, 1); __PYX_ERR(0, 963, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 1); __PYX_ERR(0, 955, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 963, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 955, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_onSegment", 1, 3, 3, 2); __PYX_ERR(0, 963, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, 2); __PYX_ERR(0, 955, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bounciness); + if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 955, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_onSegment") < 0)) __PYX_ERR(0, 963, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 955, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 3)) { - goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + switch (__pyx_nargs) { + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_p1 = values[1]; + __pyx_v_p2 = values[2]; + if (values[3]) { + __pyx_v_bounciness = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_bounciness == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 955, __pyx_L3_error) + } else { + __pyx_v_bounciness = __pyx_dynamic_args->__pyx_arg_bounciness; } - __pyx_v_p = values[0]; - __pyx_v_a = values[1]; - __pyx_v_b = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_onSegment", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 963, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 4, __pyx_nargs); __PYX_ERR(0, 955, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -32423,11 +32565,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Line._onSegment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Line.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_12_onSegment(__pyx_self, __pyx_v_p, __pyx_v_a, __pyx_v_b); + __pyx_r = __pyx_pf_10collisions_4Line___init__(__pyx_self, __pyx_v_self, __pyx_v_p1, __pyx_v_p2, __pyx_v_bounciness); /* function exit code */ { @@ -32440,267 +32582,129 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_4Line_12_onSegment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_a, PyObject *__pyx_v_b) { - PyObject *__pyx_v_cross_product = NULL; +static PyObject *__pyx_pf_10collisions_4Line___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2, double __pyx_v_bounciness) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; + unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_onSegment", 1); + __Pyx_RefNannySetupContext("__init__", 1); - /* "collisions.py":969 + /* "collisions.py":962 + * bounciness (float, optional): How bouncy this object is. 1 = rebounds perfectly, <1 = eventually will stop, >1 = will bounce more each time. Defaults to 0.7. * """ - * # Calculate the cross product - * cross_product = (p[1] - a[1]) * (b[0] - a[0]) - (p[0] - a[0]) * (b[1] - a[1]) # <<<<<<<<<<<<<< + * super().__init__(bounciness) # <<<<<<<<<<<<<< + * self.p1, self.p2 = p1, p2 * - * # If the cross product is not zero, the point is not on the line */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 969, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_a, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 969, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 969, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_b, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 969, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_a, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 969, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 969, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 969, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 969, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_a, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 969, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_GetClassObj(__pyx_self); + if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 962, __pyx_L1_error) } + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 962, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 969, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 962, __pyx_L1_error); + __Pyx_INCREF(__pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(0, 962, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 962, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_b, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 969, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 962, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_a, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 969, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 969, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 969, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 969, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_cross_product = __pyx_t_5; + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 962, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 962, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":972 - * - * # If the cross product is not zero, the point is not on the line - * if abs(cross_product) != 0: # <<<<<<<<<<<<<< - * return False + /* "collisions.py":963 + * """ + * super().__init__(bounciness) + * self.p1, self.p2 = p1, p2 # <<<<<<<<<<<<<< * + * def area(self) -> Number: */ - __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_v_cross_product); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 972, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = (__Pyx_PyInt_BoolNeObjC(__pyx_t_5, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 972, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_6) { + __pyx_t_1 = __pyx_v_p1; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_v_p2; + __Pyx_INCREF(__pyx_t_3); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p1, __pyx_t_1) < 0) __PYX_ERR(0, 963, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p2, __pyx_t_3) < 0) __PYX_ERR(0, 963, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":973 - * # If the cross product is not zero, the point is not on the line - * if abs(cross_product) != 0: - * return False # <<<<<<<<<<<<<< - * - * # Check if the point is within the bounding box of the line segment - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; - - /* "collisions.py":972 - * - * # If the cross product is not zero, the point is not on the line - * if abs(cross_product) != 0: # <<<<<<<<<<<<<< - * return False - * - */ - } - - /* "collisions.py":976 - * - * # Check if the point is within the bounding box of the line segment - * return min(a[0], b[0]) <= p[0] <= max(a[0], b[0]) and min(a[1], b[1]) <= p[1] <= max(a[1], b[1]) # <<<<<<<<<<<<<< - * - * def rect(self) -> Iterable[Number]: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_b, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_a, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 976, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 976, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - __Pyx_INCREF(__pyx_t_4); - __pyx_t_2 = __pyx_t_4; - } else { - __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = __pyx_t_1; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error) - if (__Pyx_PyObject_IsTrue(__pyx_t_1)) { - __Pyx_DECREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_b, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 976, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_a, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 976, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = PyObject_RichCompare(__pyx_t_3, __pyx_t_7, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 976, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 976, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (__pyx_t_6) { - __Pyx_INCREF(__pyx_t_3); - __pyx_t_8 = __pyx_t_3; - } else { - __Pyx_INCREF(__pyx_t_7); - __pyx_t_8 = __pyx_t_7; - } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_8, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 976, __pyx_L1_error) - if (__pyx_t_6) { - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else { - __Pyx_INCREF(__pyx_t_1); - __pyx_t_5 = __pyx_t_1; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_b, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_a, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 976, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 976, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__pyx_t_6) { - __Pyx_INCREF(__pyx_t_1); - __pyx_t_2 = __pyx_t_1; - } else { - __Pyx_INCREF(__pyx_t_4); - __pyx_t_2 = __pyx_t_4; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L1_error) - if (__Pyx_PyObject_IsTrue(__pyx_t_4)) { - __Pyx_DECREF(__pyx_t_4); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_b, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 976, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_a, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 976, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 976, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 976, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (__pyx_t_6) { - __Pyx_INCREF(__pyx_t_8); - __pyx_t_7 = __pyx_t_8; - } else { - __Pyx_INCREF(__pyx_t_3); - __pyx_t_7 = __pyx_t_3; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_7, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 976, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_INCREF(__pyx_t_4); - __pyx_t_5 = __pyx_t_4; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_L4_bool_binop_done:; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; - - /* "collisions.py":963 - * # Some code yoinked off of https://www.geeksforgeeks.org/check-if-two-given-line-segments-intersect/ modified for this use case and debugged - * - * @staticmethod # <<<<<<<<<<<<<< - * def _onSegment(p, a, b): - * """ + /* "collisions.py":955 + * GROUPS = {ShpGroups.LINES} + * TYPE = ShpTyps.Line + * def __init__(self, p1: pointLike, p2: pointLike, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< + * """ + * Args: */ /* 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_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("collisions.Line._onSegment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Line.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_cross_product); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":978 - * return min(a[0], b[0]) <= p[0] <= max(a[0], b[0]) and min(a[1], b[1]) <= p[1] <= max(a[1], b[1]) +/* "collisions.py":965 + * self.p1, self.p2 = p1, p2 * - * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< + * def area(self) -> Number: # <<<<<<<<<<<<<< * """ - * Returns the rectangle bounding box surrounding this line. + * Gets the area of the shape; the distance between the 2 points making up the line. */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_15rect(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_4Line_3area(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_4Line_14rect, "\n Returns the rectangle bounding box surrounding this line.\n\n Returns:\n Iterable[Number]: (min x, min y, max x, max y)\n "); -static PyMethodDef __pyx_mdef_10collisions_4Line_15rect = {"rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_15rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_14rect}; -static PyObject *__pyx_pw_10collisions_4Line_15rect(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_4Line_2area, "\n Gets the area of the shape; the distance between the 2 points making up the line.\n\n Returns:\n Number: The distance between the 2 points.\n "); +static PyMethodDef __pyx_mdef_10collisions_4Line_3area = {"area", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_3area, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_2area}; +static PyObject *__pyx_pw_10collisions_4Line_3area(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -32718,7 +32722,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("rect (wrapper)", 0); + __Pyx_RefNannySetupContext("area (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -32744,12 +32748,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 978, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 965, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rect") < 0)) __PYX_ERR(0, 978, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "area") < 0)) __PYX_ERR(0, 965, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -32760,7 +32764,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 978, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 965, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -32770,11 +32774,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Line.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Line.area", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_14rect(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_4Line_2area(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -32787,146 +32791,96 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_4Line_14rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_4Line_2area(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; + PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; + unsigned int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("rect", 1); + __Pyx_RefNannySetupContext("area", 1); - /* "collisions.py":985 - * Iterable[Number]: (min x, min y, max x, max y) + /* "collisions.py":972 + * Number: The distance between the 2 points. * """ - * return min(self.p1[0], self.p2[0]), min(self.p1[1], self.p2[1]), max(self.p1[0], self.p2[0]), max(self.p1[1], self.p2[1]) # <<<<<<<<<<<<<< + * return math.hypot(self.p1[0]-self.p2[0], self.p1[1]-self.p2[1]) # <<<<<<<<<<<<<< * - * def toLines(self) -> Iterable['Line']: + * @property */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 985, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 985, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 985, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 985, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_hypot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 985, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 985, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_5) { - __Pyx_INCREF(__pyx_t_2); - __pyx_t_1 = __pyx_t_2; - } else { - __Pyx_INCREF(__pyx_t_3); - __pyx_t_1 = __pyx_t_3; - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 985, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 985, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 972, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 985, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 985, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 972, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 985, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 985, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__pyx_t_5) { - __Pyx_INCREF(__pyx_t_3); - __pyx_t_2 = __pyx_t_3; - } else { - __Pyx_INCREF(__pyx_t_4); - __pyx_t_2 = __pyx_t_4; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 985, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 985, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 985, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 985, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 985, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 985, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_5) { - __Pyx_INCREF(__pyx_t_4); - __pyx_t_3 = __pyx_t_4; - } else { - __Pyx_INCREF(__pyx_t_6); - __pyx_t_3 = __pyx_t_6; - } - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_2 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 972, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 985, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 972, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 985, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 972, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_Subtract(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 972, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 985, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 985, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_t_6, __pyx_t_7, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 985, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 985, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__pyx_t_5) { - __Pyx_INCREF(__pyx_t_6); - __pyx_t_4 = __pyx_t_6; - } else { - __Pyx_INCREF(__pyx_t_7); - __pyx_t_4 = __pyx_t_7; - } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 985, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(0, 985, __pyx_L1_error); - __Pyx_INCREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2)) __PYX_ERR(0, 985, __pyx_L1_error); - __Pyx_INCREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3)) __PYX_ERR(0, 985, __pyx_L1_error); - __Pyx_INCREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_4)) __PYX_ERR(0, 985, __pyx_L1_error); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_r = __pyx_t_6; - __pyx_t_6 = 0; + __pyx_t_6 = NULL; + __pyx_t_7 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_7 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_2, __pyx_t_5}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 972, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":978 - * return min(a[0], b[0]) <= p[0] <= max(a[0], b[0]) and min(a[1], b[1]) <= p[1] <= max(a[1], b[1]) + /* "collisions.py":965 + * self.p1, self.p2 = p1, p2 * - * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< + * def area(self) -> Number: # <<<<<<<<<<<<<< * """ - * Returns the rectangle bounding box surrounding this line. + * Gets the area of the shape; the distance between the 2 points making up the line. */ /* function exit code */ @@ -32935,10 +32889,9 @@ static PyObject *__pyx_pf_10collisions_4Line_14rect(CYTHON_UNUSED PyObject *__py __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_AddTraceback("collisions.Line.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Line.area", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -32946,25 +32899,25 @@ static PyObject *__pyx_pf_10collisions_4Line_14rect(CYTHON_UNUSED PyObject *__py return __pyx_r; } -/* "collisions.py":987 - * return min(self.p1[0], self.p2[0]), min(self.p1[1], self.p2[1]), max(self.p1[0], self.p2[0]), max(self.p1[1], self.p2[1]) +/* "collisions.py":974 + * return math.hypot(self.p1[0]-self.p2[0], self.p1[1]-self.p2[1]) * - * def toLines(self) -> Iterable['Line']: # <<<<<<<<<<<<<< - * """ - * Returns: + * @property # <<<<<<<<<<<<<< + * def x(self): + * """One of the line's points' x value. Changing this will move the other point by the difference!""" */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_17toLines(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_4Line_5x(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_4Line_16toLines, "\n Returns:\n Iterable[Line]: Get a list of all the Lines that make up this object; i.e. just this one line.\n "); -static PyMethodDef __pyx_mdef_10collisions_4Line_17toLines = {"toLines", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_17toLines, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_16toLines}; -static PyObject *__pyx_pw_10collisions_4Line_17toLines(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_4Line_4x, "One of the line's points' x value. Changing this will move the other point by the difference!"); +static PyMethodDef __pyx_mdef_10collisions_4Line_5x = {"x", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_5x, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_4x}; +static PyObject *__pyx_pw_10collisions_4Line_5x(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -32982,7 +32935,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("toLines (wrapper)", 0); + __Pyx_RefNannySetupContext("x (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -33008,12 +32961,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 987, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 974, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toLines") < 0)) __PYX_ERR(0, 987, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "x") < 0)) __PYX_ERR(0, 974, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -33024,7 +32977,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("toLines", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 987, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("x", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 974, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -33034,11 +32987,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Line.toLines", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Line.x", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_16toLines(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_4Line_4x(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -33051,44 +33004,46 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_4Line_16toLines(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_4Line_4x(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __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("toLines", 1); + __Pyx_RefNannySetupContext("x", 1); - /* "collisions.py":992 - * Iterable[Line]: Get a list of all the Lines that make up this object; i.e. just this one line. - * """ - * return [self] # <<<<<<<<<<<<<< - * - * def toPoints(self) -> Iterable[pointLike]: + /* "collisions.py":977 + * def x(self): + * """One of the line's points' x value. Changing this will move the other point by the difference!""" + * return self.p1[0] # <<<<<<<<<<<<<< + * @x.setter + * def x(self, value): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 992, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 977, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_v_self); - __Pyx_GIVEREF(__pyx_v_self); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_self)) __PYX_ERR(0, 992, __pyx_L1_error); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 977, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":987 - * return min(self.p1[0], self.p2[0]), min(self.p1[1], self.p2[1]), max(self.p1[0], self.p2[0]), max(self.p1[1], self.p2[1]) + /* "collisions.py":974 + * return math.hypot(self.p1[0]-self.p2[0], self.p1[1]-self.p2[1]) * - * def toLines(self) -> Iterable['Line']: # <<<<<<<<<<<<<< - * """ - * Returns: + * @property # <<<<<<<<<<<<<< + * def x(self): + * """One of the line's points' x value. Changing this will move the other point by the difference!""" */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("collisions.Line.toLines", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("collisions.Line.x", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -33096,25 +33051,24 @@ static PyObject *__pyx_pf_10collisions_4Line_16toLines(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":994 - * return [self] - * - * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * """ - * Returns: +/* "collisions.py":978 + * """One of the line's points' x value. Changing this will move the other point by the difference!""" + * return self.p1[0] + * @x.setter # <<<<<<<<<<<<<< + * def x(self, value): + * diff = value - self.p1[0] */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_19toPoints(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_4Line_7x(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_4Line_18toPoints, "\n Returns:\n Iterable[pointLike]: Get a list of all the Points that make up this object.\n "); -static PyMethodDef __pyx_mdef_10collisions_4Line_19toPoints = {"toPoints", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_19toPoints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_18toPoints}; -static PyObject *__pyx_pw_10collisions_4Line_19toPoints(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_4Line_7x = {"x", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_7x, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_4Line_7x(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -33122,17 +33076,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_value = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; + PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("toPoints (wrapper)", 0); + __Pyx_RefNannySetupContext("x (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -33142,10 +33097,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; @@ -33158,23 +33115,35 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 994, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 978, __pyx_L3_error) else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 978, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("x", 1, 2, 2, 1); __PYX_ERR(0, 978, __pyx_L3_error) + } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toPoints") < 0)) __PYX_ERR(0, 994, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "x") < 0)) __PYX_ERR(0, 978, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 1)) { + } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; + __pyx_v_value = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("toPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 994, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("x", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 978, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -33184,11 +33153,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Line.toPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Line.x", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_18toPoints(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_4Line_6x(__pyx_self, __pyx_v_self, __pyx_v_value); /* function exit code */ { @@ -33201,7 +33170,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_4Line_18toPoints(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_4Line_6x(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + PyObject *__pyx_v_diff = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -33210,90 +33180,141 @@ static PyObject *__pyx_pf_10collisions_4Line_18toPoints(CYTHON_UNUSED PyObject * int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("toPoints", 1); + __Pyx_RefNannySetupContext("x", 1); - /* "collisions.py":999 - * Iterable[pointLike]: Get a list of all the Points that make up this object. - * """ - * return [self.p1, self.p2] # <<<<<<<<<<<<<< + /* "collisions.py":980 + * @x.setter + * def x(self, value): + * diff = value - self.p1[0] # <<<<<<<<<<<<<< + * self.p1 = [value, self.p1[1]] + * self.p2 = [self.p2[0]+diff, self.p2[1]] + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 980, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_v_value, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_diff = __pyx_t_1; + __pyx_t_1 = 0; + + /* "collisions.py":981 + * def x(self, value): + * diff = value - self.p1[0] + * self.p1 = [value, self.p1[1]] # <<<<<<<<<<<<<< + * self.p2 = [self.p2[0]+diff, self.p2[1]] * - * def _contains(self, othershape: Shape) -> bool: */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_value)) __PYX_ERR(0, 981, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error); + __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p1, __pyx_t_1) < 0) __PYX_ERR(0, 981, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "collisions.py":982 + * diff = value - self.p1[0] + * self.p1 = [value, self.p1[1]] + * self.p2 = [self.p2[0]+diff, self.p2[1]] # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 982, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 982, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_diff); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 999, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 999, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 982, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 999, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 999, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 982, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_3)) __PYX_ERR(0, 982, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; __pyx_t_3 = 0; - goto __pyx_L0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p2, __pyx_t_2) < 0) __PYX_ERR(0, 982, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":994 - * return [self] - * - * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * """ - * Returns: + /* "collisions.py":978 + * """One of the line's points' x value. Changing this will move the other point by the difference!""" + * return self.p1[0] + * @x.setter # <<<<<<<<<<<<<< + * def x(self, value): + * diff = value - self.p1[0] */ /* 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_3); - __Pyx_AddTraceback("collisions.Line.toPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Line.x", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_diff); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":1001 - * return [self.p1, self.p2] - * - * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * return False +/* "collisions.py":984 + * self.p2 = [self.p2[0]+diff, self.p2[1]] * + * @property # <<<<<<<<<<<<<< + * def y(self): + * """One of the line's points' y value. Changing this will move the other point by the difference!""" */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_21_contains(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_4Line_9y(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_4Line_21_contains = {"_contains", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_21_contains, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_4Line_21_contains(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_4Line_8y, "One of the line's points' y value. Changing this will move the other point by the difference!"); +static PyMethodDef __pyx_mdef_10collisions_4Line_9y = {"y", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_9y, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_8y}; +static PyObject *__pyx_pw_10collisions_4Line_9y(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - CYTHON_UNUSED PyObject *__pyx_v_self = 0; - CYTHON_UNUSED PyObject *__pyx_v_othershape = 0; + PyObject *__pyx_v_self = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[2] = {0,0}; + PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_contains (wrapper)", 0); + __Pyx_RefNannySetupContext("y (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -33303,12 +33324,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_othershape,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; @@ -33321,35 +33340,23 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1001, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 984, __pyx_L3_error) else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_othershape)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1001, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, 1); __PYX_ERR(0, 1001, __pyx_L3_error) - } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_contains") < 0)) __PYX_ERR(0, 1001, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "y") < 0)) __PYX_ERR(0, 984, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 2)) { + } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; - __pyx_v_othershape = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1001, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("y", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 984, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -33359,11 +33366,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Line._contains", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Line.y", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_20_contains(__pyx_self, __pyx_v_self, __pyx_v_othershape); + __pyx_r = __pyx_pf_10collisions_4Line_8y(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -33376,56 +33383,71 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_4Line_20_contains(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_othershape) { +static PyObject *__pyx_pf_10collisions_4Line_8y(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_contains", 1); + 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("y", 1); - /* "collisions.py":1002 - * - * def _contains(self, othershape: Shape) -> bool: - * return False # <<<<<<<<<<<<<< - * - * def _collides(self, othershape: Shape) -> bool: + /* "collisions.py":987 + * def y(self): + * """One of the line's points' y value. Changing this will move the other point by the difference!""" + * return self.p1[1] # <<<<<<<<<<<<<< + * @y.setter + * def y(self, value): */ __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 987, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 987, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1001 - * return [self.p1, self.p2] - * - * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * return False + /* "collisions.py":984 + * self.p2 = [self.p2[0]+diff, self.p2[1]] * + * @property # <<<<<<<<<<<<<< + * def y(self): + * """One of the line's points' y value. Changing this will move the other point by the difference!""" */ /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("collisions.Line.y", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":1004 - * return False - * - * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * if checkShpType(othershape, ShpTyps.Point): - * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) +/* "collisions.py":988 + * """One of the line's points' y value. Changing this will move the other point by the difference!""" + * return self.p1[1] + * @y.setter # <<<<<<<<<<<<<< + * def y(self, value): + * diff = value - self.p1[1] */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_23_collides(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_4Line_11y(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_4Line_23_collides = {"_collides", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_23_collides, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_4Line_23_collides(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_4Line_11y = {"y", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_11y, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_4Line_11y(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -33433,7 +33455,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_othershape = 0; + PyObject *__pyx_v_value = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -33444,7 +33466,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_collides (wrapper)", 0); + __Pyx_RefNannySetupContext("y (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -33454,7 +33476,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_othershape,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -33472,22 +33494,22 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1004, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 988, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_othershape)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1004, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 988, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 1004, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("y", 1, 2, 2, 1); __PYX_ERR(0, 988, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_collides") < 0)) __PYX_ERR(0, 1004, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "y") < 0)) __PYX_ERR(0, 988, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -33496,11 +33518,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; - __pyx_v_othershape = values[1]; + __pyx_v_value = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1004, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("y", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 988, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -33510,11 +33532,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Line._collides", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Line.y", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_22_collides(__pyx_self, __pyx_v_self, __pyx_v_othershape); + __pyx_r = __pyx_pf_10collisions_4Line_10y(__pyx_self, __pyx_v_self, __pyx_v_value); /* function exit code */ { @@ -33527,47 +33549,153 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "collisions.py":1011 - * return False - * # Calculate the direction of the lines - * def direction(xi, yi, xj, yj, xk, yk): # <<<<<<<<<<<<<< - * return (xk - xi) * (yj - yi) - (yk - yi) * (xj - xi) +static PyObject *__pyx_pf_10collisions_4Line_10y(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value) { + PyObject *__pyx_v_diff = NULL; + 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("y", 1); + + /* "collisions.py":990 + * @y.setter + * def y(self, value): + * diff = value - self.p1[1] # <<<<<<<<<<<<<< + * self.p1 = [self.p1[0], value] + * self.p2 = [self.p2[0], self.p2[1]+diff] + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 990, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 990, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_v_value, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 990, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_diff = __pyx_t_1; + __pyx_t_1 = 0; + + /* "collisions.py":991 + * def y(self, value): + * diff = value - self.p1[1] + * self.p1 = [self.p1[0], value] # <<<<<<<<<<<<<< + * self.p2 = [self.p2[0], self.p2[1]+diff] + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 991, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 991, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 991, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 991, __pyx_L1_error); + __Pyx_INCREF(__pyx_v_value); + __Pyx_GIVEREF(__pyx_v_value); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_v_value)) __PYX_ERR(0, 991, __pyx_L1_error); + __pyx_t_2 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p1, __pyx_t_1) < 0) __PYX_ERR(0, 991, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "collisions.py":992 + * diff = value - self.p1[1] + * self.p1 = [self.p1[0], value] + * self.p2 = [self.p2[0], self.p2[1]+diff] # <<<<<<<<<<<<<< + * + * # Some code yoinked off of https://www.geeksforgeeks.org/check-if-two-given-line-segments-intersect/ modified for this use case and debugged + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 992, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 992, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 992, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 992, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_v_diff); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 992, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 992, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 992, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 992, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p2, __pyx_t_3) < 0) __PYX_ERR(0, 992, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + + /* "collisions.py":988 + * """One of the line's points' y value. Changing this will move the other point by the difference!""" + * return self.p1[1] + * @y.setter # <<<<<<<<<<<<<< + * def y(self, value): + * diff = value - self.p1[1] + */ + + /* 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_3); + __Pyx_AddTraceback("collisions.Line.y", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_diff); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":996 + * # Some code yoinked off of https://www.geeksforgeeks.org/check-if-two-given-line-segments-intersect/ modified for this use case and debugged * + * @staticmethod # <<<<<<<<<<<<<< + * def _onSegment(p, a, b): + * """ */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_9_collides_1direction(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_4Line_13_onSegment(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_4Line_9_collides_1direction = {"direction", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_9_collides_1direction, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_4Line_9_collides_1direction(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_4Line_12_onSegment, "\n Given three collinear points p, a, b, the function checks if point p lies on line segment 'ab'\n "); +static PyMethodDef __pyx_mdef_10collisions_4Line_13_onSegment = {"_onSegment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_13_onSegment, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_12_onSegment}; +static PyObject *__pyx_pw_10collisions_4Line_13_onSegment(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_xi = 0; - PyObject *__pyx_v_yi = 0; - PyObject *__pyx_v_xj = 0; - PyObject *__pyx_v_yj = 0; - PyObject *__pyx_v_xk = 0; - PyObject *__pyx_v_yk = 0; + PyObject *__pyx_v_p = 0; + PyObject *__pyx_v_a = 0; + PyObject *__pyx_v_b = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[6] = {0,0,0,0,0,0}; + PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("direction (wrapper)", 0); + __Pyx_RefNannySetupContext("_onSegment (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -33577,16 +33705,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xi,&__pyx_n_s_yi,&__pyx_n_s_xj,&__pyx_n_s_yj,&__pyx_n_s_xk,&__pyx_n_s_yk,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,&__pyx_n_s_a,&__pyx_n_s_b,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); @@ -33599,87 +33721,51 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xi)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1011, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 996, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_yi)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_a)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1011, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 996, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("direction", 1, 6, 6, 1); __PYX_ERR(0, 1011, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_onSegment", 1, 3, 3, 1); __PYX_ERR(0, 996, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xj)) != 0)) { + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_b)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1011, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("direction", 1, 6, 6, 2); __PYX_ERR(0, 1011, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_yj)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1011, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("direction", 1, 6, 6, 3); __PYX_ERR(0, 1011, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xk)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1011, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("direction", 1, 6, 6, 4); __PYX_ERR(0, 1011, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 5: - if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_yk)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1011, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 996, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("direction", 1, 6, 6, 5); __PYX_ERR(0, 1011, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_onSegment", 1, 3, 3, 2); __PYX_ERR(0, 996, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "direction") < 0)) __PYX_ERR(0, 1011, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_onSegment") < 0)) __PYX_ERR(0, 996, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 6)) { + } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); } - __pyx_v_xi = values[0]; - __pyx_v_yi = values[1]; - __pyx_v_xj = values[2]; - __pyx_v_yj = values[3]; - __pyx_v_xk = values[4]; - __pyx_v_yk = values[5]; + __pyx_v_p = values[0]; + __pyx_v_a = values[1]; + __pyx_v_b = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("direction", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 1011, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_onSegment", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 996, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -33689,11 +33775,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Line._collides.direction", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Line._onSegment", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_9_collides_direction(__pyx_self, __pyx_v_xi, __pyx_v_yi, __pyx_v_xj, __pyx_v_yj, __pyx_v_xk, __pyx_v_yk); + __pyx_r = __pyx_pf_10collisions_4Line_12_onSegment(__pyx_self, __pyx_v_p, __pyx_v_a, __pyx_v_b); /* function exit code */ { @@ -33706,56 +33792,227 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_4Line_9_collides_direction(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_xi, PyObject *__pyx_v_yi, PyObject *__pyx_v_xj, PyObject *__pyx_v_yj, PyObject *__pyx_v_xk, PyObject *__pyx_v_yk) { +static PyObject *__pyx_pf_10collisions_4Line_12_onSegment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_a, PyObject *__pyx_v_b) { + PyObject *__pyx_v_cross_product = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("direction", 1); + __Pyx_RefNannySetupContext("_onSegment", 1); - /* "collisions.py":1012 - * # Calculate the direction of the lines - * def direction(xi, yi, xj, yj, xk, yk): - * return (xk - xi) * (yj - yi) - (yk - yi) * (xj - xi) # <<<<<<<<<<<<<< + /* "collisions.py":1002 + * """ + * # Calculate the cross product + * cross_product = (p[1] - a[1]) * (b[0] - a[0]) - (p[0] - a[0]) * (b[1] - a[1]) # <<<<<<<<<<<<<< * - * d1 = direction(othershape.p1[0], othershape.p1[1], othershape.p2[0], othershape.p2[1], self.p1[0], self.p1[1]) + * # If the cross product is not zero, the point is not on the line */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyNumber_Subtract(__pyx_v_xk, __pyx_v_xi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1012, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Subtract(__pyx_v_yj, __pyx_v_yi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1012, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_a, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1012, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Subtract(__pyx_v_yk, __pyx_v_yi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1012, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_b, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Subtract(__pyx_v_xj, __pyx_v_xi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1012, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_a, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1012, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1012, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1002, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_a, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1002, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Subtract(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_b, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1002, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_a, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1002, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1002, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1002, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1002, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_cross_product = __pyx_t_5; + __pyx_t_5 = 0; + + /* "collisions.py":1005 + * + * # If the cross product is not zero, the point is not on the line + * if abs(cross_product) != 0: # <<<<<<<<<<<<<< + * return False + * + */ + __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_v_cross_product); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1005, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = (__Pyx_PyInt_BoolNeObjC(__pyx_t_5, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1005, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (__pyx_t_6) { + + /* "collisions.py":1006 + * # If the cross product is not zero, the point is not on the line + * if abs(cross_product) != 0: + * return False # <<<<<<<<<<<<<< + * + * # Check if the point is within the bounding box of the line segment + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "collisions.py":1005 + * + * # If the cross product is not zero, the point is not on the line + * if abs(cross_product) != 0: # <<<<<<<<<<<<<< + * return False + * + */ + } + + /* "collisions.py":1009 + * + * # Check if the point is within the bounding box of the line segment + * return min(a[0], b[0]) <= p[0] <= max(a[0], b[0]) and min(a[1], b[1]) <= p[1] <= max(a[1], b[1]) # <<<<<<<<<<<<<< + * + * def rect(self) -> Iterable[Number]: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_b, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_a, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1009, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1009, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2 = __pyx_t_4; + } else { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_t_1; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error) + if (__Pyx_PyObject_IsTrue(__pyx_t_1)) { + __Pyx_DECREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_b, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_a, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = PyObject_RichCompare(__pyx_t_3, __pyx_t_7, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1009, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1009, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_6) { + __Pyx_INCREF(__pyx_t_3); + __pyx_t_8 = __pyx_t_3; + } else { + __Pyx_INCREF(__pyx_t_7); + __pyx_t_8 = __pyx_t_7; + } + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_t_8, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1009, __pyx_L1_error) + if (__pyx_t_6) { + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } else { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_5 = __pyx_t_1; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_b, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_a, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1009, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1009, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_6) { + __Pyx_INCREF(__pyx_t_1); + __pyx_t_2 = __pyx_t_1; + } else { + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2 = __pyx_t_4; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1009, __pyx_L1_error) + if (__Pyx_PyObject_IsTrue(__pyx_t_4)) { + __Pyx_DECREF(__pyx_t_4); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_b, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_a, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1009, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1009, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1009, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (__pyx_t_6) { + __Pyx_INCREF(__pyx_t_8); + __pyx_t_7 = __pyx_t_8; + } else { + __Pyx_INCREF(__pyx_t_3); + __pyx_t_7 = __pyx_t_3; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_7, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1009, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_INCREF(__pyx_t_4); + __pyx_t_5 = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_L4_bool_binop_done:; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; goto __pyx_L0; - /* "collisions.py":1011 - * return False - * # Calculate the direction of the lines - * def direction(xi, yi, xj, yj, xk, yk): # <<<<<<<<<<<<<< - * return (xk - xi) * (yj - yi) - (yk - yi) * (xj - xi) + /* "collisions.py":996 + * # Some code yoinked off of https://www.geeksforgeeks.org/check-if-two-given-line-segments-intersect/ modified for this use case and debugged * + * @staticmethod # <<<<<<<<<<<<<< + * def _onSegment(p, a, b): + * """ */ /* function exit code */ @@ -33764,1062 +34021,452 @@ static PyObject *__pyx_pf_10collisions_4Line_9_collides_direction(CYTHON_UNUSED __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("collisions.Line._collides.direction", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("collisions.Line._onSegment", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_cross_product); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":1004 - * return False +/* "collisions.py":1011 + * return min(a[0], b[0]) <= p[0] <= max(a[0], b[0]) and min(a[1], b[1]) <= p[1] <= max(a[1], b[1]) * - * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * if checkShpType(othershape, ShpTyps.Point): - * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) + * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< + * """ + * Returns the rectangle bounding box surrounding this line. */ -static PyObject *__pyx_pf_10collisions_4Line_22_collides(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { - PyObject *__pyx_v_direction = 0; - PyObject *__pyx_v_d1 = NULL; - PyObject *__pyx_v_d2 = NULL; - PyObject *__pyx_v_d3 = NULL; - PyObject *__pyx_v_d4 = NULL; +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_4Line_15rect(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_10collisions_4Line_14rect, "\n Returns the rectangle bounding box surrounding this line.\n\n Returns:\n Iterable[Number]: (min x, min y, max x, max y)\n "); +static PyMethodDef __pyx_mdef_10collisions_4Line_15rect = {"rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_15rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_14rect}; +static PyObject *__pyx_pw_10collisions_4Line_15rect(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("rect (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1011, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rect") < 0)) __PYX_ERR(0, 1011, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_self = values[0]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1011, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("collisions.Line.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_4Line_14rect(__pyx_self, __pyx_v_self); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10collisions_4Line_14rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - unsigned int __pyx_t_5; - int __pyx_t_6; + int __pyx_t_5; + PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - int __pyx_t_10; - PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_collides", 1); + __Pyx_RefNannySetupContext("rect", 1); - /* "collisions.py":1005 - * - * def _collides(self, othershape: Shape) -> bool: - * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< - * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) - * if checkShpType(othershape, ShpTyps.Line): + /* "collisions.py":1018 + * Iterable[Number]: (min x, min y, max x, max y) + * """ + * return min(self.p1[0], self.p2[0]), min(self.p1[1], self.p2[1]), max(self.p1[0], self.p2[0]), max(self.p1[1], self.p2[1]) # <<<<<<<<<<<<<< + * + * def toLines(self) -> Iterable['Line']: */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1005, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1018, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1018, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_5) { + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + } else { + __Pyx_INCREF(__pyx_t_3); + __pyx_t_1 = __pyx_t_3; + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1005, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1018, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1018, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_5) { + __Pyx_INCREF(__pyx_t_3); + __pyx_t_2 = __pyx_t_3; + } else { + __Pyx_INCREF(__pyx_t_4); + __pyx_t_2 = __pyx_t_4; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1005, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1018, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (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); - __pyx_t_5 = 1; - } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_t_4, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1018, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1018, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_5) { + __Pyx_INCREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + } else { + __Pyx_INCREF(__pyx_t_6); + __pyx_t_3 = __pyx_t_6; } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_othershape, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1005, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = PyObject_RichCompare(__pyx_t_6, __pyx_t_7, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1018, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1018, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_5) { + __Pyx_INCREF(__pyx_t_6); + __pyx_t_4 = __pyx_t_6; + } else { + __Pyx_INCREF(__pyx_t_7); + __pyx_t_4 = __pyx_t_7; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1005, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyTuple_New(4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1018, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error); + __Pyx_INCREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error); + __Pyx_INCREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3)) __PYX_ERR(0, 1018, __pyx_L1_error); + __Pyx_INCREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_4)) __PYX_ERR(0, 1018, __pyx_L1_error); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_6) { + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_6; + __pyx_t_6 = 0; + goto __pyx_L0; - /* "collisions.py":1006 - * def _collides(self, othershape: Shape) -> bool: - * if checkShpType(othershape, ShpTyps.Point): - * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) # <<<<<<<<<<<<<< - * if checkShpType(othershape, ShpTyps.Line): - * if not self.check_rects(othershape): + /* "collisions.py":1011 + * return min(a[0], b[0]) <= p[0] <= max(a[0], b[0]) and min(a[1], b[1]) <= p[1] <= max(a[1], b[1]) + * + * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< + * """ + * Returns the rectangle bounding box surrounding this line. */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_rects); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1006, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_othershape}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1006, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1006, __pyx_L1_error) - if (__pyx_t_6) { - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - __Pyx_INCREF(__pyx_t_2); - __pyx_t_1 = __pyx_t_2; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - goto __pyx_L4_bool_binop_done; - } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_onSegment); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1006, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1006, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1006, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1006, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_3)) __PYX_ERR(0, 1006, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(0, 1006, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1006, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1006, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_t_8, __pyx_t_7, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1006, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __Pyx_INCREF(__pyx_t_2); - __pyx_t_1 = __pyx_t_2; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_L4_bool_binop_done:; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - /* "collisions.py":1005 + /* function exit code */ + __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); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_AddTraceback("collisions.Line.rect", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":1020 + * return min(self.p1[0], self.p2[0]), min(self.p1[1], self.p2[1]), max(self.p1[0], self.p2[0]), max(self.p1[1], self.p2[1]) * - * def _collides(self, othershape: Shape) -> bool: - * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< - * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) - * if checkShpType(othershape, ShpTyps.Line): + * def toLines(self) -> Iterable['Line']: # <<<<<<<<<<<<<< + * """ + * Returns: */ - } - /* "collisions.py":1007 - * if checkShpType(othershape, ShpTyps.Point): - * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) - * if checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< - * if not self.check_rects(othershape): - * return False - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1007, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1007, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1007, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (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; - } - } +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_4Line_17toLines(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_10collisions_4Line_16toLines, "\n Returns:\n Iterable[Line]: Get a list of all the Lines that make up this object; i.e. just this one line.\n "); +static PyMethodDef __pyx_mdef_10collisions_4Line_17toLines = {"toLines", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_17toLines, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_16toLines}; +static PyObject *__pyx_pw_10collisions_4Line_17toLines(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("toLines (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_othershape, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1007, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1007, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_6) { - - /* "collisions.py":1008 - * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) - * if checkShpType(othershape, ShpTyps.Line): - * if not self.check_rects(othershape): # <<<<<<<<<<<<<< - * return False - * # Calculate the direction of the lines - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_rects); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1008, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(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); - __pyx_t_5 = 1; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1020, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toLines") < 0)) __PYX_ERR(0, 1020, __pyx_L3_error) } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_othershape}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1008, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self = values[0]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("toLines", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1020, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1008, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_10 = (!__pyx_t_6); - if (__pyx_t_10) { - - /* "collisions.py":1009 - * if checkShpType(othershape, ShpTyps.Line): - * if not self.check_rects(othershape): - * return False # <<<<<<<<<<<<<< - * # Calculate the direction of the lines - * def direction(xi, yi, xj, yj, xk, yk): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; + } + __Pyx_AddTraceback("collisions.Line.toLines", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_4Line_16toLines(__pyx_self, __pyx_v_self); - /* "collisions.py":1008 - * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) - * if checkShpType(othershape, ShpTyps.Line): - * if not self.check_rects(othershape): # <<<<<<<<<<<<<< - * return False - * # Calculate the direction of the lines - */ + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "collisions.py":1011 - * return False - * # Calculate the direction of the lines - * def direction(xi, yi, xj, yj, xk, yk): # <<<<<<<<<<<<<< - * return (xk - xi) * (yj - yi) - (yk - yi) * (xj - xi) - * - */ - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_9_collides_1direction, 0, __pyx_n_s_Line__collides_locals_direction, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_direction = __pyx_t_1; - __pyx_t_1 = 0; +static PyObject *__pyx_pf_10collisions_4Line_16toLines(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("toLines", 1); - /* "collisions.py":1014 - * return (xk - xi) * (yj - yi) - (yk - yi) * (xj - xi) + /* "collisions.py":1025 + * Iterable[Line]: Get a list of all the Lines that make up this object; i.e. just this one line. + * """ + * return [self] # <<<<<<<<<<<<<< * - * d1 = direction(othershape.p1[0], othershape.p1[1], othershape.p2[0], othershape.p2[1], self.p1[0], self.p1[1]) # <<<<<<<<<<<<<< - * d2 = direction(othershape.p1[0], othershape.p1[1], othershape.p2[0], othershape.p2[1], self.p2[0], self.p2[1]) - * d3 = direction(self.p1[0], self.p1[1], self.p2[0], self.p2[1], othershape.p1[0], othershape.p1[1]) + * def toPoints(self) -> Iterable[pointLike]: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1014, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1014, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1014, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1014, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1014, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1014, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1014, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1014, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1014, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1014, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1014, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1014, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_pf_10collisions_4Line_9_collides_direction(__pyx_v_direction, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_7, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1014, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_v_d1 = __pyx_t_1; - __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1025, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_self)) __PYX_ERR(0, 1025, __pyx_L1_error); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "collisions.py":1015 + /* "collisions.py":1020 + * return min(self.p1[0], self.p2[0]), min(self.p1[1], self.p2[1]), max(self.p1[0], self.p2[0]), max(self.p1[1], self.p2[1]) * - * d1 = direction(othershape.p1[0], othershape.p1[1], othershape.p2[0], othershape.p2[1], self.p1[0], self.p1[1]) - * d2 = direction(othershape.p1[0], othershape.p1[1], othershape.p2[0], othershape.p2[1], self.p2[0], self.p2[1]) # <<<<<<<<<<<<<< - * d3 = direction(self.p1[0], self.p1[1], self.p2[0], self.p2[1], othershape.p1[0], othershape.p1[1]) - * d4 = direction(self.p1[0], self.p1[1], self.p2[0], self.p2[1], othershape.p2[0], othershape.p2[1]) + * def toLines(self) -> Iterable['Line']: # <<<<<<<<<<<<<< + * """ + * Returns: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1015, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1015, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1015, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1015, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1015, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1015, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_pf_10collisions_4Line_9_collides_direction(__pyx_v_direction, __pyx_t_9, __pyx_t_8, __pyx_t_7, __pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_d2 = __pyx_t_1; - __pyx_t_1 = 0; - /* "collisions.py":1016 - * d1 = direction(othershape.p1[0], othershape.p1[1], othershape.p2[0], othershape.p2[1], self.p1[0], self.p1[1]) - * d2 = direction(othershape.p1[0], othershape.p1[1], othershape.p2[0], othershape.p2[1], self.p2[0], self.p2[1]) - * d3 = direction(self.p1[0], self.p1[1], self.p2[0], self.p2[1], othershape.p1[0], othershape.p1[1]) # <<<<<<<<<<<<<< - * d4 = direction(self.p1[0], self.p1[1], self.p2[0], self.p2[1], othershape.p2[0], othershape.p2[1]) + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_AddTraceback("collisions.Line.toLines", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":1027 + * return [self] * - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1016, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1016, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1016, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1016, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1016, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1016, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_pf_10collisions_4Line_9_collides_direction(__pyx_v_direction, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_7, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_v_d3 = __pyx_t_1; - __pyx_t_1 = 0; - - /* "collisions.py":1017 - * d2 = direction(othershape.p1[0], othershape.p1[1], othershape.p2[0], othershape.p2[1], self.p2[0], self.p2[1]) - * d3 = direction(self.p1[0], self.p1[1], self.p2[0], self.p2[1], othershape.p1[0], othershape.p1[1]) - * d4 = direction(self.p1[0], self.p1[1], self.p2[0], self.p2[1], othershape.p2[0], othershape.p2[1]) # <<<<<<<<<<<<<< - * - * # Check if the line segments straddle each other - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_pf_10collisions_4Line_9_collides_direction(__pyx_v_direction, __pyx_t_9, __pyx_t_8, __pyx_t_7, __pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_d4 = __pyx_t_1; - __pyx_t_1 = 0; - - /* "collisions.py":1020 - * - * # Check if the line segments straddle each other - * if d1 * d2 < 0 and d3 * d4 < 0: # <<<<<<<<<<<<<< - * return True - * - */ - __pyx_t_1 = PyNumber_Multiply(__pyx_v_d1, __pyx_v_d2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1020, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1020, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1020, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_6) { - } else { - __pyx_t_10 = __pyx_t_6; - goto __pyx_L9_bool_binop_done; - } - __pyx_t_2 = PyNumber_Multiply(__pyx_v_d3, __pyx_v_d4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1020, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1020, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1020, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_10 = __pyx_t_6; - __pyx_L9_bool_binop_done:; - if (__pyx_t_10) { - - /* "collisions.py":1021 - * # Check if the line segments straddle each other - * if d1 * d2 < 0 and d3 * d4 < 0: - * return True # <<<<<<<<<<<<<< - * - * # Check if the points are collinear and on the segments - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_True); - __pyx_r = Py_True; - goto __pyx_L0; - - /* "collisions.py":1020 - * - * # Check if the line segments straddle each other - * if d1 * d2 < 0 and d3 * d4 < 0: # <<<<<<<<<<<<<< - * return True - * - */ - } - - /* "collisions.py":1024 - * - * # Check if the points are collinear and on the segments - * return (d1 == 0 and self._onSegment((self.p1[0], self.p1[1]), (othershape.p1[0], othershape.p1[1]), (othershape.p2[0], othershape.p2[1]))) or \ # <<<<<<<<<<<<<< - * (d2 == 0 and self._onSegment((self.p2[0], self.p2[1]), (othershape.p1[0], othershape.p1[1]), (othershape.p2[0], othershape.p2[1]))) or \ - * (d3 == 0 and self._onSegment((othershape.p1[0], othershape.p1[1]), (self.p1[0], self.p1[1]), (self.p2[0], self.p2[1]))) or \ - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_d1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1024, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!__pyx_t_10) { - goto __pyx_L12_next_or; - } else { - } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_onSegment); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7)) __PYX_ERR(0, 1024, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8)) __PYX_ERR(0, 1024, __pyx_L1_error); - __pyx_t_7 = 0; - __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7)) __PYX_ERR(0, 1024, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9)) __PYX_ERR(0, 1024, __pyx_L1_error); - __pyx_t_7 = 0; - __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_9, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_9, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7)) __PYX_ERR(0, 1024, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_11)) __PYX_ERR(0, 1024, __pyx_L1_error); - __pyx_t_7 = 0; - __pyx_t_11 = 0; - __pyx_t_11 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[4] = {__pyx_t_11, __pyx_t_4, __pyx_t_8, __pyx_t_9}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1024, __pyx_L1_error) - if (!__pyx_t_10) { - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - __Pyx_INCREF(__pyx_t_2); - __pyx_t_1 = __pyx_t_2; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - goto __pyx_L11_bool_binop_done; - } - __pyx_L12_next_or:; - - /* "collisions.py":1025 - * # Check if the points are collinear and on the segments - * return (d1 == 0 and self._onSegment((self.p1[0], self.p1[1]), (othershape.p1[0], othershape.p1[1]), (othershape.p2[0], othershape.p2[1]))) or \ - * (d2 == 0 and self._onSegment((self.p2[0], self.p2[1]), (othershape.p1[0], othershape.p1[1]), (othershape.p2[0], othershape.p2[1]))) or \ # <<<<<<<<<<<<<< - * (d3 == 0 and self._onSegment((othershape.p1[0], othershape.p1[1]), (self.p1[0], self.p1[1]), (self.p2[0], self.p2[1]))) or \ - * (d4 == 0 and self._onSegment((othershape.p2[0], othershape.p2[1]), (self.p1[0], self.p1[1]), (self.p2[0], self.p2[1]))) - */ - __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_d2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1025, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1025, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!__pyx_t_10) { - goto __pyx_L14_next_or; - } else { - } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_onSegment); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1025, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1025, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_9, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1025, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1025, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_9, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1025, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1025, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8)) __PYX_ERR(0, 1025, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_4)) __PYX_ERR(0, 1025, __pyx_L1_error); - __pyx_t_8 = 0; - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1025, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1025, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1025, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1025, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1025, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8)) __PYX_ERR(0, 1025, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_11)) __PYX_ERR(0, 1025, __pyx_L1_error); - __pyx_t_8 = 0; - __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1025, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_11, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1025, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1025, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_11, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1025, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1025, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8)) __PYX_ERR(0, 1025, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_7)) __PYX_ERR(0, 1025, __pyx_L1_error); - __pyx_t_8 = 0; - __pyx_t_7 = 0; - __pyx_t_7 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_9, __pyx_t_4, __pyx_t_11}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1025, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1025, __pyx_L1_error) - if (!__pyx_t_10) { - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - __Pyx_INCREF(__pyx_t_2); - __pyx_t_1 = __pyx_t_2; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - goto __pyx_L11_bool_binop_done; - } - __pyx_L14_next_or:; - - /* "collisions.py":1026 - * return (d1 == 0 and self._onSegment((self.p1[0], self.p1[1]), (othershape.p1[0], othershape.p1[1]), (othershape.p2[0], othershape.p2[1]))) or \ - * (d2 == 0 and self._onSegment((self.p2[0], self.p2[1]), (othershape.p1[0], othershape.p1[1]), (othershape.p2[0], othershape.p2[1]))) or \ - * (d3 == 0 and self._onSegment((othershape.p1[0], othershape.p1[1]), (self.p1[0], self.p1[1]), (self.p2[0], self.p2[1]))) or \ # <<<<<<<<<<<<<< - * (d4 == 0 and self._onSegment((othershape.p2[0], othershape.p2[1]), (self.p1[0], self.p1[1]), (self.p2[0], self.p2[1]))) - * - */ - __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_d3, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1026, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (!__pyx_t_10) { - goto __pyx_L16_next_or; - } else { - } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_onSegment); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_11, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_11, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4)) __PYX_ERR(0, 1026, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_9)) __PYX_ERR(0, 1026, __pyx_L1_error); - __pyx_t_4 = 0; - __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_9, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_9, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4)) __PYX_ERR(0, 1026, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7)) __PYX_ERR(0, 1026, __pyx_L1_error); - __pyx_t_4 = 0; - __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4)) __PYX_ERR(0, 1026, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8)) __PYX_ERR(0, 1026, __pyx_L1_error); - __pyx_t_4 = 0; - __pyx_t_8 = 0; - __pyx_t_8 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[4] = {__pyx_t_8, __pyx_t_11, __pyx_t_9, __pyx_t_7}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1026, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1026, __pyx_L1_error) - if (!__pyx_t_10) { - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - __Pyx_INCREF(__pyx_t_2); - __pyx_t_1 = __pyx_t_2; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - goto __pyx_L11_bool_binop_done; - } - __pyx_L16_next_or:; - - /* "collisions.py":1027 - * (d2 == 0 and self._onSegment((self.p2[0], self.p2[1]), (othershape.p1[0], othershape.p1[1]), (othershape.p2[0], othershape.p2[1]))) or \ - * (d3 == 0 and self._onSegment((othershape.p1[0], othershape.p1[1]), (self.p1[0], self.p1[1]), (self.p2[0], self.p2[1]))) or \ - * (d4 == 0 and self._onSegment((othershape.p2[0], othershape.p2[1]), (self.p1[0], self.p1[1]), (self.p2[0], self.p2[1]))) # <<<<<<<<<<<<<< - * - * return othershape._collides(self) - */ - __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_d4, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1027, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1027, __pyx_L1_error) - if (__pyx_t_10) { - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } else { - __Pyx_INCREF(__pyx_t_2); - __pyx_t_1 = __pyx_t_2; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - goto __pyx_L11_bool_binop_done; - } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_onSegment); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1027, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1027, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1027, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1027, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1027, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1027, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9)) __PYX_ERR(0, 1027, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_11)) __PYX_ERR(0, 1027, __pyx_L1_error); - __pyx_t_9 = 0; - __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1027, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_11, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1027, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1027, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_11, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1027, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1027, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9)) __PYX_ERR(0, 1027, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_8)) __PYX_ERR(0, 1027, __pyx_L1_error); - __pyx_t_9 = 0; - __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1027, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1027, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1027, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1027, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1027, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9)) __PYX_ERR(0, 1027, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4)) __PYX_ERR(0, 1027, __pyx_L1_error); - __pyx_t_9 = 0; - __pyx_t_4 = 0; - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_t_7, __pyx_t_11, __pyx_t_8}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1027, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_INCREF(__pyx_t_2); - __pyx_t_1 = __pyx_t_2; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_L11_bool_binop_done:; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "collisions.py":1007 - * if checkShpType(othershape, ShpTyps.Point): - * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) - * if checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< - * if not self.check_rects(othershape): - * return False - */ - } - - /* "collisions.py":1029 - * (d4 == 0 and self._onSegment((othershape.p2[0], othershape.p2[1]), (self.p1[0], self.p1[1]), (self.p2[0], self.p2[1]))) - * - * return othershape._collides(self) # <<<<<<<<<<<<<< - * - * def _where(self, othershape: Shape) -> Iterable[pointLike]: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1029, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(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); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1029, __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; - - /* "collisions.py":1004 - * return False - * - * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * if checkShpType(othershape, ShpTyps.Point): - * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) - */ - - /* function exit code */ - __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_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_11); - __Pyx_AddTraceback("collisions.Line._collides", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_direction); - __Pyx_XDECREF(__pyx_v_d1); - __Pyx_XDECREF(__pyx_v_d2); - __Pyx_XDECREF(__pyx_v_d3); - __Pyx_XDECREF(__pyx_v_d4); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "collisions.py":1031 - * return othershape._collides(self) - * - * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * if checkShpType(othershape, ShpTyps.Point): - * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] + * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< + * """ + * Returns: */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_25_where(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_4Line_19toPoints(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_4Line_25_where = {"_where", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_25_where, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_4Line_25_where(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_4Line_18toPoints, "\n Returns:\n Iterable[pointLike]: Get a list of all the Points that make up this object.\n "); +static PyMethodDef __pyx_mdef_10collisions_4Line_19toPoints = {"toPoints", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_19toPoints, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_18toPoints}; +static PyObject *__pyx_pw_10collisions_4Line_19toPoints(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -34827,18 +34474,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_othershape = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[2] = {0,0}; + PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_where (wrapper)", 0); + __Pyx_RefNannySetupContext("toPoints (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -34848,12 +34494,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_othershape,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; @@ -34866,35 +34510,23 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1031, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1027, __pyx_L3_error) else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_othershape)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1031, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, 1); __PYX_ERR(0, 1031, __pyx_L3_error) - } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_where") < 0)) __PYX_ERR(0, 1031, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toPoints") < 0)) __PYX_ERR(0, 1027, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 2)) { + } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; - __pyx_v_othershape = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1031, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("toPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1027, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -34904,11 +34536,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Line._where", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Line.toPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_24_where(__pyx_self, __pyx_v_self, __pyx_v_othershape); + __pyx_r = __pyx_pf_10collisions_4Line_18toPoints(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -34921,32 +34553,88 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "collisions.py":1038 - * return [] - * # This finds where the lines are colliding if they are infinite, which is why we check if they collide first - * def line(p1, p2): # <<<<<<<<<<<<<< - * A = (p1[1] - p2[1]) - * B = (p2[0] - p1[0]) +static PyObject *__pyx_pf_10collisions_4Line_18toPoints(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__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("toPoints", 1); + + /* "collisions.py":1032 + * Iterable[pointLike]: Get a list of all the Points that make up this object. + * """ + * return [self.p1, self.p2] # <<<<<<<<<<<<<< + * + * def _contains(self, othershape: Shape) -> bool: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1032, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1032, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1032, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 1032, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 1032, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "collisions.py":1027 + * return [self] + * + * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< + * """ + * Returns: + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("collisions.Line.toPoints", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":1034 + * return [self.p1, self.p2] + * + * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< + * return False + * */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_6_where_1line(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_4Line_21_contains(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_4Line_6_where_1line = {"line", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_6_where_1line, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_4Line_6_where_1line(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_4Line_21_contains = {"_contains", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_21_contains, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_4Line_21_contains(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_p1 = 0; - PyObject *__pyx_v_p2 = 0; + CYTHON_UNUSED PyObject *__pyx_v_self = 0; + CYTHON_UNUSED PyObject *__pyx_v_othershape = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -34957,7 +34645,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("line (wrapper)", 0); + __Pyx_RefNannySetupContext("_contains (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -34967,7 +34655,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p1,&__pyx_n_s_p2,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_othershape,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -34981,26 +34669,26 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p1)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1038, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1034, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p2)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_othershape)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1038, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1034, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("line", 1, 2, 2, 1); __PYX_ERR(0, 1038, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, 1); __PYX_ERR(0, 1034, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "line") < 0)) __PYX_ERR(0, 1038, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_contains") < 0)) __PYX_ERR(0, 1034, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -35008,12 +34696,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } - __pyx_v_p1 = values[0]; - __pyx_v_p2 = values[1]; + __pyx_v_self = values[0]; + __pyx_v_othershape = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("line", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1038, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1034, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -35023,11 +34711,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Line._where.line", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Line._contains", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_6_where_line(__pyx_self, __pyx_v_p1, __pyx_v_p2); + __pyx_r = __pyx_pf_10collisions_4Line_20_contains(__pyx_self, __pyx_v_self, __pyx_v_othershape); /* function exit code */ { @@ -35040,10 +34728,337 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_4Line_6_where_line(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2) { - PyObject *__pyx_v_A = NULL; - PyObject *__pyx_v_B = NULL; - PyObject *__pyx_v_C = NULL; +static PyObject *__pyx_pf_10collisions_4Line_20_contains(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_othershape) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_contains", 1); + + /* "collisions.py":1035 + * + * def _contains(self, othershape: Shape) -> bool: + * return False # <<<<<<<<<<<<<< + * + * def _collides(self, othershape: Shape) -> bool: + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; + goto __pyx_L0; + + /* "collisions.py":1034 + * return [self.p1, self.p2] + * + * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< + * return False + * + */ + + /* function exit code */ + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":1037 + * return False + * + * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Point): + * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_4Line_23_collides(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_10collisions_4Line_23_collides = {"_collides", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_23_collides, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_4Line_23_collides(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_othershape = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_collides (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_othershape,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1037, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_othershape)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1037, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 1037, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_collides") < 0)) __PYX_ERR(0, 1037, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_othershape = values[1]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1037, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("collisions.Line._collides", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_4Line_22_collides(__pyx_self, __pyx_v_self, __pyx_v_othershape); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":1044 + * return False + * # Calculate the direction of the lines + * def direction(xi, yi, xj, yj, xk, yk): # <<<<<<<<<<<<<< + * return (xk - xi) * (yj - yi) - (yk - yi) * (xj - xi) + * + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_4Line_9_collides_1direction(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_10collisions_4Line_9_collides_1direction = {"direction", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_9_collides_1direction, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_4Line_9_collides_1direction(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_xi = 0; + PyObject *__pyx_v_yi = 0; + PyObject *__pyx_v_xj = 0; + PyObject *__pyx_v_yj = 0; + PyObject *__pyx_v_xk = 0; + PyObject *__pyx_v_yk = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[6] = {0,0,0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("direction (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_xi,&__pyx_n_s_yi,&__pyx_n_s_xj,&__pyx_n_s_yj,&__pyx_n_s_xk,&__pyx_n_s_yk,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xi)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1044, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_yi)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1044, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("direction", 1, 6, 6, 1); __PYX_ERR(0, 1044, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xj)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1044, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("direction", 1, 6, 6, 2); __PYX_ERR(0, 1044, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_yj)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1044, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("direction", 1, 6, 6, 3); __PYX_ERR(0, 1044, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_xk)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1044, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("direction", 1, 6, 6, 4); __PYX_ERR(0, 1044, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_yk)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1044, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("direction", 1, 6, 6, 5); __PYX_ERR(0, 1044, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "direction") < 0)) __PYX_ERR(0, 1044, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 6)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + } + __pyx_v_xi = values[0]; + __pyx_v_yi = values[1]; + __pyx_v_xj = values[2]; + __pyx_v_yj = values[3]; + __pyx_v_xk = values[4]; + __pyx_v_yk = values[5]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("direction", 1, 6, 6, __pyx_nargs); __PYX_ERR(0, 1044, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("collisions.Line._collides.direction", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_4Line_9_collides_direction(__pyx_self, __pyx_v_xi, __pyx_v_yi, __pyx_v_xj, __pyx_v_yj, __pyx_v_xk, __pyx_v_yk); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10collisions_4Line_9_collides_direction(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_xi, PyObject *__pyx_v_yi, PyObject *__pyx_v_xj, PyObject *__pyx_v_yj, PyObject *__pyx_v_xk, PyObject *__pyx_v_yk) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -35053,105 +35068,46 @@ static PyObject *__pyx_pf_10collisions_4Line_6_where_line(CYTHON_UNUSED PyObject int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("line", 1); - - /* "collisions.py":1039 - * # This finds where the lines are colliding if they are infinite, which is why we check if they collide first - * def line(p1, p2): - * A = (p1[1] - p2[1]) # <<<<<<<<<<<<<< - * B = (p2[0] - p1[0]) - * C = (p1[0]*p2[1] - p2[0]*p1[1]) - */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_p2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1039, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1039, __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_v_A = __pyx_t_3; - __pyx_t_3 = 0; - - /* "collisions.py":1040 - * def line(p1, p2): - * A = (p1[1] - p2[1]) - * B = (p2[0] - p1[0]) # <<<<<<<<<<<<<< - * C = (p1[0]*p2[1] - p2[0]*p1[1]) - * return A, B, -C - */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_p2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1040, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_p1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1040, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1040, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_B = __pyx_t_1; - __pyx_t_1 = 0; + __Pyx_RefNannySetupContext("direction", 1); - /* "collisions.py":1041 - * A = (p1[1] - p2[1]) - * B = (p2[0] - p1[0]) - * C = (p1[0]*p2[1] - p2[0]*p1[1]) # <<<<<<<<<<<<<< - * return A, B, -C - * L1, L2 = line(self.p1, self.p2), line(othershape.p1, othershape.p2) + /* "collisions.py":1045 + * # Calculate the direction of the lines + * def direction(xi, yi, xj, yj, xk, yk): + * return (xk - xi) * (yj - yi) - (yk - yi) * (xj - xi) # <<<<<<<<<<<<<< + * + * d1 = direction(othershape.p1[0], othershape.p1[1], othershape.p2[0], othershape.p2[1], self.p1[0], self.p1[1]) */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1041, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyNumber_Subtract(__pyx_v_xk, __pyx_v_xi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_p2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1041, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_v_yj, __pyx_v_yi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1041, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_p2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1041, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_v_yk, __pyx_v_yi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1041, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_v_xj, __pyx_v_xi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1041, __pyx_L1_error) + __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1041, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1045, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_C = __pyx_t_1; - __pyx_t_1 = 0; - - /* "collisions.py":1042 - * B = (p2[0] - p1[0]) - * C = (p1[0]*p2[1] - p2[0]*p1[1]) - * return A, B, -C # <<<<<<<<<<<<<< - * L1, L2 = line(self.p1, self.p2), line(othershape.p1, othershape.p2) - * D = L1[0] * L2[1] - L1[1] * L2[0] - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyNumber_Negative(__pyx_v_C); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1042, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1042, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_v_A); - __Pyx_GIVEREF(__pyx_v_A); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_A)) __PYX_ERR(0, 1042, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_B); - __Pyx_GIVEREF(__pyx_v_B); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_B)) __PYX_ERR(0, 1042, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1)) __PYX_ERR(0, 1042, __pyx_L1_error); + __pyx_r = __pyx_t_1; __pyx_t_1 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":1038 - * return [] - * # This finds where the lines are colliding if they are infinite, which is why we check if they collide first - * def line(p1, p2): # <<<<<<<<<<<<<< - * A = (p1[1] - p2[1]) - * B = (p2[0] - p1[0]) + /* "collisions.py":1044 + * return False + * # Calculate the direction of the lines + * def direction(xi, yi, xj, yj, xk, yk): # <<<<<<<<<<<<<< + * return (xk - xi) * (yj - yi) - (yk - yi) * (xj - xi) + * */ /* function exit code */ @@ -35160,34 +35116,28 @@ static PyObject *__pyx_pf_10collisions_4Line_6_where_line(CYTHON_UNUSED PyObject __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("collisions.Line._where.line", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Line._collides.direction", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_A); - __Pyx_XDECREF(__pyx_v_B); - __Pyx_XDECREF(__pyx_v_C); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":1031 - * return othershape._collides(self) +/* "collisions.py":1037 + * return False * - * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< + * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * if checkShpType(othershape, ShpTyps.Point): - * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] + * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) */ -static PyObject *__pyx_pf_10collisions_4Line_24_where(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { - PyObject *__pyx_v_line = 0; - PyObject *__pyx_v_L1 = NULL; - PyObject *__pyx_v_L2 = NULL; - PyObject *__pyx_v_D = NULL; - PyObject *__pyx_v_Dx = NULL; - PyObject *__pyx_v_Dy = NULL; - PyObject *__pyx_v_x = NULL; - PyObject *__pyx_v_y = NULL; +static PyObject *__pyx_pf_10collisions_4Line_22_collides(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { + PyObject *__pyx_v_direction = 0; + PyObject *__pyx_v_d1 = NULL; + PyObject *__pyx_v_d2 = NULL; + PyObject *__pyx_v_d3 = NULL; + PyObject *__pyx_v_d4 = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -35196,24 +35146,28 @@ static PyObject *__pyx_pf_10collisions_4Line_24_where(CYTHON_UNUSED PyObject *__ PyObject *__pyx_t_4 = NULL; unsigned int __pyx_t_5; int __pyx_t_6; - int __pyx_t_7; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_where", 1); + __Pyx_RefNannySetupContext("_collides", 1); - /* "collisions.py":1032 + /* "collisions.py":1038 * - * def _where(self, othershape: Shape) -> Iterable[pointLike]: + * def _collides(self, othershape: Shape) -> bool: * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< - * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] + * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) * if checkShpType(othershape, ShpTyps.Line): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1032, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1032, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1032, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -35235,23 +35189,23 @@ static PyObject *__pyx_pf_10collisions_4Line_24_where(CYTHON_UNUSED PyObject *__ __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1032, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1032, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1038, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":1033 - * def _where(self, othershape: Shape) -> Iterable[pointLike]: + /* "collisions.py":1039 + * def _collides(self, othershape: Shape) -> bool: * if checkShpType(othershape, ShpTyps.Point): - * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] # <<<<<<<<<<<<<< + * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) # <<<<<<<<<<<<<< * if checkShpType(othershape, ShpTyps.Line): - * if not self.collides(othershape): + * if not self.check_rects(othershape): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1033, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_rects); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; @@ -35271,463 +35225,953 @@ static PyObject *__pyx_pf_10collisions_4Line_24_where(CYTHON_UNUSED PyObject *__ PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_othershape}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1033, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1033, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1039, __pyx_L1_error) if (__pyx_t_6) { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1033, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1033, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1033, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 1033, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_4)) __PYX_ERR(0, 1033, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_t_4 = 0; - __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1033, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 1033, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_1 = __pyx_t_4; - __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1033, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __pyx_t_4; - __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L4_bool_binop_done; + } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_onSegment); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1039, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1039, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1039, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1039, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_3)) __PYX_ERR(0, 1039, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_7)) __PYX_ERR(0, 1039, __pyx_L1_error); + __pyx_t_3 = 0; + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1039, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1039, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_t_8, __pyx_t_7, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1039, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_L4_bool_binop_done:; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1032 + /* "collisions.py":1038 * - * def _where(self, othershape: Shape) -> Iterable[pointLike]: + * def _collides(self, othershape: Shape) -> bool: * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< - * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] + * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) * if checkShpType(othershape, ShpTyps.Line): */ } - /* "collisions.py":1034 + /* "collisions.py":1040 * if checkShpType(othershape, ShpTyps.Point): - * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] + * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) * if checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< - * if not self.collides(othershape): - * return [] + * if not self.check_rects(othershape): + * return False */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1034, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1040, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1040, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1034, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1040, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1034, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); + if (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_4, function); + __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_othershape, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1034, __pyx_L1_error) + PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_othershape, __pyx_t_3}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1040, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1034, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1040, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":1035 - * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] + /* "collisions.py":1041 + * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) * if checkShpType(othershape, ShpTyps.Line): - * if not self.collides(othershape): # <<<<<<<<<<<<<< - * return [] - * # This finds where the lines are colliding if they are infinite, which is why we check if they collide first + * if not self.check_rects(othershape): # <<<<<<<<<<<<<< + * return False + * # Calculate the direction of the lines */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1035, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = NULL; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_rects); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1041, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_2); + if (likely(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_4, function); + __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_othershape}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1035, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_othershape}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1035, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1041, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_7 = (!__pyx_t_6); - if (__pyx_t_7) { + __pyx_t_10 = (!__pyx_t_6); + if (__pyx_t_10) { - /* "collisions.py":1036 + /* "collisions.py":1042 * if checkShpType(othershape, ShpTyps.Line): - * if not self.collides(othershape): - * return [] # <<<<<<<<<<<<<< - * # This finds where the lines are colliding if they are infinite, which is why we check if they collide first - * def line(p1, p2): + * if not self.check_rects(othershape): + * return False # <<<<<<<<<<<<<< + * # Calculate the direction of the lines + * def direction(xi, yi, xj, yj, xk, yk): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1036, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __Pyx_INCREF(Py_False); + __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":1035 - * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] + /* "collisions.py":1041 + * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) * if checkShpType(othershape, ShpTyps.Line): - * if not self.collides(othershape): # <<<<<<<<<<<<<< - * return [] - * # This finds where the lines are colliding if they are infinite, which is why we check if they collide first + * if not self.check_rects(othershape): # <<<<<<<<<<<<<< + * return False + * # Calculate the direction of the lines */ } - /* "collisions.py":1038 - * return [] - * # This finds where the lines are colliding if they are infinite, which is why we check if they collide first - * def line(p1, p2): # <<<<<<<<<<<<<< - * A = (p1[1] - p2[1]) - * B = (p2[0] - p1[0]) + /* "collisions.py":1044 + * return False + * # Calculate the direction of the lines + * def direction(xi, yi, xj, yj, xk, yk): # <<<<<<<<<<<<<< + * return (xk - xi) * (yj - yi) - (yk - yi) * (xj - xi) + * */ - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_6_where_1line, 0, __pyx_n_s_Line__where_locals_line, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1038, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_9_collides_1direction, 0, __pyx_n_s_Line__collides_locals_direction, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_v_line = __pyx_t_1; + __pyx_v_direction = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":1043 - * C = (p1[0]*p2[1] - p2[0]*p1[1]) - * return A, B, -C - * L1, L2 = line(self.p1, self.p2), line(othershape.p1, othershape.p2) # <<<<<<<<<<<<<< - * D = L1[0] * L2[1] - L1[1] * L2[0] - * Dx = L1[2] * L2[1] - L1[1] * L2[2] + /* "collisions.py":1047 + * return (xk - xi) * (yj - yi) - (yk - yi) * (xj - xi) + * + * d1 = direction(othershape.p1[0], othershape.p1[1], othershape.p2[0], othershape.p2[1], self.p1[0], self.p1[1]) # <<<<<<<<<<<<<< + * d2 = direction(othershape.p1[0], othershape.p1[1], othershape.p2[0], othershape.p2[1], self.p2[0], self.p2[1]) + * d3 = direction(self.p1[0], self.p1[1], self.p2[0], self.p2[1], othershape.p1[0], othershape.p1[1]) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1043, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1043, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __pyx_pf_10collisions_4Line_6_where_line(__pyx_v_line, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1043, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1047, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1043, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1043, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __pyx_pf_10collisions_4Line_6_where_line(__pyx_v_line, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1043, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1047, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_L1 = __pyx_t_2; - __pyx_t_2 = 0; - __pyx_v_L2 = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1047, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1047, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1047, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1047, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_pf_10collisions_4Line_9_collides_direction(__pyx_v_direction, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_7, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_d1 = __pyx_t_1; + __pyx_t_1 = 0; - /* "collisions.py":1044 - * return A, B, -C - * L1, L2 = line(self.p1, self.p2), line(othershape.p1, othershape.p2) - * D = L1[0] * L2[1] - L1[1] * L2[0] # <<<<<<<<<<<<<< - * Dx = L1[2] * L2[1] - L1[1] * L2[2] - * Dy = L1[0] * L2[2] - L1[2] * L2[0] + /* "collisions.py":1048 + * + * d1 = direction(othershape.p1[0], othershape.p1[1], othershape.p2[0], othershape.p2[1], self.p1[0], self.p1[1]) + * d2 = direction(othershape.p1[0], othershape.p1[1], othershape.p2[0], othershape.p2[1], self.p2[0], self.p2[1]) # <<<<<<<<<<<<<< + * d3 = direction(self.p1[0], self.p1[1], self.p2[0], self.p2[1], othershape.p1[0], othershape.p1[1]) + * d4 = direction(self.p1[0], self.p1[1], self.p2[0], self.p2[1], othershape.p2[0], othershape.p2[1]) */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_L1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1044, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1048, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1048, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1048, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1048, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_L2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1044, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1044, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_pf_10collisions_4Line_9_collides_direction(__pyx_v_direction, __pyx_t_9, __pyx_t_8, __pyx_t_7, __pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_L1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1044, __pyx_L1_error) + __pyx_v_d2 = __pyx_t_1; + __pyx_t_1 = 0; + + /* "collisions.py":1049 + * d1 = direction(othershape.p1[0], othershape.p1[1], othershape.p2[0], othershape.p2[1], self.p1[0], self.p1[1]) + * d2 = direction(othershape.p1[0], othershape.p1[1], othershape.p2[0], othershape.p2[1], self.p2[0], self.p2[1]) + * d3 = direction(self.p1[0], self.p1[1], self.p2[0], self.p2[1], othershape.p1[0], othershape.p1[1]) # <<<<<<<<<<<<<< + * d4 = direction(self.p1[0], self.p1[1], self.p2[0], self.p2[1], othershape.p2[0], othershape.p2[1]) + * + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_L2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1044, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1044, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1049, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1049, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1049, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_pf_10collisions_4Line_9_collides_direction(__pyx_v_direction, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_7, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1044, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_D = __pyx_t_3; - __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_d3 = __pyx_t_1; + __pyx_t_1 = 0; - /* "collisions.py":1045 - * L1, L2 = line(self.p1, self.p2), line(othershape.p1, othershape.p2) - * D = L1[0] * L2[1] - L1[1] * L2[0] - * Dx = L1[2] * L2[1] - L1[1] * L2[2] # <<<<<<<<<<<<<< - * Dy = L1[0] * L2[2] - L1[2] * L2[0] - * if D != 0: + /* "collisions.py":1050 + * d2 = direction(othershape.p1[0], othershape.p1[1], othershape.p2[0], othershape.p2[1], self.p2[0], self.p2[1]) + * d3 = direction(self.p1[0], self.p1[1], self.p2[0], self.p2[1], othershape.p1[0], othershape.p1[1]) + * d4 = direction(self.p1[0], self.p1[1], self.p2[0], self.p2[1], othershape.p2[0], othershape.p2[1]) # <<<<<<<<<<<<<< + * + * # Check if the line segments straddle each other */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_L1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1045, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_L2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1045, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_L1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1045, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1050, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1050, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1050, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1050, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_L2, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1045, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1050, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1045, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1050, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_pf_10collisions_4Line_9_collides_direction(__pyx_v_direction, __pyx_t_9, __pyx_t_8, __pyx_t_7, __pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1045, __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_v_Dx = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_v_d4 = __pyx_t_1; + __pyx_t_1 = 0; - /* "collisions.py":1046 - * D = L1[0] * L2[1] - L1[1] * L2[0] - * Dx = L1[2] * L2[1] - L1[1] * L2[2] - * Dy = L1[0] * L2[2] - L1[2] * L2[0] # <<<<<<<<<<<<<< - * if D != 0: - * x = Dx / D + /* "collisions.py":1053 + * + * # Check if the line segments straddle each other + * if d1 * d2 < 0 and d3 * d4 < 0: # <<<<<<<<<<<<<< + * return True + * */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_L1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1046, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_L2, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1046, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1046, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_v_d1, __pyx_v_d2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1053, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1053, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_L1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1046, __pyx_L1_error) + if (__pyx_t_6) { + } else { + __pyx_t_10 = __pyx_t_6; + goto __pyx_L9_bool_binop_done; + } + __pyx_t_2 = PyNumber_Multiply(__pyx_v_d3, __pyx_v_d4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_L2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1046, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1046, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1053, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1046, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1053, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_Dy = __pyx_t_3; - __pyx_t_3 = 0; - - /* "collisions.py":1047 - * Dx = L1[2] * L2[1] - L1[1] * L2[2] - * Dy = L1[0] * L2[2] - L1[2] * L2[0] - * if D != 0: # <<<<<<<<<<<<<< - * x = Dx / D - * y = Dy / D - */ - __pyx_t_7 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_D, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1047, __pyx_L1_error) - if (__pyx_t_7) { - - /* "collisions.py":1048 - * Dy = L1[0] * L2[2] - L1[2] * L2[0] - * if D != 0: - * x = Dx / D # <<<<<<<<<<<<<< - * y = Dy / D - * return [[float(x),float(y)]] - */ - __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_Dx, __pyx_v_D); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1048, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_v_x = __pyx_t_3; - __pyx_t_3 = 0; - - /* "collisions.py":1049 - * if D != 0: - * x = Dx / D - * y = Dy / D # <<<<<<<<<<<<<< - * return [[float(x),float(y)]] - * else: - */ - __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_Dy, __pyx_v_D); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1049, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_v_y = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_10 = __pyx_t_6; + __pyx_L9_bool_binop_done:; + if (__pyx_t_10) { - /* "collisions.py":1050 - * x = Dx / D - * y = Dy / D - * return [[float(x),float(y)]] # <<<<<<<<<<<<<< - * else: - * return [] + /* "collisions.py":1054 + * # Check if the line segments straddle each other + * if d1 * d2 < 0 and d3 * d4 < 0: + * return True # <<<<<<<<<<<<<< + * + * # Check if the points are collinear and on the segments */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyNumber_Float(__pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1050, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyNumber_Float(__pyx_v_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1050, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 1050, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_4)) __PYX_ERR(0, 1050, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_4 = 0; - __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1050, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __Pyx_INCREF(Py_True); + __pyx_r = Py_True; goto __pyx_L0; - /* "collisions.py":1047 - * Dx = L1[2] * L2[1] - L1[1] * L2[2] - * Dy = L1[0] * L2[2] - L1[2] * L2[0] - * if D != 0: # <<<<<<<<<<<<<< - * x = Dx / D - * y = Dy / D - */ - } - - /* "collisions.py":1052 - * return [[float(x),float(y)]] - * else: - * return [] # <<<<<<<<<<<<<< - * return othershape._where(self) + /* "collisions.py":1053 + * + * # Check if the line segments straddle each other + * if d1 * d2 < 0 and d3 * d4 < 0: # <<<<<<<<<<<<<< + * return True * */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1052, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; } - /* "collisions.py":1034 - * if checkShpType(othershape, ShpTyps.Point): - * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] - * if checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< - * if not self.collides(othershape): - * return [] - */ - } - - /* "collisions.py":1053 - * else: - * return [] - * return othershape._where(self) # <<<<<<<<<<<<<< + /* "collisions.py":1057 * - * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLike|Iterable[pointLike]: + * # Check if the points are collinear and on the segments + * return (d1 == 0 and self._onSegment((self.p1[0], self.p1[1]), (othershape.p1[0], othershape.p1[1]), (othershape.p2[0], othershape.p2[1]))) or \ # <<<<<<<<<<<<<< + * (d2 == 0 and self._onSegment((self.p2[0], self.p2[1]), (othershape.p1[0], othershape.p1[1]), (othershape.p2[0], othershape.p2[1]))) or \ + * (d3 == 0 and self._onSegment((othershape.p1[0], othershape.p1[1]), (self.p1[0], self.p1[1]), (self.p2[0], self.p2[1]))) or \ */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_where); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1053, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_5 = 1; + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_d1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!__pyx_t_10) { + goto __pyx_L12_next_or; + } else { } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1053, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_onSegment); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1057, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "collisions.py":1031 - * return othershape._collides(self) - * - * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * if checkShpType(othershape, ShpTyps.Point): - * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("collisions.Line._where", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_line); - __Pyx_XDECREF(__pyx_v_L1); - __Pyx_XDECREF(__pyx_v_L2); - __Pyx_XDECREF(__pyx_v_D); - __Pyx_XDECREF(__pyx_v_Dx); - __Pyx_XDECREF(__pyx_v_Dy); - __Pyx_XDECREF(__pyx_v_x); - __Pyx_XDECREF(__pyx_v_y); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "collisions.py":1055 - * return othershape._where(self) - * - * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLike|Iterable[pointLike]: # <<<<<<<<<<<<<< - * """ - * Find the closest point ON this object TO another object. - */ - -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_27closestPointTo(PyObject *__pyx_self, + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7)) __PYX_ERR(0, 1057, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_8)) __PYX_ERR(0, 1057, __pyx_L1_error); + __pyx_t_7 = 0; + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7)) __PYX_ERR(0, 1057, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_9); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9)) __PYX_ERR(0, 1057, __pyx_L1_error); + __pyx_t_7 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_9, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_9, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7)) __PYX_ERR(0, 1057, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_11); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_11)) __PYX_ERR(0, 1057, __pyx_L1_error); + __pyx_t_7 = 0; + __pyx_t_11 = 0; + __pyx_t_11 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[4] = {__pyx_t_11, __pyx_t_4, __pyx_t_8, __pyx_t_9}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1057, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1057, __pyx_L1_error) + if (!__pyx_t_10) { + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L11_bool_binop_done; + } + __pyx_L12_next_or:; + + /* "collisions.py":1058 + * # Check if the points are collinear and on the segments + * return (d1 == 0 and self._onSegment((self.p1[0], self.p1[1]), (othershape.p1[0], othershape.p1[1]), (othershape.p2[0], othershape.p2[1]))) or \ + * (d2 == 0 and self._onSegment((self.p2[0], self.p2[1]), (othershape.p1[0], othershape.p1[1]), (othershape.p2[0], othershape.p2[1]))) or \ # <<<<<<<<<<<<<< + * (d3 == 0 and self._onSegment((othershape.p1[0], othershape.p1[1]), (self.p1[0], self.p1[1]), (self.p2[0], self.p2[1]))) or \ + * (d4 == 0 and self._onSegment((othershape.p2[0], othershape.p2[1]), (self.p1[0], self.p1[1]), (self.p2[0], self.p2[1]))) + */ + __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_d2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1058, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1058, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!__pyx_t_10) { + goto __pyx_L14_next_or; + } else { + } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_onSegment); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1058, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1058, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_9, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1058, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1058, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_9, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1058, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1058, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8)) __PYX_ERR(0, 1058, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_4)) __PYX_ERR(0, 1058, __pyx_L1_error); + __pyx_t_8 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1058, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1058, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1058, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1058, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1058, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8)) __PYX_ERR(0, 1058, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_11); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_11)) __PYX_ERR(0, 1058, __pyx_L1_error); + __pyx_t_8 = 0; + __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1058, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_11, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1058, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1058, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_11, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1058, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1058, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8)) __PYX_ERR(0, 1058, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_7)) __PYX_ERR(0, 1058, __pyx_L1_error); + __pyx_t_8 = 0; + __pyx_t_7 = 0; + __pyx_t_7 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[4] = {__pyx_t_7, __pyx_t_9, __pyx_t_4, __pyx_t_11}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1058, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1058, __pyx_L1_error) + if (!__pyx_t_10) { + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L11_bool_binop_done; + } + __pyx_L14_next_or:; + + /* "collisions.py":1059 + * return (d1 == 0 and self._onSegment((self.p1[0], self.p1[1]), (othershape.p1[0], othershape.p1[1]), (othershape.p2[0], othershape.p2[1]))) or \ + * (d2 == 0 and self._onSegment((self.p2[0], self.p2[1]), (othershape.p1[0], othershape.p1[1]), (othershape.p2[0], othershape.p2[1]))) or \ + * (d3 == 0 and self._onSegment((othershape.p1[0], othershape.p1[1]), (self.p1[0], self.p1[1]), (self.p2[0], self.p2[1]))) or \ # <<<<<<<<<<<<<< + * (d4 == 0 and self._onSegment((othershape.p2[0], othershape.p2[1]), (self.p1[0], self.p1[1]), (self.p2[0], self.p2[1]))) + * + */ + __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_d3, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1059, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1059, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (!__pyx_t_10) { + goto __pyx_L16_next_or; + } else { + } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_onSegment); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1059, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1059, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_11, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1059, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1059, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_11, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1059, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1059, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4)) __PYX_ERR(0, 1059, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_9); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_9)) __PYX_ERR(0, 1059, __pyx_L1_error); + __pyx_t_4 = 0; + __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1059, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_9, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1059, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1059, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_9, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1059, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1059, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4)) __PYX_ERR(0, 1059, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7)) __PYX_ERR(0, 1059, __pyx_L1_error); + __pyx_t_4 = 0; + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1059, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1059, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1059, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1059, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1059, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4)) __PYX_ERR(0, 1059, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8)) __PYX_ERR(0, 1059, __pyx_L1_error); + __pyx_t_4 = 0; + __pyx_t_8 = 0; + __pyx_t_8 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[4] = {__pyx_t_8, __pyx_t_11, __pyx_t_9, __pyx_t_7}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1059, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1059, __pyx_L1_error) + if (!__pyx_t_10) { + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L11_bool_binop_done; + } + __pyx_L16_next_or:; + + /* "collisions.py":1060 + * (d2 == 0 and self._onSegment((self.p2[0], self.p2[1]), (othershape.p1[0], othershape.p1[1]), (othershape.p2[0], othershape.p2[1]))) or \ + * (d3 == 0 and self._onSegment((othershape.p1[0], othershape.p1[1]), (self.p1[0], self.p1[1]), (self.p2[0], self.p2[1]))) or \ + * (d4 == 0 and self._onSegment((othershape.p2[0], othershape.p2[1]), (self.p1[0], self.p1[1]), (self.p2[0], self.p2[1]))) # <<<<<<<<<<<<<< + * + * return othershape._collides(self) + */ + __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_d4, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1060, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1060, __pyx_L1_error) + if (__pyx_t_10) { + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + goto __pyx_L11_bool_binop_done; + } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_onSegment); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1060, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1060, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1060, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1060, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1060, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1060, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_9); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9)) __PYX_ERR(0, 1060, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_11); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_11)) __PYX_ERR(0, 1060, __pyx_L1_error); + __pyx_t_9 = 0; + __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1060, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_11, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1060, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1060, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_11, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1060, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1060, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_9); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9)) __PYX_ERR(0, 1060, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_8)) __PYX_ERR(0, 1060, __pyx_L1_error); + __pyx_t_9 = 0; + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1060, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1060, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1060, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1060, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1060, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_9); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_9)) __PYX_ERR(0, 1060, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4)) __PYX_ERR(0, 1060, __pyx_L1_error); + __pyx_t_9 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_t_7, __pyx_t_11, __pyx_t_8}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 3+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1060, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_INCREF(__pyx_t_2); + __pyx_t_1 = __pyx_t_2; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_L11_bool_binop_done:; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "collisions.py":1040 + * if checkShpType(othershape, ShpTyps.Point): + * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) + * if checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< + * if not self.check_rects(othershape): + * return False + */ + } + + /* "collisions.py":1062 + * (d4 == 0 and self._onSegment((othershape.p2[0], othershape.p2[1]), (self.p1[0], self.p1[1]), (self.p2[0], self.p2[1]))) + * + * return othershape._collides(self) # <<<<<<<<<<<<<< + * + * def _where(self, othershape: Shape) -> Iterable[pointLike]: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1062, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(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); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1062, __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; + + /* "collisions.py":1037 + * return False + * + * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Point): + * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) + */ + + /* function exit code */ + __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_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("collisions.Line._collides", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_direction); + __Pyx_XDECREF(__pyx_v_d1); + __Pyx_XDECREF(__pyx_v_d2); + __Pyx_XDECREF(__pyx_v_d3); + __Pyx_XDECREF(__pyx_v_d4); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":1064 + * return othershape._collides(self) + * + * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Point): + * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_4Line_25_where(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_4Line_26closestPointTo, "\n Find the closest point ON this object TO another object.\n\n Args:\n othershape (Shape): The other shape to find the closest point towards.\n returnAll (bool, optional): Whether to return ALL the possible options in order of closeness (True) or just the closest (False). Defaults to False.\n\n Returns:\n pointLike / Iterable[pointLike]: The closest points ON this object TO the other object\n "); -static PyMethodDef __pyx_mdef_10collisions_4Line_27closestPointTo = {"closestPointTo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_27closestPointTo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_26closestPointTo}; -static PyObject *__pyx_pw_10collisions_4Line_27closestPointTo(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_4Line_25_where = {"_where", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_25_where, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_4Line_25_where(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -35736,18 +36180,17 @@ PyObject *__pyx_args, PyObject *__pyx_kwds ) { PyObject *__pyx_v_self = 0; PyObject *__pyx_v_othershape = 0; - PyObject *__pyx_v_returnAll = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[3] = {0,0,0}; + PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("closestPointTo (wrapper)", 0); + __Pyx_RefNannySetupContext("_where (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -35757,13 +36200,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_othershape,&__pyx_n_s_returnAll,0}; - values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_othershape,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); @@ -35778,7 +36218,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1055, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1064, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -35786,39 +36226,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1055, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1064, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, 1); __PYX_ERR(0, 1055, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_returnAll); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1055, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, 1); __PYX_ERR(0, 1064, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "closestPointTo") < 0)) __PYX_ERR(0, 1055, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_where") < 0)) __PYX_ERR(0, 1064, __pyx_L3_error) } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; } else { - switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; __pyx_v_othershape = values[1]; - __pyx_v_returnAll = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1055, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1064, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -35828,11 +36256,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Line.closestPointTo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Line._where", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_26closestPointTo(__pyx_self, __pyx_v_self, __pyx_v_othershape, __pyx_v_returnAll); + __pyx_r = __pyx_pf_10collisions_4Line_24_where(__pyx_self, __pyx_v_self, __pyx_v_othershape); /* function exit code */ { @@ -35845,44 +36273,43 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "collisions.py":1083 - * return colls - * return colls[0] - * def calculate(ln, point, recalculate): # <<<<<<<<<<<<<< - * p2 = ln.closestPointTo(Point(*point)) - * olineP = point +/* "collisions.py":1071 + * return [] + * # This finds where the lines are colliding if they are infinite, which is why we check if they collide first + * def line(p1, p2): # <<<<<<<<<<<<<< + * A = (p1[1] - p2[1]) + * B = (p2[0] - p1[0]) */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_14closestPointTo_1calculate(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_4Line_6_where_1line(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_4Line_14closestPointTo_1calculate = {"calculate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_14closestPointTo_1calculate, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_4Line_14closestPointTo_1calculate(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_4Line_6_where_1line = {"line", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_6_where_1line, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_4Line_6_where_1line(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_ln = 0; - PyObject *__pyx_v_point = 0; - PyObject *__pyx_v_recalculate = 0; + PyObject *__pyx_v_p1 = 0; + PyObject *__pyx_v_p2 = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[3] = {0,0,0}; + PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("calculate (wrapper)", 0); + __Pyx_RefNannySetupContext("line (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -35892,12 +36319,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ln,&__pyx_n_s_point,&__pyx_n_s_recalculate,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p1,&__pyx_n_s_p2,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); @@ -35908,51 +36333,39 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ln)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p1)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1083, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1071, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p2)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1083, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 1); __PYX_ERR(0, 1083, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_recalculate)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1083, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1071, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 2); __PYX_ERR(0, 1083, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("line", 1, 2, 2, 1); __PYX_ERR(0, 1071, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "calculate") < 0)) __PYX_ERR(0, 1083, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "line") < 0)) __PYX_ERR(0, 1071, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 3)) { + } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } - __pyx_v_ln = values[0]; - __pyx_v_point = values[1]; - __pyx_v_recalculate = values[2]; + __pyx_v_p1 = values[0]; + __pyx_v_p2 = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1083, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("line", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1071, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -35962,11 +36375,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Line.closestPointTo.calculate", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Line._where.line", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_14closestPointTo_calculate(__pyx_self, __pyx_v_ln, __pyx_v_point, __pyx_v_recalculate); + __pyx_r = __pyx_pf_10collisions_4Line_6_where_line(__pyx_self, __pyx_v_p1, __pyx_v_p2); /* function exit code */ { @@ -35979,211 +36392,118 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_4Line_14closestPointTo_calculate(PyObject *__pyx_self, PyObject *__pyx_v_ln, PyObject *__pyx_v_point, PyObject *__pyx_v_recalculate) { - struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo *__pyx_cur_scope; - struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo *__pyx_outer_scope; - PyObject *__pyx_v_p2 = NULL; - PyObject *__pyx_v_olineP = NULL; +static PyObject *__pyx_pf_10collisions_4Line_6_where_line(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2) { + PyObject *__pyx_v_A = NULL; + PyObject *__pyx_v_B = NULL; + PyObject *__pyx_v_C = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - unsigned int __pyx_t_6; - int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("calculate", 1); - __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo *) __Pyx_CyFunction_GetClosure(__pyx_self); - __pyx_cur_scope = __pyx_outer_scope; + __Pyx_RefNannySetupContext("line", 1); - /* "collisions.py":1084 - * return colls[0] - * def calculate(ln, point, recalculate): - * p2 = ln.closestPointTo(Point(*point)) # <<<<<<<<<<<<<< - * olineP = point - * if recalculate: + /* "collisions.py":1072 + * # This finds where the lines are colliding if they are infinite, which is why we check if they collide first + * def line(p1, p2): + * A = (p1[1] - p2[1]) # <<<<<<<<<<<<<< + * B = (p2[0] - p1[0]) + * C = (p1[0]*p2[1] - p2[0]*p1[1]) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1084, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1072, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_p2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1072, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1084, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1072, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1084, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1084, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(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_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1084, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_v_p2 = __pyx_t_1; - __pyx_t_1 = 0; - - /* "collisions.py":1085 - * def calculate(ln, point, recalculate): - * p2 = ln.closestPointTo(Point(*point)) - * olineP = point # <<<<<<<<<<<<<< - * if recalculate: - * olineP = p2 - */ - __Pyx_INCREF(__pyx_v_point); - __pyx_v_olineP = __pyx_v_point; - - /* "collisions.py":1086 - * p2 = ln.closestPointTo(Point(*point)) - * olineP = point - * if recalculate: # <<<<<<<<<<<<<< - * olineP = p2 - * p2 = self.closestPointTo(Point(*p2)) - */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_recalculate); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1086, __pyx_L1_error) - if (__pyx_t_7) { - - /* "collisions.py":1087 - * olineP = point - * if recalculate: - * olineP = p2 # <<<<<<<<<<<<<< - * p2 = self.closestPointTo(Point(*p2)) - * return p2, abs(p2[0]-olineP[0])**2+abs(p2[1]-olineP[1])**2 - */ - __Pyx_INCREF(__pyx_v_p2); - __Pyx_DECREF_SET(__pyx_v_olineP, __pyx_v_p2); - - /* "collisions.py":1088 - * if recalculate: - * olineP = p2 - * p2 = self.closestPointTo(Point(*p2)) # <<<<<<<<<<<<<< - * return p2, abs(p2[0]-olineP[0])**2+abs(p2[1]-olineP[1])**2 - * tries = [ - */ - if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1088, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1088, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Point); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1088, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1088, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1088, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(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_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1088, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __Pyx_DECREF_SET(__pyx_v_p2, __pyx_t_1); - __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_A = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":1086 - * p2 = ln.closestPointTo(Point(*point)) - * olineP = point - * if recalculate: # <<<<<<<<<<<<<< - * olineP = p2 - * p2 = self.closestPointTo(Point(*p2)) + /* "collisions.py":1073 + * def line(p1, p2): + * A = (p1[1] - p2[1]) + * B = (p2[0] - p1[0]) # <<<<<<<<<<<<<< + * C = (p1[0]*p2[1] - p2[0]*p1[1]) + * return A, B, -C */ - } + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_p2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1073, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_p1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1073, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1073, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_B = __pyx_t_1; + __pyx_t_1 = 0; - /* "collisions.py":1089 - * olineP = p2 - * p2 = self.closestPointTo(Point(*p2)) - * return p2, abs(p2[0]-olineP[0])**2+abs(p2[1]-olineP[1])**2 # <<<<<<<<<<<<<< - * tries = [ - * calculate(self, othershape.p1, False), + /* "collisions.py":1074 + * A = (p1[1] - p2[1]) + * B = (p2[0] - p1[0]) + * C = (p1[0]*p2[1] - p2[0]*p1[1]) # <<<<<<<<<<<<<< + * return A, B, -C + * L1, L2 = line(self.p1, self.p2), line(othershape.p1, othershape.p2) */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1089, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_olineP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1089, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_p2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1089, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1089, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1089, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_p2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1089, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_p2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_olineP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1089, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1089, __pyx_L1_error) + __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1089, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1089, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1089, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1089, __pyx_L1_error) + __pyx_v_C = __pyx_t_1; + __pyx_t_1 = 0; + + /* "collisions.py":1075 + * B = (p2[0] - p1[0]) + * C = (p1[0]*p2[1] - p2[0]*p1[1]) + * return A, B, -C # <<<<<<<<<<<<<< + * L1, L2 = line(self.p1, self.p2), line(othershape.p1, othershape.p2) + * D = L1[0] * L2[1] - L1[1] * L2[0] + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyNumber_Negative(__pyx_v_C); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1075, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1075, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_v_p2); - __Pyx_GIVEREF(__pyx_v_p2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_p2)) __PYX_ERR(0, 1089, __pyx_L1_error); + __Pyx_INCREF(__pyx_v_A); + __Pyx_GIVEREF(__pyx_v_A); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_A)) __PYX_ERR(0, 1075, __pyx_L1_error); + __Pyx_INCREF(__pyx_v_B); + __Pyx_GIVEREF(__pyx_v_B); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_B)) __PYX_ERR(0, 1075, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 1089, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1)) __PYX_ERR(0, 1075, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":1083 - * return colls - * return colls[0] - * def calculate(ln, point, recalculate): # <<<<<<<<<<<<<< - * p2 = ln.closestPointTo(Point(*point)) - * olineP = point + /* "collisions.py":1071 + * return [] + * # This finds where the lines are colliding if they are infinite, which is why we check if they collide first + * def line(p1, p2): # <<<<<<<<<<<<<< + * A = (p1[1] - p2[1]) + * B = (p2[0] - p1[0]) */ /* function exit code */ @@ -36192,356 +36512,531 @@ static PyObject *__pyx_pf_10collisions_4Line_14closestPointTo_calculate(PyObject __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("collisions.Line.closestPointTo.calculate", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Line._where.line", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_p2); - __Pyx_XDECREF(__pyx_v_olineP); + __Pyx_XDECREF(__pyx_v_A); + __Pyx_XDECREF(__pyx_v_B); + __Pyx_XDECREF(__pyx_v_C); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":1110 - * return colls - * return colls[0] - * def calculate(ln, point, recalculate): # <<<<<<<<<<<<<< - * p2 = ln.closestPointTo(Point(*point)) - * olineP = point +/* "collisions.py":1064 + * return othershape._collides(self) + * + * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Point): + * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] */ -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_14closestPointTo_3calculate(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_4Line_14closestPointTo_3calculate = {"calculate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_14closestPointTo_3calculate, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_4Line_14closestPointTo_3calculate(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_ln = 0; - PyObject *__pyx_v_point = 0; - PyObject *__pyx_v_recalculate = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[3] = {0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("calculate (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ln,&__pyx_n_s_point,&__pyx_n_s_recalculate,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ln)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1110, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1110, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 1); __PYX_ERR(0, 1110, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_recalculate)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1110, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 2); __PYX_ERR(0, 1110, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "calculate") < 0)) __PYX_ERR(0, 1110, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 3)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - } - __pyx_v_ln = values[0]; - __pyx_v_point = values[1]; - __pyx_v_recalculate = values[2]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1110, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("collisions.Line.closestPointTo.calculate", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_14closestPointTo_2calculate(__pyx_self, __pyx_v_ln, __pyx_v_point, __pyx_v_recalculate); - - /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10collisions_4Line_14closestPointTo_2calculate(PyObject *__pyx_self, PyObject *__pyx_v_ln, PyObject *__pyx_v_point, PyObject *__pyx_v_recalculate) { - struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo *__pyx_cur_scope; - struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo *__pyx_outer_scope; - PyObject *__pyx_v_p2 = NULL; - PyObject *__pyx_v_olineP = NULL; +static PyObject *__pyx_pf_10collisions_4Line_24_where(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { + PyObject *__pyx_v_line = 0; + PyObject *__pyx_v_L1 = NULL; + PyObject *__pyx_v_L2 = NULL; + PyObject *__pyx_v_D = NULL; + PyObject *__pyx_v_Dx = NULL; + PyObject *__pyx_v_Dy = NULL; + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_y = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - unsigned int __pyx_t_6; + unsigned int __pyx_t_5; + int __pyx_t_6; int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("calculate", 1); - __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo *) __Pyx_CyFunction_GetClosure(__pyx_self); - __pyx_cur_scope = __pyx_outer_scope; + __Pyx_RefNannySetupContext("_where", 1); - /* "collisions.py":1111 - * return colls[0] - * def calculate(ln, point, recalculate): - * p2 = ln.closestPointTo(Point(*point)) # <<<<<<<<<<<<<< - * olineP = point - * if recalculate: + /* "collisions.py":1065 + * + * def _where(self, othershape: Shape) -> Iterable[pointLike]: + * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< + * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] + * if checkShpType(othershape, ShpTyps.Line): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1111, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1065, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1111, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1065, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1111, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1065, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1111, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = NULL; - __pyx_t_6 = 0; + __pyx_t_3 = NULL; + __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_4)) { + if (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_4); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_6 = 1; + __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1111, __pyx_L1_error) + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_othershape, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1065, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_v_p2 = __pyx_t_1; - __pyx_t_1 = 0; - - /* "collisions.py":1112 - * def calculate(ln, point, recalculate): - * p2 = ln.closestPointTo(Point(*point)) - * olineP = point # <<<<<<<<<<<<<< - * if recalculate: - * olineP = p2 - */ - __Pyx_INCREF(__pyx_v_point); - __pyx_v_olineP = __pyx_v_point; - - /* "collisions.py":1113 - * p2 = ln.closestPointTo(Point(*point)) - * olineP = point - * if recalculate: # <<<<<<<<<<<<<< - * olineP = p2 - * p2 = self.closestPointTo(Point(*p2)) - */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_recalculate); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1113, __pyx_L1_error) - if (__pyx_t_7) { - - /* "collisions.py":1114 - * olineP = point - * if recalculate: - * olineP = p2 # <<<<<<<<<<<<<< - * p2 = self.closestPointTo(Point(*p2)) - * return p2, abs(p2[0]-olineP[0])**2+abs(p2[1]-olineP[1])**2 - */ - __Pyx_INCREF(__pyx_v_p2); - __Pyx_DECREF_SET(__pyx_v_olineP, __pyx_v_p2); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1065, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { - /* "collisions.py":1115 - * if recalculate: - * olineP = p2 - * p2 = self.closestPointTo(Point(*p2)) # <<<<<<<<<<<<<< - * return p2, abs(p2[0]-olineP[0])**2+abs(p2[1]-olineP[1])**2 - * tries = [ + /* "collisions.py":1066 + * def _where(self, othershape: Shape) -> Iterable[pointLike]: + * if checkShpType(othershape, ShpTyps.Point): + * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Line): + * if not self.collides(othershape): */ - if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1115, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Point); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1115, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = NULL; - __pyx_t_6 = 0; + __pyx_t_3 = NULL; + __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (likely(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); + if (likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_6 = 1; + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_othershape}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1066, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __Pyx_DECREF_SET(__pyx_v_p2, __pyx_t_1); + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1066, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_6) { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1066, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1066, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1066, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 1066, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_4)) __PYX_ERR(0, 1066, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1066, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 1066, __pyx_L1_error); + __pyx_t_3 = 0; + __pyx_t_1 = __pyx_t_4; + __pyx_t_4 = 0; + } else { + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1066, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_r = __pyx_t_1; __pyx_t_1 = 0; + goto __pyx_L0; - /* "collisions.py":1113 - * p2 = ln.closestPointTo(Point(*point)) - * olineP = point - * if recalculate: # <<<<<<<<<<<<<< - * olineP = p2 - * p2 = self.closestPointTo(Point(*p2)) + /* "collisions.py":1065 + * + * def _where(self, othershape: Shape) -> Iterable[pointLike]: + * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< + * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] + * if checkShpType(othershape, ShpTyps.Line): */ } - /* "collisions.py":1116 - * olineP = p2 - * p2 = self.closestPointTo(Point(*p2)) - * return p2, abs(p2[0]-olineP[0])**2+abs(p2[1]-olineP[1])**2 # <<<<<<<<<<<<<< - * tries = [ - * calculate(self, p, False) for p in othershape.toPoints() + /* "collisions.py":1067 + * if checkShpType(othershape, ShpTyps.Point): + * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] + * if checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< + * if not self.collides(othershape): + * return [] */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_olineP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1116, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1116, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_p2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_olineP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_othershape, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1067, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1067, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_v_p2); - __Pyx_GIVEREF(__pyx_v_p2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_p2)) __PYX_ERR(0, 1116, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 1116, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; + if (__pyx_t_6) { - /* "collisions.py":1110 - * return colls - * return colls[0] - * def calculate(ln, point, recalculate): # <<<<<<<<<<<<<< - * p2 = ln.closestPointTo(Point(*point)) - * olineP = point + /* "collisions.py":1068 + * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] + * if checkShpType(othershape, ShpTyps.Line): + * if not self.collides(othershape): # <<<<<<<<<<<<<< + * return [] + * # This finds where the lines are colliding if they are infinite, which is why we check if they collide first + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1068, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_othershape}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1068, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1068, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_7 = (!__pyx_t_6); + if (__pyx_t_7) { + + /* "collisions.py":1069 + * if checkShpType(othershape, ShpTyps.Line): + * if not self.collides(othershape): + * return [] # <<<<<<<<<<<<<< + * # This finds where the lines are colliding if they are infinite, which is why we check if they collide first + * def line(p1, p2): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1069, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "collisions.py":1068 + * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] + * if checkShpType(othershape, ShpTyps.Line): + * if not self.collides(othershape): # <<<<<<<<<<<<<< + * return [] + * # This finds where the lines are colliding if they are infinite, which is why we check if they collide first + */ + } + + /* "collisions.py":1071 + * return [] + * # This finds where the lines are colliding if they are infinite, which is why we check if they collide first + * def line(p1, p2): # <<<<<<<<<<<<<< + * A = (p1[1] - p2[1]) + * B = (p2[0] - p1[0]) + */ + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_6_where_1line, 0, __pyx_n_s_Line__where_locals_line, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1071, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_line = __pyx_t_1; + __pyx_t_1 = 0; + + /* "collisions.py":1076 + * C = (p1[0]*p2[1] - p2[0]*p1[1]) + * return A, B, -C + * L1, L2 = line(self.p1, self.p2), line(othershape.p1, othershape.p2) # <<<<<<<<<<<<<< + * D = L1[0] * L2[1] - L1[1] * L2[0] + * Dx = L1[2] * L2[1] - L1[1] * L2[2] + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1076, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1076, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __pyx_pf_10collisions_4Line_6_where_line(__pyx_v_line, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1076, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1076, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1076, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __pyx_pf_10collisions_4Line_6_where_line(__pyx_v_line, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1076, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_L1 = __pyx_t_2; + __pyx_t_2 = 0; + __pyx_v_L2 = __pyx_t_3; + __pyx_t_3 = 0; + + /* "collisions.py":1077 + * return A, B, -C + * L1, L2 = line(self.p1, self.p2), line(othershape.p1, othershape.p2) + * D = L1[0] * L2[1] - L1[1] * L2[0] # <<<<<<<<<<<<<< + * Dx = L1[2] * L2[1] - L1[1] * L2[2] + * Dy = L1[0] * L2[2] - L1[2] * L2[0] + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_L1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1077, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_L2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1077, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1077, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_L1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1077, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_L2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1077, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1077, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1077, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_D = __pyx_t_3; + __pyx_t_3 = 0; + + /* "collisions.py":1078 + * L1, L2 = line(self.p1, self.p2), line(othershape.p1, othershape.p2) + * D = L1[0] * L2[1] - L1[1] * L2[0] + * Dx = L1[2] * L2[1] - L1[1] * L2[2] # <<<<<<<<<<<<<< + * Dy = L1[0] * L2[2] - L1[2] * L2[0] + * if D != 0: + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_L1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1078, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_L2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1078, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1078, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_L1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1078, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_L2, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1078, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1078, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1078, __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_v_Dx = __pyx_t_3; + __pyx_t_3 = 0; + + /* "collisions.py":1079 + * D = L1[0] * L2[1] - L1[1] * L2[0] + * Dx = L1[2] * L2[1] - L1[1] * L2[2] + * Dy = L1[0] * L2[2] - L1[2] * L2[0] # <<<<<<<<<<<<<< + * if D != 0: + * x = Dx / D + */ + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_L1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1079, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_L2, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1079, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1079, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_L1, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1079, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_L2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1079, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1079, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1079, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_Dy = __pyx_t_3; + __pyx_t_3 = 0; + + /* "collisions.py":1080 + * Dx = L1[2] * L2[1] - L1[1] * L2[2] + * Dy = L1[0] * L2[2] - L1[2] * L2[0] + * if D != 0: # <<<<<<<<<<<<<< + * x = Dx / D + * y = Dy / D + */ + __pyx_t_7 = (__Pyx_PyInt_BoolNeObjC(__pyx_v_D, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1080, __pyx_L1_error) + if (__pyx_t_7) { + + /* "collisions.py":1081 + * Dy = L1[0] * L2[2] - L1[2] * L2[0] + * if D != 0: + * x = Dx / D # <<<<<<<<<<<<<< + * y = Dy / D + * return [[float(x),float(y)]] + */ + __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_Dx, __pyx_v_D); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1081, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_x = __pyx_t_3; + __pyx_t_3 = 0; + + /* "collisions.py":1082 + * if D != 0: + * x = Dx / D + * y = Dy / D # <<<<<<<<<<<<<< + * return [[float(x),float(y)]] + * else: + */ + __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_Dy, __pyx_v_D); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1082, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_y = __pyx_t_3; + __pyx_t_3 = 0; + + /* "collisions.py":1083 + * x = Dx / D + * y = Dy / D + * return [[float(x),float(y)]] # <<<<<<<<<<<<<< + * else: + * return [] + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyNumber_Float(__pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1083, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyNumber_Float(__pyx_v_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1083, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1083, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 1083, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_4)) __PYX_ERR(0, 1083, __pyx_L1_error); + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1083, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 1083, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "collisions.py":1080 + * Dx = L1[2] * L2[1] - L1[1] * L2[2] + * Dy = L1[0] * L2[2] - L1[2] * L2[0] + * if D != 0: # <<<<<<<<<<<<<< + * x = Dx / D + * y = Dy / D + */ + } + + /* "collisions.py":1085 + * return [[float(x),float(y)]] + * else: + * return [] # <<<<<<<<<<<<<< + * return othershape._where(self) + * + */ + /*else*/ { + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1085, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + } + + /* "collisions.py":1067 + * if checkShpType(othershape, ShpTyps.Point): + * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] + * if checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< + * if not self.collides(othershape): + * return [] + */ + } + + /* "collisions.py":1086 + * else: + * return [] + * return othershape._where(self) # <<<<<<<<<<<<<< + * + * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLike|Iterable[pointLike]: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_where); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1086, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_self}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1086, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "collisions.py":1064 + * return othershape._collides(self) + * + * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Point): + * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] */ /* function exit code */ @@ -36550,53 +37045,61 @@ static PyObject *__pyx_pf_10collisions_4Line_14closestPointTo_2calculate(PyObjec __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("collisions.Line.closestPointTo.calculate", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Line._where", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_p2); - __Pyx_XDECREF(__pyx_v_olineP); + __Pyx_XDECREF(__pyx_v_line); + __Pyx_XDECREF(__pyx_v_L1); + __Pyx_XDECREF(__pyx_v_L2); + __Pyx_XDECREF(__pyx_v_D); + __Pyx_XDECREF(__pyx_v_Dx); + __Pyx_XDECREF(__pyx_v_Dy); + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_y); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":1096 - * calculate(othershape, self.p2, True), - * ] - * tries.sort(key=lambda x: x[1]) # <<<<<<<<<<<<<< - * if returnAll: - * return [i[0] for i in tries] +/* "collisions.py":1088 + * return othershape._where(self) + * + * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLike|Iterable[pointLike]: # <<<<<<<<<<<<<< + * """ + * Find the closest point ON this object TO another object. */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_14closestPointTo_4lambda7(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_4Line_27closestPointTo(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_4Line_14closestPointTo_4lambda7 = {"lambda7", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_14closestPointTo_4lambda7, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_4Line_14closestPointTo_4lambda7(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_4Line_26closestPointTo, "\n Find the closest point ON this object TO another object.\n\n Args:\n othershape (Shape): The other shape to find the closest point towards.\n returnAll (bool, optional): Whether to return ALL the possible options in order of closeness (True) or just the closest (False). Defaults to False.\n\n Returns:\n pointLike / Iterable[pointLike]: The closest points ON this object TO the other object\n "); +static PyMethodDef __pyx_mdef_10collisions_4Line_27closestPointTo = {"closestPointTo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_27closestPointTo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_26closestPointTo}; +static PyObject *__pyx_pw_10collisions_4Line_27closestPointTo(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_x = 0; + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_othershape = 0; + PyObject *__pyx_v_returnAll = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; + PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lambda7 (wrapper)", 0); + __Pyx_RefNannySetupContext("closestPointTo (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -36606,10 +37109,15 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_othershape,&__pyx_n_s_returnAll,0}; + values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; @@ -36618,27 +37126,51 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1088, __pyx_L3_error) else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_othershape)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1088, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, 1); __PYX_ERR(0, 1088, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_returnAll); + if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1088, __pyx_L3_error) + } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda7") < 0)) __PYX_ERR(0, 1096, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "closestPointTo") < 0)) __PYX_ERR(0, 1088, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } } - __pyx_v_x = values[0]; + __pyx_v_self = values[0]; + __pyx_v_othershape = values[1]; + __pyx_v_returnAll = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda7", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1096, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1088, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -36648,11 +37180,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Line.closestPointTo.lambda7", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Line.closestPointTo", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_lambda_funcdef_lambda7(__pyx_self, __pyx_v_x); + __pyx_r = __pyx_pf_10collisions_4Line_26closestPointTo(__pyx_self, __pyx_v_self, __pyx_v_othershape, __pyx_v_returnAll); /* function exit code */ { @@ -36665,68 +37197,44 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { - 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("lambda7", 1); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1096, __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("collisions.Line.closestPointTo.lambda7", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "collisions.py":1124 - * calculate(ln, self.p2, True) for ln in othershape.toLines() - * ] - * tries.sort(key=lambda x: x[1]) # <<<<<<<<<<<<<< - * if returnAll: - * return [i[0] for i in tries] +/* "collisions.py":1116 + * return colls + * return colls[0] + * def calculate(ln, point, recalculate): # <<<<<<<<<<<<<< + * p2 = ln.closestPointTo(Point(*point)) + * olineP = point */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_14closestPointTo_5lambda8(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_4Line_14closestPointTo_1calculate(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_4Line_14closestPointTo_5lambda8 = {"lambda8", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_14closestPointTo_5lambda8, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_4Line_14closestPointTo_5lambda8(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_4Line_14closestPointTo_1calculate = {"calculate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_14closestPointTo_1calculate, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_4Line_14closestPointTo_1calculate(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_x = 0; + PyObject *__pyx_v_ln = 0; + PyObject *__pyx_v_point = 0; + PyObject *__pyx_v_recalculate = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; + PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lambda8 (wrapper)", 0); + __Pyx_RefNannySetupContext("calculate (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -36736,10 +37244,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ln,&__pyx_n_s_point,&__pyx_n_s_recalculate,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; @@ -36748,27 +37260,51 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ln)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1124, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1116, __pyx_L3_error) else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1116, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 1); __PYX_ERR(0, 1116, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_recalculate)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1116, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 2); __PYX_ERR(0, 1116, __pyx_L3_error) + } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda8") < 0)) __PYX_ERR(0, 1124, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "calculate") < 0)) __PYX_ERR(0, 1116, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 1)) { + } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } - __pyx_v_x = values[0]; + __pyx_v_ln = values[0]; + __pyx_v_point = values[1]; + __pyx_v_recalculate = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda8", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1124, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1116, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -36778,11 +37314,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Line.closestPointTo.lambda8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Line.closestPointTo.calculate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_lambda_funcdef_lambda8(__pyx_self, __pyx_v_x); + __pyx_r = __pyx_pf_10collisions_4Line_14closestPointTo_calculate(__pyx_self, __pyx_v_ln, __pyx_v_point, __pyx_v_recalculate); /* function exit code */ { @@ -36795,3462 +37331,2558 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { - 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("lambda8", 1); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __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("collisions.Line.closestPointTo.lambda8", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "collisions.py":1055 - * return othershape._where(self) - * - * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLike|Iterable[pointLike]: # <<<<<<<<<<<<<< - * """ - * Find the closest point ON this object TO another object. - */ - -static PyObject *__pyx_pf_10collisions_4Line_26closestPointTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape, PyObject *__pyx_v_returnAll) { - struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo *__pyx_cur_scope; - PyObject *__pyx_v_dx = NULL; - PyObject *__pyx_v_dy = NULL; - PyObject *__pyx_v_det = NULL; - PyObject *__pyx_v_a = NULL; - PyObject *__pyx_v_p = NULL; - PyObject *__pyx_v_colls = NULL; - PyObject *__pyx_v_calculate = 0; - PyObject *__pyx_v_tries = NULL; - PyObject *__pyx_9genexpr15__pyx_v_i = NULL; - PyObject *__pyx_9genexpr16__pyx_v_p = NULL; - PyObject *__pyx_9genexpr17__pyx_v_ln = NULL; - PyObject *__pyx_9genexpr18__pyx_v_ln = NULL; - PyObject *__pyx_9genexpr19__pyx_v_i = NULL; +static PyObject *__pyx_pf_10collisions_4Line_14closestPointTo_calculate(PyObject *__pyx_self, PyObject *__pyx_v_ln, PyObject *__pyx_v_point, PyObject *__pyx_v_recalculate) { + struct __pyx_obj_10collisions___pyx_scope_struct_8_closestPointTo *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_8_closestPointTo *__pyx_outer_scope; + PyObject *__pyx_v_p2 = NULL; + PyObject *__pyx_v_olineP = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; PyObject *__pyx_t_2 = NULL; PyObject *__pyx_t_3 = NULL; PyObject *__pyx_t_4 = NULL; - unsigned int __pyx_t_5; - int __pyx_t_6; - long __pyx_t_7; - PyObject *__pyx_t_8 = NULL; - Py_ssize_t __pyx_t_9; - PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - PyObject *(*__pyx_t_12)(PyObject *); + PyObject *__pyx_t_5 = NULL; + unsigned int __pyx_t_6; + int __pyx_t_7; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("closestPointTo", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo *)__pyx_tp_new_10collisions___pyx_scope_struct_7_closestPointTo(__pyx_ptype_10collisions___pyx_scope_struct_7_closestPointTo, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1055, __pyx_L1_error) - } else { - __Pyx_GOTREF((PyObject *)__pyx_cur_scope); - } - __pyx_cur_scope->__pyx_v_self = __pyx_v_self; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); + __Pyx_RefNannySetupContext("calculate", 1); + __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_8_closestPointTo *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; - /* "collisions.py":1066 - * pointLike / Iterable[pointLike]: The closest points ON this object TO the other object - * """ - * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< - * dx, dy = self.p2[0] - self.p1[0], self.p2[1] - self.p1[1] - * det = dx * dx + dy * dy + /* "collisions.py":1117 + * return colls[0] + * def calculate(ln, point, recalculate): + * p2 = ln.closestPointTo(Point(*point)) # <<<<<<<<<<<<<< + * olineP = point + * if recalculate: */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1066, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1066, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1066, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; - __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_3)) { + if (likely(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_3); + __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_5 = 1; + __pyx_t_6 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_othershape, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1066, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1066, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_6) { - - /* "collisions.py":1067 - * """ - * if checkShpType(othershape, ShpTyps.Point): - * dx, dy = self.p2[0] - self.p1[0], self.p2[1] - self.p1[1] # <<<<<<<<<<<<<< - * det = dx * dx + dy * dy - * if det == 0: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1067, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1067, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1067, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1067, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1067, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1067, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1067, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1067, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1067, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1067, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_dx = __pyx_t_1; - __pyx_t_1 = 0; - __pyx_v_dy = __pyx_t_4; - __pyx_t_4 = 0; - - /* "collisions.py":1068 - * if checkShpType(othershape, ShpTyps.Point): - * dx, dy = self.p2[0] - self.p1[0], self.p2[1] - self.p1[1] - * det = dx * dx + dy * dy # <<<<<<<<<<<<<< - * if det == 0: - * return self.p1 - */ - __pyx_t_4 = PyNumber_Multiply(__pyx_v_dx, __pyx_v_dx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1068, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyNumber_Multiply(__pyx_v_dy, __pyx_v_dy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1068, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1068, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_det = __pyx_t_3; - __pyx_t_3 = 0; - - /* "collisions.py":1069 - * dx, dy = self.p2[0] - self.p1[0], self.p2[1] - self.p1[1] - * det = dx * dx + dy * dy - * if det == 0: # <<<<<<<<<<<<<< - * return self.p1 - * a = (dy * (othershape[1] - self.p1[1]) + dx * (othershape[0] - self.p1[0])) / det - */ - __pyx_t_6 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_det, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1069, __pyx_L1_error) - if (__pyx_t_6) { - - /* "collisions.py":1070 - * det = dx * dx + dy * dy - * if det == 0: - * return self.p1 # <<<<<<<<<<<<<< - * a = (dy * (othershape[1] - self.p1[1]) + dx * (othershape[0] - self.p1[0])) / det - * a = min(1, max(0, a)) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1070, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; + __pyx_v_p2 = __pyx_t_1; + __pyx_t_1 = 0; - /* "collisions.py":1069 - * dx, dy = self.p2[0] - self.p1[0], self.p2[1] - self.p1[1] - * det = dx * dx + dy * dy - * if det == 0: # <<<<<<<<<<<<<< - * return self.p1 - * a = (dy * (othershape[1] - self.p1[1]) + dx * (othershape[0] - self.p1[0])) / det + /* "collisions.py":1118 + * def calculate(ln, point, recalculate): + * p2 = ln.closestPointTo(Point(*point)) + * olineP = point # <<<<<<<<<<<<<< + * if recalculate: + * olineP = p2 */ - } + __Pyx_INCREF(__pyx_v_point); + __pyx_v_olineP = __pyx_v_point; - /* "collisions.py":1071 - * if det == 0: - * return self.p1 - * a = (dy * (othershape[1] - self.p1[1]) + dx * (othershape[0] - self.p1[0])) / det # <<<<<<<<<<<<<< - * a = min(1, max(0, a)) - * p = (self.p1[0] + a * dx, self.p1[1] + a * dy) + /* "collisions.py":1119 + * p2 = ln.closestPointTo(Point(*point)) + * olineP = point + * if recalculate: # <<<<<<<<<<<<<< + * olineP = p2 + * p2 = self.closestPointTo(Point(*p2)) */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_othershape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1071, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1071, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1071, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1071, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Multiply(__pyx_v_dy, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1071, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_othershape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1071, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1071, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1071, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1071, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Multiply(__pyx_v_dx, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1071, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1071, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_det); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1071, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_a = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_recalculate); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1119, __pyx_L1_error) + if (__pyx_t_7) { - /* "collisions.py":1072 - * return self.p1 - * a = (dy * (othershape[1] - self.p1[1]) + dx * (othershape[0] - self.p1[0])) / det - * a = min(1, max(0, a)) # <<<<<<<<<<<<<< - * p = (self.p1[0] + a * dx, self.p1[1] + a * dy) - * if returnAll: + /* "collisions.py":1120 + * olineP = point + * if recalculate: + * olineP = p2 # <<<<<<<<<<<<<< + * p2 = self.closestPointTo(Point(*p2)) + * return p2, abs(p2[0]-olineP[0])**2+abs(p2[1]-olineP[1])**2 */ - __Pyx_INCREF(__pyx_v_a); - __pyx_t_2 = __pyx_v_a; - __pyx_t_7 = 0; - __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1072, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1072, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1072, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_6) { - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = __pyx_t_2; - } else { - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1072, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __pyx_t_1; - __pyx_t_1 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_INCREF(__pyx_t_3); - __pyx_t_2 = __pyx_t_3; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = 1; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1072, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1072, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1072, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = __pyx_t_2; - } else { - __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1072, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __pyx_t_4; - __pyx_t_4 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_t_3; - __Pyx_INCREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_a, __pyx_t_2); - __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v_p2); + __Pyx_DECREF_SET(__pyx_v_olineP, __pyx_v_p2); - /* "collisions.py":1073 - * a = (dy * (othershape[1] - self.p1[1]) + dx * (othershape[0] - self.p1[0])) / det - * a = min(1, max(0, a)) - * p = (self.p1[0] + a * dx, self.p1[1] + a * dy) # <<<<<<<<<<<<<< - * if returnAll: - * return [p] + /* "collisions.py":1121 + * if recalculate: + * olineP = p2 + * p2 = self.closestPointTo(Point(*p2)) # <<<<<<<<<<<<<< + * return p2, abs(p2[0]-olineP[0])**2+abs(p2[1]-olineP[1])**2 + * tries = [ */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1073, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1073, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Multiply(__pyx_v_a, __pyx_v_dx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1073, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1121, __pyx_L1_error) } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1073, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Point); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1073, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1073, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Multiply(__pyx_v_a, __pyx_v_dy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1073, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1073, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1073, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 1073, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1073, __pyx_L1_error); - __pyx_t_4 = 0; - __pyx_t_1 = 0; - __pyx_v_p = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; - - /* "collisions.py":1074 - * a = min(1, max(0, a)) - * p = (self.p1[0] + a * dx, self.p1[1] + a * dy) - * if returnAll: # <<<<<<<<<<<<<< - * return [p] - * return p - */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1074, __pyx_L1_error) - if (__pyx_t_6) { - - /* "collisions.py":1075 - * p = (self.p1[0] + a * dx, self.p1[1] + a * dy) - * if returnAll: - * return [p] # <<<<<<<<<<<<<< - * return p - * elif checkShpType(othershape, ShpTyps.Line): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1075, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_p); - __Pyx_GIVEREF(__pyx_v_p); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_p)) __PYX_ERR(0, 1075, __pyx_L1_error); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "collisions.py":1074 - * a = min(1, max(0, a)) - * p = (self.p1[0] + a * dx, self.p1[1] + a * dy) - * if returnAll: # <<<<<<<<<<<<<< - * return [p] - * return p - */ - } - - /* "collisions.py":1076 - * if returnAll: - * return [p] - * return p # <<<<<<<<<<<<<< - * elif checkShpType(othershape, ShpTyps.Line): - * colls = self.whereCollides(othershape) - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_p); - __pyx_r = __pyx_v_p; - goto __pyx_L0; - - /* "collisions.py":1066 - * pointLike / Iterable[pointLike]: The closest points ON this object TO the other object - * """ - * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< - * dx, dy = self.p2[0] - self.p1[0], self.p2[1] - self.p1[1] - * det = dx * dx + dy * dy - */ - } - - /* "collisions.py":1077 - * return [p] - * return p - * elif checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< - * colls = self.whereCollides(othershape) - * if colls != []: - */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1077, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1077, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1077, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_othershape, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1077, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1077, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_6) { - - /* "collisions.py":1078 - * return p - * elif checkShpType(othershape, ShpTyps.Line): - * colls = self.whereCollides(othershape) # <<<<<<<<<<<<<< - * if colls != []: - * if returnAll: - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1078, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = NULL; - __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_3); + if (likely(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_1, function); - __pyx_t_5 = 1; + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_othershape}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1078, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1121, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_v_colls = __pyx_t_2; - __pyx_t_2 = 0; - - /* "collisions.py":1079 - * elif checkShpType(othershape, ShpTyps.Line): - * colls = self.whereCollides(othershape) - * if colls != []: # <<<<<<<<<<<<<< - * if returnAll: - * return colls - */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1079, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_colls, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1079, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1079, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_6) { + __Pyx_DECREF_SET(__pyx_v_p2, __pyx_t_1); + __pyx_t_1 = 0; - /* "collisions.py":1080 - * colls = self.whereCollides(othershape) - * if colls != []: - * if returnAll: # <<<<<<<<<<<<<< - * return colls - * return colls[0] + /* "collisions.py":1119 + * p2 = ln.closestPointTo(Point(*point)) + * olineP = point + * if recalculate: # <<<<<<<<<<<<<< + * olineP = p2 + * p2 = self.closestPointTo(Point(*p2)) */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1080, __pyx_L1_error) - if (__pyx_t_6) { + } - /* "collisions.py":1081 - * if colls != []: - * if returnAll: - * return colls # <<<<<<<<<<<<<< - * return colls[0] - * def calculate(ln, point, recalculate): + /* "collisions.py":1122 + * olineP = p2 + * p2 = self.closestPointTo(Point(*p2)) + * return p2, abs(p2[0]-olineP[0])**2+abs(p2[1]-olineP[1])**2 # <<<<<<<<<<<<<< + * tries = [ + * calculate(self, othershape.p1, False), */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_colls); - __pyx_r = __pyx_v_colls; - goto __pyx_L0; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_olineP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_p2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_olineP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1122, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_p2); + __Pyx_GIVEREF(__pyx_v_p2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_p2)) __PYX_ERR(0, 1122, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 1122, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; - /* "collisions.py":1080 - * colls = self.whereCollides(othershape) - * if colls != []: - * if returnAll: # <<<<<<<<<<<<<< + /* "collisions.py":1116 * return colls * return colls[0] - */ - } - - /* "collisions.py":1082 - * if returnAll: - * return colls - * return colls[0] # <<<<<<<<<<<<<< - * def calculate(ln, point, recalculate): + * def calculate(ln, point, recalculate): # <<<<<<<<<<<<<< * p2 = ln.closestPointTo(Point(*point)) + * olineP = point */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_colls, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1082, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - /* "collisions.py":1079 - * elif checkShpType(othershape, ShpTyps.Line): - * colls = self.whereCollides(othershape) - * if colls != []: # <<<<<<<<<<<<<< - * if returnAll: - * return colls - */ - } + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("collisions.Line.closestPointTo.calculate", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_p2); + __Pyx_XDECREF(__pyx_v_olineP); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "collisions.py":1083 +/* "collisions.py":1143 * return colls * return colls[0] * def calculate(ln, point, recalculate): # <<<<<<<<<<<<<< * p2 = ln.closestPointTo(Point(*point)) * olineP = point */ - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_14closestPointTo_1calculate, 0, __pyx_n_s_Line_closestPointTo_locals_calcu, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1083, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_calculate = __pyx_t_1; - __pyx_t_1 = 0; - - /* "collisions.py":1091 - * return p2, abs(p2[0]-olineP[0])**2+abs(p2[1]-olineP[1])**2 - * tries = [ - * calculate(self, othershape.p1, False), # <<<<<<<<<<<<<< - * calculate(self, othershape.p2, False), - * calculate(othershape, self.p1, True), - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1091, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1091, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_self)) __PYX_ERR(0, 1091, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1091, __pyx_L1_error); - __Pyx_INCREF(Py_False); - __Pyx_GIVEREF(Py_False); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, Py_False)) __PYX_ERR(0, 1091, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1091, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":1092 - * tries = [ - * calculate(self, othershape.p1, False), - * calculate(self, othershape.p2, False), # <<<<<<<<<<<<<< - * calculate(othershape, self.p1, True), - * calculate(othershape, self.p2, True), - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1092, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1092, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_self)) __PYX_ERR(0, 1092, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 1092, __pyx_L1_error); - __Pyx_INCREF(Py_False); - __Pyx_GIVEREF(Py_False); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, Py_False)) __PYX_ERR(0, 1092, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1092, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "collisions.py":1093 - * calculate(self, othershape.p1, False), - * calculate(self, othershape.p2, False), - * calculate(othershape, self.p1, True), # <<<<<<<<<<<<<< - * calculate(othershape, self.p2, True), - * ] - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1093, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1093, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_v_othershape); - __Pyx_GIVEREF(__pyx_v_othershape); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_othershape)) __PYX_ERR(0, 1093, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 1093, __pyx_L1_error); - __Pyx_INCREF(Py_True); - __Pyx_GIVEREF(Py_True); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, Py_True)) __PYX_ERR(0, 1093, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1093, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - - /* "collisions.py":1094 - * calculate(self, othershape.p2, False), - * calculate(othershape, self.p1, True), - * calculate(othershape, self.p2, True), # <<<<<<<<<<<<<< - * ] - * tries.sort(key=lambda x: x[1]) - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1094, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1094, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_INCREF(__pyx_v_othershape); - __Pyx_GIVEREF(__pyx_v_othershape); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_othershape)) __PYX_ERR(0, 1094, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4)) __PYX_ERR(0, 1094, __pyx_L1_error); - __Pyx_INCREF(Py_True); - __Pyx_GIVEREF(Py_True); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, Py_True)) __PYX_ERR(0, 1094, __pyx_L1_error); - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1094, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - - /* "collisions.py":1090 - * p2 = self.closestPointTo(Point(*p2)) - * return p2, abs(p2[0]-olineP[0])**2+abs(p2[1]-olineP[1])**2 - * tries = [ # <<<<<<<<<<<<<< - * calculate(self, othershape.p1, False), - * calculate(self, othershape.p2, False), - */ - __pyx_t_8 = PyList_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1090, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_1)) __PYX_ERR(0, 1090, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_2)) __PYX_ERR(0, 1090, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 2, __pyx_t_3)) __PYX_ERR(0, 1090, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 3, __pyx_t_4)) __PYX_ERR(0, 1090, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_t_4 = 0; - __pyx_v_tries = ((PyObject*)__pyx_t_8); - __pyx_t_8 = 0; - - /* "collisions.py":1096 - * calculate(othershape, self.p2, True), - * ] - * tries.sort(key=lambda x: x[1]) # <<<<<<<<<<<<<< - * if returnAll: - * return [i[0] for i in tries] - */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_tries, __pyx_n_s_sort); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1096, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1096, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_14closestPointTo_4lambda7, 0, __pyx_n_s_Line_closestPointTo_locals_lambd, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1096, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_key, __pyx_t_3) < 0) __PYX_ERR(0, 1096, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1096, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - - /* "collisions.py":1097 - * ] - * tries.sort(key=lambda x: x[1]) - * if returnAll: # <<<<<<<<<<<<<< - * return [i[0] for i in tries] - * return tries[0][0] - */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1097, __pyx_L1_error) - if (__pyx_t_6) { - - /* "collisions.py":1098 - * tries.sort(key=lambda x: x[1]) - * if returnAll: - * return [i[0] for i in tries] # <<<<<<<<<<<<<< - * return tries[0][0] - * elif checkShpType(othershape, ShpTyps.Circle): - */ - __Pyx_XDECREF(__pyx_r); - { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1098, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_v_tries; __Pyx_INCREF(__pyx_t_4); - __pyx_t_9 = 0; - for (;;) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1098, __pyx_L11_error) - #endif - if (__pyx_t_9 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1098, __pyx_L11_error) - #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1098, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_8); - #endif - __Pyx_XDECREF_SET(__pyx_9genexpr15__pyx_v_i, __pyx_t_8); - __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_GetItemInt(__pyx_9genexpr15__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1098, __pyx_L11_error) - __Pyx_GOTREF(__pyx_t_8); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 1098, __pyx_L11_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_4Line_14closestPointTo_3calculate(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_10collisions_4Line_14closestPointTo_3calculate = {"calculate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_14closestPointTo_3calculate, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_4Line_14closestPointTo_3calculate(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_ln = 0; + PyObject *__pyx_v_point = 0; + PyObject *__pyx_v_recalculate = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("calculate (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ln,&__pyx_n_s_point,&__pyx_n_s_recalculate,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_ln)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_i); __pyx_9genexpr15__pyx_v_i = 0; - goto __pyx_L15_exit_scope; - __pyx_L11_error:; - __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_i); __pyx_9genexpr15__pyx_v_i = 0; - goto __pyx_L1_error; - __pyx_L15_exit_scope:; - } /* exit inner scope */ - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - /* "collisions.py":1097 - * ] - * tries.sort(key=lambda x: x[1]) - * if returnAll: # <<<<<<<<<<<<<< - * return [i[0] for i in tries] - * return tries[0][0] - */ + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1143, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1143, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 1); __PYX_ERR(0, 1143, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_recalculate)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1143, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 2); __PYX_ERR(0, 1143, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "calculate") < 0)) __PYX_ERR(0, 1143, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); } + __pyx_v_ln = values[0]; + __pyx_v_point = values[1]; + __pyx_v_recalculate = values[2]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1143, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("collisions.Line.closestPointTo.calculate", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_4Line_14closestPointTo_2calculate(__pyx_self, __pyx_v_ln, __pyx_v_point, __pyx_v_recalculate); - /* "collisions.py":1099 - * if returnAll: - * return [i[0] for i in tries] - * return tries[0][0] # <<<<<<<<<<<<<< - * elif checkShpType(othershape, ShpTyps.Circle): - * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_tries, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1099, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1099, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "collisions.py":1077 - * return [p] - * return p - * elif checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< - * colls = self.whereCollides(othershape) - * if colls != []: - */ + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "collisions.py":1100 - * return [i[0] for i in tries] - * return tries[0][0] - * elif checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< - * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, ShpTyps.Arc): +static PyObject *__pyx_pf_10collisions_4Line_14closestPointTo_2calculate(PyObject *__pyx_self, PyObject *__pyx_v_ln, PyObject *__pyx_v_point, PyObject *__pyx_v_recalculate) { + struct __pyx_obj_10collisions___pyx_scope_struct_8_closestPointTo *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_8_closestPointTo *__pyx_outer_scope; + PyObject *__pyx_v_p2 = NULL; + PyObject *__pyx_v_olineP = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + unsigned int __pyx_t_6; + int __pyx_t_7; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("calculate", 1); + __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_8_closestPointTo *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "collisions.py":1144 + * return colls[0] + * def calculate(ln, point, recalculate): + * p2 = ln.closestPointTo(Point(*point)) # <<<<<<<<<<<<<< + * olineP = point + * if recalculate: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_Circle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1100, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = NULL; - __pyx_t_5 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_8); + if (likely(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_3, function); - __pyx_t_5 = 1; + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_othershape, __pyx_t_2}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_5}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1144, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1100, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1100, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { + __pyx_v_p2 = __pyx_t_1; + __pyx_t_1 = 0; - /* "collisions.py":1101 - * return tries[0][0] - * elif checkShpType(othershape, ShpTyps.Circle): - * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) # <<<<<<<<<<<<<< - * elif checkShpType(othershape, ShpTyps.Arc): - * return self.closestPointTo(Point(*othershape.closestPointTo(self))) + /* "collisions.py":1145 + * def calculate(ln, point, recalculate): + * p2 = ln.closestPointTo(Point(*point)) + * olineP = point # <<<<<<<<<<<<<< + * if recalculate: + * olineP = p2 */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1101, __pyx_L1_error) + __Pyx_INCREF(__pyx_v_point); + __pyx_v_olineP = __pyx_v_point; + + /* "collisions.py":1146 + * p2 = ln.closestPointTo(Point(*point)) + * olineP = point + * if recalculate: # <<<<<<<<<<<<<< + * olineP = p2 + * p2 = self.closestPointTo(Point(*p2)) + */ + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_recalculate); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1146, __pyx_L1_error) + if (__pyx_t_7) { + + /* "collisions.py":1147 + * olineP = point + * if recalculate: + * olineP = p2 # <<<<<<<<<<<<<< + * p2 = self.closestPointTo(Point(*p2)) + * return p2, abs(p2[0]-olineP[0])**2+abs(p2[1]-olineP[1])**2 + */ + __Pyx_INCREF(__pyx_v_p2); + __Pyx_DECREF_SET(__pyx_v_olineP, __pyx_v_p2); + + /* "collisions.py":1148 + * if recalculate: + * olineP = p2 + * p2 = self.closestPointTo(Point(*p2)) # <<<<<<<<<<<<<< + * return p2, abs(p2[0]-olineP[0])**2+abs(p2[1]-olineP[1])**2 + * tries = [ + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1148, __pyx_L1_error) } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Point); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Point); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1101, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1101, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1101, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_1, __pyx_t_10}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1101, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - __pyx_t_8 = NULL; - __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_8); + if (likely(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_3, function); - __pyx_t_5 = 1; + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_2, __pyx_v_returnAll}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1101, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; + __Pyx_DECREF_SET(__pyx_v_p2, __pyx_t_1); + __pyx_t_1 = 0; - /* "collisions.py":1100 - * return [i[0] for i in tries] - * return tries[0][0] - * elif checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< - * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, ShpTyps.Arc): + /* "collisions.py":1146 + * p2 = ln.closestPointTo(Point(*point)) + * olineP = point + * if recalculate: # <<<<<<<<<<<<<< + * olineP = p2 + * p2 = self.closestPointTo(Point(*p2)) */ } - /* "collisions.py":1102 - * elif checkShpType(othershape, ShpTyps.Circle): - * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< - * return self.closestPointTo(Point(*othershape.closestPointTo(self))) - * else: # Rects, Rotated rects and polygons + /* "collisions.py":1149 + * olineP = p2 + * p2 = self.closestPointTo(Point(*p2)) + * return p2, abs(p2[0]-olineP[0])**2+abs(p2[1]-olineP[1])**2 # <<<<<<<<<<<<<< + * tries = [ + * calculate(self, p, False) for p in othershape.toPoints() */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1102, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_olineP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1102, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Arc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1102, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_othershape, __pyx_t_8}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1102, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1102, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_p2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_olineP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { + __pyx_t_4 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1149, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_p2); + __Pyx_GIVEREF(__pyx_v_p2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_p2)) __PYX_ERR(0, 1149, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 1149, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; - /* "collisions.py":1103 - * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, ShpTyps.Arc): - * return self.closestPointTo(Point(*othershape.closestPointTo(self))) # <<<<<<<<<<<<<< - * else: # Rects, Rotated rects and polygons - * colls = self.whereCollides(othershape) + /* "collisions.py":1143 + * return colls + * return colls[0] + * def calculate(ln, point, recalculate): # <<<<<<<<<<<<<< + * p2 = ln.closestPointTo(Point(*point)) + * olineP = point */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Point); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - __pyx_t_5 = 1; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("collisions.Line.closestPointTo.calculate", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_p2); + __Pyx_XDECREF(__pyx_v_olineP); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":1129 + * calculate(othershape, self.p2, True), + * ] + * tries.sort(key=lambda x: x[1]) # <<<<<<<<<<<<<< + * if returnAll: + * return [i[0] for i in tries] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_4Line_14closestPointTo_4lambda7(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_10collisions_4Line_14closestPointTo_4lambda7 = {"lambda7", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_14closestPointTo_4lambda7, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_4Line_14closestPointTo_4lambda7(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_x = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda7 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1129, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda7") < 0)) __PYX_ERR(0, 1129, __pyx_L3_error) } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_cur_scope->__pyx_v_self}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_v_x = values[0]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("lambda7", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1129, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } - __pyx_t_10 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; + } + __Pyx_AddTraceback("collisions.Line.closestPointTo.lambda7", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_lambda_funcdef_lambda7(__pyx_self, __pyx_v_x); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_lambda7(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { + 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("lambda7", 1); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1129, __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("collisions.Line.closestPointTo.lambda7", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":1157 + * calculate(ln, self.p2, True) for ln in othershape.toLines() + * ] + * tries.sort(key=lambda x: x[1]) # <<<<<<<<<<<<<< + * if returnAll: + * return [i[0] for i in tries] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_4Line_14closestPointTo_5lambda8(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_10collisions_4Line_14closestPointTo_5lambda8 = {"lambda8", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_14closestPointTo_5lambda8, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_4Line_14closestPointTo_5lambda8(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_x = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda8 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1157, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda8") < 0)) __PYX_ERR(0, 1157, __pyx_L3_error) } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_2}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1103, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_x = values[0]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("lambda8", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1157, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; + } + __Pyx_AddTraceback("collisions.Line.closestPointTo.lambda8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_lambda_funcdef_lambda8(__pyx_self, __pyx_v_x); - /* "collisions.py":1102 - * elif checkShpType(othershape, ShpTyps.Circle): - * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< - * return self.closestPointTo(Point(*othershape.closestPointTo(self))) - * else: # Rects, Rotated rects and polygons + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_lambda8(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { + 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("lambda8", 1); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1157, __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("collisions.Line.closestPointTo.lambda8", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":1088 + * return othershape._where(self) + * + * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLike|Iterable[pointLike]: # <<<<<<<<<<<<<< + * """ + * Find the closest point ON this object TO another object. */ + +static PyObject *__pyx_pf_10collisions_4Line_26closestPointTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape, PyObject *__pyx_v_returnAll) { + struct __pyx_obj_10collisions___pyx_scope_struct_8_closestPointTo *__pyx_cur_scope; + PyObject *__pyx_v_dx = NULL; + PyObject *__pyx_v_dy = NULL; + PyObject *__pyx_v_det = NULL; + PyObject *__pyx_v_a = NULL; + PyObject *__pyx_v_p = NULL; + PyObject *__pyx_v_colls = NULL; + PyObject *__pyx_v_calculate = 0; + PyObject *__pyx_v_tries = NULL; + PyObject *__pyx_9genexpr15__pyx_v_i = NULL; + PyObject *__pyx_9genexpr16__pyx_v_p = NULL; + PyObject *__pyx_9genexpr17__pyx_v_ln = NULL; + PyObject *__pyx_9genexpr18__pyx_v_ln = NULL; + PyObject *__pyx_9genexpr19__pyx_v_i = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + unsigned int __pyx_t_5; + int __pyx_t_6; + long __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + Py_ssize_t __pyx_t_9; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *(*__pyx_t_12)(PyObject *); + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("closestPointTo", 0); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_8_closestPointTo *)__pyx_tp_new_10collisions___pyx_scope_struct_8_closestPointTo(__pyx_ptype_10collisions___pyx_scope_struct_8_closestPointTo, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_8_closestPointTo *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 1088, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } + __pyx_cur_scope->__pyx_v_self = __pyx_v_self; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); - /* "collisions.py":1105 - * return self.closestPointTo(Point(*othershape.closestPointTo(self))) - * else: # Rects, Rotated rects and polygons - * colls = self.whereCollides(othershape) # <<<<<<<<<<<<<< - * if colls != []: - * if returnAll: + /* "collisions.py":1099 + * pointLike / Iterable[pointLike]: The closest points ON this object TO the other object + * """ + * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< + * dx, dy = self.p2[0] - self.p1[0], self.p2[1] - self.p1[1] + * det = dx * dx + dy * dy */ - /*else*/ { - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_othershape}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1105, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1099, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1099, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1099, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (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); + __pyx_t_5 = 1; } - __pyx_v_colls = __pyx_t_4; - __pyx_t_4 = 0; + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_othershape, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1099, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1099, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { - /* "collisions.py":1106 - * else: # Rects, Rotated rects and polygons - * colls = self.whereCollides(othershape) - * if colls != []: # <<<<<<<<<<<<<< - * if returnAll: - * return colls + /* "collisions.py":1100 + * """ + * if checkShpType(othershape, ShpTyps.Point): + * dx, dy = self.p2[0] - self.p1[0], self.p2[1] - self.p1[1] # <<<<<<<<<<<<<< + * det = dx * dx + dy * dy + * if det == 0: */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1106, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_colls, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1106, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1106, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1100, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - - /* "collisions.py":1107 - * colls = self.whereCollides(othershape) - * if colls != []: - * if returnAll: # <<<<<<<<<<<<<< - * return colls - * return colls[0] - */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1107, __pyx_L1_error) - if (__pyx_t_6) { + __pyx_v_dx = __pyx_t_1; + __pyx_t_1 = 0; + __pyx_v_dy = __pyx_t_4; + __pyx_t_4 = 0; - /* "collisions.py":1108 - * if colls != []: - * if returnAll: - * return colls # <<<<<<<<<<<<<< - * return colls[0] - * def calculate(ln, point, recalculate): + /* "collisions.py":1101 + * if checkShpType(othershape, ShpTyps.Point): + * dx, dy = self.p2[0] - self.p1[0], self.p2[1] - self.p1[1] + * det = dx * dx + dy * dy # <<<<<<<<<<<<<< + * if det == 0: + * return self.p1 */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_colls); - __pyx_r = __pyx_v_colls; - goto __pyx_L0; + __pyx_t_4 = PyNumber_Multiply(__pyx_v_dx, __pyx_v_dx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyNumber_Multiply(__pyx_v_dy, __pyx_v_dy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1101, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_det = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":1107 - * colls = self.whereCollides(othershape) - * if colls != []: - * if returnAll: # <<<<<<<<<<<<<< - * return colls - * return colls[0] + /* "collisions.py":1102 + * dx, dy = self.p2[0] - self.p1[0], self.p2[1] - self.p1[1] + * det = dx * dx + dy * dy + * if det == 0: # <<<<<<<<<<<<<< + * return self.p1 + * a = (dy * (othershape[1] - self.p1[1]) + dx * (othershape[0] - self.p1[0])) / det */ - } + __pyx_t_6 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_det, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1102, __pyx_L1_error) + if (__pyx_t_6) { - /* "collisions.py":1109 - * if returnAll: - * return colls - * return colls[0] # <<<<<<<<<<<<<< - * def calculate(ln, point, recalculate): - * p2 = ln.closestPointTo(Point(*point)) + /* "collisions.py":1103 + * det = dx * dx + dy * dy + * if det == 0: + * return self.p1 # <<<<<<<<<<<<<< + * a = (dy * (othershape[1] - self.p1[1]) + dx * (othershape[0] - self.p1[0])) / det + * a = min(1, max(0, a)) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_colls, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1109, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1103, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":1106 - * else: # Rects, Rotated rects and polygons - * colls = self.whereCollides(othershape) - * if colls != []: # <<<<<<<<<<<<<< - * if returnAll: - * return colls + /* "collisions.py":1102 + * dx, dy = self.p2[0] - self.p1[0], self.p2[1] - self.p1[1] + * det = dx * dx + dy * dy + * if det == 0: # <<<<<<<<<<<<<< + * return self.p1 + * a = (dy * (othershape[1] - self.p1[1]) + dx * (othershape[0] - self.p1[0])) / det */ } - /* "collisions.py":1110 - * return colls - * return colls[0] - * def calculate(ln, point, recalculate): # <<<<<<<<<<<<<< - * p2 = ln.closestPointTo(Point(*point)) - * olineP = point + /* "collisions.py":1104 + * if det == 0: + * return self.p1 + * a = (dy * (othershape[1] - self.p1[1]) + dx * (othershape[0] - self.p1[0])) / det # <<<<<<<<<<<<<< + * a = min(1, max(0, a)) + * p = (self.p1[0] + a * dx, self.p1[1] + a * dy) */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_14closestPointTo_3calculate, 0, __pyx_n_s_Line_closestPointTo_locals_calcu, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1110, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_othershape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_v_calculate = __pyx_t_3; - __pyx_t_3 = 0; - - /* "collisions.py":1121 - * ] + [ - * calculate(ln, self.p1, True) for ln in othershape.toLines() - * ] + [ # <<<<<<<<<<<<<< - * calculate(ln, self.p2, True) for ln in othershape.toLines() - * ] - */ - { /* enter inner scope */ - - /* "collisions.py":1117 - * p2 = self.closestPointTo(Point(*p2)) - * return p2, abs(p2[0]-olineP[0])**2+abs(p2[1]-olineP[1])**2 - * tries = [ # <<<<<<<<<<<<<< - * calculate(self, p, False) for p in othershape.toPoints() - * ] + [ - */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1117, __pyx_L20_error) - __Pyx_GOTREF(__pyx_t_3); - - /* "collisions.py":1118 - * return p2, abs(p2[0]-olineP[0])**2+abs(p2[1]-olineP[1])**2 - * tries = [ - * calculate(self, p, False) for p in othershape.toPoints() # <<<<<<<<<<<<<< - * ] + [ - * calculate(ln, self.p1, True) for ln in othershape.toLines() - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1118, __pyx_L20_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1118, __pyx_L20_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { - __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); - __pyx_t_9 = 0; - __pyx_t_12 = NULL; - } else { - __pyx_t_9 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1118, __pyx_L20_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1118, __pyx_L20_error) - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - for (;;) { - if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1118, __pyx_L20_error) - #endif - if (__pyx_t_9 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1118, __pyx_L20_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1118, __pyx_L20_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1118, __pyx_L20_error) - #endif - if (__pyx_t_9 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1118, __pyx_L20_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1118, __pyx_L20_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } - } else { - __pyx_t_4 = __pyx_t_12(__pyx_t_2); - if (unlikely(!__pyx_t_4)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1118, __pyx_L20_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_XDECREF_SET(__pyx_9genexpr16__pyx_v_p, __pyx_t_4); - __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1118, __pyx_L20_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_self)) __PYX_ERR(0, 1118, __pyx_L20_error); - __Pyx_INCREF(__pyx_9genexpr16__pyx_v_p); - __Pyx_GIVEREF(__pyx_9genexpr16__pyx_v_p); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_9genexpr16__pyx_v_p)) __PYX_ERR(0, 1118, __pyx_L20_error); - __Pyx_INCREF(Py_False); - __Pyx_GIVEREF(Py_False); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, Py_False)) __PYX_ERR(0, 1118, __pyx_L20_error); - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_4, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1118, __pyx_L20_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 1117, __pyx_L20_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_p); __pyx_9genexpr16__pyx_v_p = 0; - goto __pyx_L24_exit_scope; - __pyx_L20_error:; - __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_p); __pyx_9genexpr16__pyx_v_p = 0; - goto __pyx_L1_error; - __pyx_L24_exit_scope:; - } /* exit inner scope */ - { /* enter inner scope */ - - /* "collisions.py":1119 - * tries = [ - * calculate(self, p, False) for p in othershape.toPoints() - * ] + [ # <<<<<<<<<<<<<< - * calculate(ln, self.p1, True) for ln in othershape.toLines() - * ] + [ - */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1119, __pyx_L27_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "collisions.py":1120 - * calculate(self, p, False) for p in othershape.toPoints() - * ] + [ - * calculate(ln, self.p1, True) for ln in othershape.toLines() # <<<<<<<<<<<<<< - * ] + [ - * calculate(ln, self.p2, True) for ln in othershape.toLines() - */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_toLines); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1120, __pyx_L27_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; - __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1120, __pyx_L27_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) { - __pyx_t_4 = __pyx_t_10; __Pyx_INCREF(__pyx_t_4); - __pyx_t_9 = 0; - __pyx_t_12 = NULL; - } else { - __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1120, __pyx_L27_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1120, __pyx_L27_error) - } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - for (;;) { - if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_4))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1120, __pyx_L27_error) - #endif - if (__pyx_t_9 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_10 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1120, __pyx_L27_error) - #else - __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1120, __pyx_L27_error) - __Pyx_GOTREF(__pyx_t_10); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1120, __pyx_L27_error) - #endif - if (__pyx_t_9 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1120, __pyx_L27_error) - #else - __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1120, __pyx_L27_error) - __Pyx_GOTREF(__pyx_t_10); - #endif - } - } else { - __pyx_t_10 = __pyx_t_12(__pyx_t_4); - if (unlikely(!__pyx_t_10)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1120, __pyx_L27_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_10); - } - __Pyx_XDECREF_SET(__pyx_9genexpr17__pyx_v_ln, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1120, __pyx_L27_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1120, __pyx_L27_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_INCREF(__pyx_9genexpr17__pyx_v_ln); - __Pyx_GIVEREF(__pyx_9genexpr17__pyx_v_ln); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_9genexpr17__pyx_v_ln)) __PYX_ERR(0, 1120, __pyx_L27_error); - __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10)) __PYX_ERR(0, 1120, __pyx_L27_error); - __Pyx_INCREF(Py_True); - __Pyx_GIVEREF(Py_True); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, Py_True)) __PYX_ERR(0, 1120, __pyx_L27_error); - __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_8, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1120, __pyx_L27_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 1119, __pyx_L27_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_ln); __pyx_9genexpr17__pyx_v_ln = 0; - goto __pyx_L31_exit_scope; - __pyx_L27_error:; - __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_ln); __pyx_9genexpr17__pyx_v_ln = 0; - goto __pyx_L1_error; - __pyx_L31_exit_scope:; - } /* exit inner scope */ - - /* "collisions.py":1119 - * tries = [ - * calculate(self, p, False) for p in othershape.toPoints() - * ] + [ # <<<<<<<<<<<<<< - * calculate(ln, self.p1, True) for ln in othershape.toLines() - * ] + [ - */ - __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1119, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Multiply(__pyx_v_dy, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1104, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_othershape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1104, __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; - { /* enter inner scope */ - - /* "collisions.py":1121 - * ] + [ - * calculate(ln, self.p1, True) for ln in othershape.toLines() - * ] + [ # <<<<<<<<<<<<<< - * calculate(ln, self.p2, True) for ln in othershape.toLines() - * ] - */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1121, __pyx_L34_error) - __Pyx_GOTREF(__pyx_t_2); - - /* "collisions.py":1122 - * calculate(ln, self.p1, True) for ln in othershape.toLines() - * ] + [ - * calculate(ln, self.p2, True) for ln in othershape.toLines() # <<<<<<<<<<<<<< - * ] - * tries.sort(key=lambda x: x[1]) - */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_toLines); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1122, __pyx_L34_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1122, __pyx_L34_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { - __pyx_t_10 = __pyx_t_3; __Pyx_INCREF(__pyx_t_10); - __pyx_t_9 = 0; - __pyx_t_12 = NULL; - } else { - __pyx_t_9 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1122, __pyx_L34_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1122, __pyx_L34_error) - } - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - for (;;) { - if (likely(!__pyx_t_12)) { - if (likely(PyList_CheckExact(__pyx_t_10))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1122, __pyx_L34_error) - #endif - if (__pyx_t_9 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1122, __pyx_L34_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1122, __pyx_L34_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_10); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1122, __pyx_L34_error) - #endif - if (__pyx_t_9 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1122, __pyx_L34_error) - #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1122, __pyx_L34_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - } - } else { - __pyx_t_3 = __pyx_t_12(__pyx_t_10); - if (unlikely(!__pyx_t_3)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1122, __pyx_L34_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_3); - } - __Pyx_XDECREF_SET(__pyx_9genexpr18__pyx_v_ln, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1122, __pyx_L34_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1122, __pyx_L34_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_INCREF(__pyx_9genexpr18__pyx_v_ln); - __Pyx_GIVEREF(__pyx_9genexpr18__pyx_v_ln); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_9genexpr18__pyx_v_ln)) __PYX_ERR(0, 1122, __pyx_L34_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3)) __PYX_ERR(0, 1122, __pyx_L34_error); - __Pyx_INCREF(Py_True); - __Pyx_GIVEREF(Py_True); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, Py_True)) __PYX_ERR(0, 1122, __pyx_L34_error); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1122, __pyx_L34_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1121, __pyx_L34_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_ln); __pyx_9genexpr18__pyx_v_ln = 0; - goto __pyx_L38_exit_scope; - __pyx_L34_error:; - __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_ln); __pyx_9genexpr18__pyx_v_ln = 0; - goto __pyx_L1_error; - __pyx_L38_exit_scope:; - } /* exit inner scope */ + __pyx_t_2 = PyNumber_Multiply(__pyx_v_dx, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_det); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1104, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_a = __pyx_t_2; + __pyx_t_2 = 0; - /* "collisions.py":1121 - * ] + [ - * calculate(ln, self.p1, True) for ln in othershape.toLines() - * ] + [ # <<<<<<<<<<<<<< - * calculate(ln, self.p2, True) for ln in othershape.toLines() - * ] + /* "collisions.py":1105 + * return self.p1 + * a = (dy * (othershape[1] - self.p1[1]) + dx * (othershape[0] - self.p1[0])) / det + * a = min(1, max(0, a)) # <<<<<<<<<<<<<< + * p = (self.p1[0] + a * dx, self.p1[1] + a * dy) + * if returnAll: */ - __pyx_t_10 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1121, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __Pyx_INCREF(__pyx_v_a); + __pyx_t_2 = __pyx_v_a; + __pyx_t_7 = 0; + __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1105, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1105, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __pyx_t_1; + __pyx_t_1 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_2 = __pyx_t_3; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_7 = 1; + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1105, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1105, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = __pyx_t_2; + } else { + __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1105, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __pyx_t_4; + __pyx_t_4 = 0; + } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_tries = ((PyObject*)__pyx_t_10); - __pyx_t_10 = 0; + __pyx_t_2 = __pyx_t_3; + __Pyx_INCREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_a, __pyx_t_2); + __pyx_t_2 = 0; - /* "collisions.py":1124 - * calculate(ln, self.p2, True) for ln in othershape.toLines() - * ] - * tries.sort(key=lambda x: x[1]) # <<<<<<<<<<<<<< + /* "collisions.py":1106 + * a = (dy * (othershape[1] - self.p1[1]) + dx * (othershape[0] - self.p1[0])) / det + * a = min(1, max(0, a)) + * p = (self.p1[0] + a * dx, self.p1[1] + a * dy) # <<<<<<<<<<<<<< * if returnAll: - * return [i[0] for i in tries] + * return [p] */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_tries, __pyx_n_s_sort); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1124, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_14closestPointTo_5lambda8, 0, __pyx_n_s_Line_closestPointTo_locals_lambd, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1124, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_t_4) < 0) __PYX_ERR(0, 1124, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1124, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Multiply(__pyx_v_a, __pyx_v_dx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Multiply(__pyx_v_a, __pyx_v_dy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1106, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 1106, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1106, __pyx_L1_error); + __pyx_t_4 = 0; + __pyx_t_1 = 0; + __pyx_v_p = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; - /* "collisions.py":1125 - * ] - * tries.sort(key=lambda x: x[1]) + /* "collisions.py":1107 + * a = min(1, max(0, a)) + * p = (self.p1[0] + a * dx, self.p1[1] + a * dy) * if returnAll: # <<<<<<<<<<<<<< - * return [i[0] for i in tries] - * return tries[0][0] + * return [p] + * return p */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1125, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1107, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":1126 - * tries.sort(key=lambda x: x[1]) + /* "collisions.py":1108 + * p = (self.p1[0] + a * dx, self.p1[1] + a * dy) * if returnAll: - * return [i[0] for i in tries] # <<<<<<<<<<<<<< - * return tries[0][0] - * + * return [p] # <<<<<<<<<<<<<< + * return p + * elif checkShpType(othershape, ShpTyps.Line): */ __Pyx_XDECREF(__pyx_r); - { /* enter inner scope */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1126, __pyx_L42_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __pyx_v_tries; __Pyx_INCREF(__pyx_t_2); - __pyx_t_9 = 0; - for (;;) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1126, __pyx_L42_error) - #endif - if (__pyx_t_9 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_10 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1126, __pyx_L42_error) - #else - __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1126, __pyx_L42_error) - __Pyx_GOTREF(__pyx_t_10); - #endif - __Pyx_XDECREF_SET(__pyx_9genexpr19__pyx_v_i, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_GetItemInt(__pyx_9genexpr19__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1126, __pyx_L42_error) - __Pyx_GOTREF(__pyx_t_10); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 1126, __pyx_L42_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_i); __pyx_9genexpr19__pyx_v_i = 0; - goto __pyx_L46_exit_scope; - __pyx_L42_error:; - __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_i); __pyx_9genexpr19__pyx_v_i = 0; - goto __pyx_L1_error; - __pyx_L46_exit_scope:; - } /* exit inner scope */ - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1108, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_p); + __Pyx_GIVEREF(__pyx_v_p); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_p)) __PYX_ERR(0, 1108, __pyx_L1_error); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1125 - * ] - * tries.sort(key=lambda x: x[1]) + /* "collisions.py":1107 + * a = min(1, max(0, a)) + * p = (self.p1[0] + a * dx, self.p1[1] + a * dy) * if returnAll: # <<<<<<<<<<<<<< - * return [i[0] for i in tries] - * return tries[0][0] + * return [p] + * return p */ } - /* "collisions.py":1127 + /* "collisions.py":1109 * if returnAll: - * return [i[0] for i in tries] - * return tries[0][0] # <<<<<<<<<<<<<< - * - * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: + * return [p] + * return p # <<<<<<<<<<<<<< + * elif checkShpType(othershape, ShpTyps.Line): + * colls = self.whereCollides(othershape) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_tries, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1127, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1127, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __Pyx_INCREF(__pyx_v_p); + __pyx_r = __pyx_v_p; goto __pyx_L0; - } - /* "collisions.py":1055 - * return othershape._where(self) - * - * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLike|Iterable[pointLike]: # <<<<<<<<<<<<<< + /* "collisions.py":1099 + * pointLike / Iterable[pointLike]: The closest points ON this object TO the other object * """ - * Find the closest point ON this object TO another object. + * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< + * dx, dy = self.p2[0] - self.p1[0], self.p2[1] - self.p1[1] + * det = dx * dx + dy * dy */ + } - /* function exit code */ - __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_8); - __Pyx_XDECREF(__pyx_t_10); - __Pyx_XDECREF(__pyx_t_11); - __Pyx_AddTraceback("collisions.Line.closestPointTo", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_dx); - __Pyx_XDECREF(__pyx_v_dy); - __Pyx_XDECREF(__pyx_v_det); - __Pyx_XDECREF(__pyx_v_a); - __Pyx_XDECREF(__pyx_v_p); - __Pyx_XDECREF(__pyx_v_colls); - __Pyx_XDECREF(__pyx_v_calculate); - __Pyx_XDECREF(__pyx_v_tries); - __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_i); - __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_p); - __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_ln); - __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_ln); - __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_i); - __Pyx_DECREF((PyObject *)__pyx_cur_scope); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "collisions.py":1129 - * return tries[0][0] - * - * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< - * """ - * Finds whether a point is on a corner of this shape. + /* "collisions.py":1110 + * return [p] + * return p + * elif checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< + * colls = self.whereCollides(othershape) + * if colls != []: */ - -static PyObject *__pyx_pf_10collisions_36__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { - PyObject *__pyx_r = NULL; - __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("__defaults__", 1); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1129, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_self)->__pyx_arg_precision); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_self)->__pyx_arg_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 1129, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1129, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1129, __pyx_L1_error); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 1129, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("collisions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_29isCorner(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_4Line_28isCorner, "\n Finds whether a point is on a corner of this shape.\n\n Args:\n point (pointLike): The point to find if it's a corner\n precision (Number, optional): The decimal places to round to to check. Defaults to 5.\n\n Returns:\n bool: Whether the point is on a corner of this shape\n "); -static PyMethodDef __pyx_mdef_10collisions_4Line_29isCorner = {"isCorner", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_29isCorner, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_28isCorner}; -static PyObject *__pyx_pw_10collisions_4Line_29isCorner(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_point = 0; - PyObject *__pyx_v_precision = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[3] = {0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("isCorner (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_point,&__pyx_n_s_precision,0}; - __pyx_defaults9 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_self); - values[2] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_precision); - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1129, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1129, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, 1); __PYX_ERR(0, 1129, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_precision); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1129, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isCorner") < 0)) __PYX_ERR(0, 1129, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_self = values[0]; - __pyx_v_point = values[1]; - __pyx_v_precision = values[2]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1129, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_5 = 1; } } - __Pyx_AddTraceback("collisions.Line.isCorner", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_28isCorner(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_precision); - - /* function exit code */ + #endif { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } + PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_othershape, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1110, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_6) { -/* "collisions.py":1140 - * bool: Whether the point is on a corner of this shape - * """ - * def rountTuple(x): # <<<<<<<<<<<<<< - * return (round(x[0], precision), round(x[1], precision)) - * return rountTuple(self.p1) == rountTuple(point) or rountTuple(self.p2) == rountTuple(point) + /* "collisions.py":1111 + * return p + * elif checkShpType(othershape, ShpTyps.Line): + * colls = self.whereCollides(othershape) # <<<<<<<<<<<<<< + * if colls != []: + * if returnAll: */ - -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_8isCorner_1rountTuple(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_4Line_8isCorner_1rountTuple = {"rountTuple", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_8isCorner_1rountTuple, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_4Line_8isCorner_1rountTuple(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_x = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("rountTuple (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1140, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rountTuple") < 0)) __PYX_ERR(0, 1140, __pyx_L3_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_5 = 1; } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_x = values[0]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rountTuple", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1140, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } - } - __Pyx_AddTraceback("collisions.Line.isCorner.rountTuple", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_8isCorner_rountTuple(__pyx_self, __pyx_v_x); - - /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_othershape}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10collisions_4Line_8isCorner_rountTuple(PyObject *__pyx_self, PyObject *__pyx_v_x) { - struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner *__pyx_cur_scope; - struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner *__pyx_outer_scope; - 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("rountTuple", 1); - __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner *) __Pyx_CyFunction_GetClosure(__pyx_self); - __pyx_cur_scope = __pyx_outer_scope; + __pyx_v_colls = __pyx_t_2; + __pyx_t_2 = 0; - /* "collisions.py":1141 - * """ - * def rountTuple(x): - * return (round(x[0], precision), round(x[1], precision)) # <<<<<<<<<<<<<< - * return rountTuple(self.p1) == rountTuple(point) or rountTuple(self.p2) == rountTuple(point) - * + /* "collisions.py":1112 + * elif checkShpType(othershape, ShpTyps.Line): + * colls = self.whereCollides(othershape) + * if colls != []: # <<<<<<<<<<<<<< + * if returnAll: + * return colls */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1141, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (unlikely(!__pyx_cur_scope->__pyx_v_precision)) { __Pyx_RaiseClosureNameError("precision"); __PYX_ERR(0, 1141, __pyx_L1_error) } - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1141, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1141, __pyx_L1_error); - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_precision); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_cur_scope->__pyx_v_precision)) __PYX_ERR(0, 1141, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1141, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1141, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_precision)) { __Pyx_RaiseClosureNameError("precision"); __PYX_ERR(0, 1141, __pyx_L1_error) } - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1141, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 1141, __pyx_L1_error); - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_precision); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_cur_scope->__pyx_v_precision)) __PYX_ERR(0, 1141, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1141, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1141, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 1141, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 1141, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_2 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyObject_RichCompare(__pyx_v_colls, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1112, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1112, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { - /* "collisions.py":1140 - * bool: Whether the point is on a corner of this shape - * """ - * def rountTuple(x): # <<<<<<<<<<<<<< - * return (round(x[0], precision), round(x[1], precision)) - * return rountTuple(self.p1) == rountTuple(point) or rountTuple(self.p2) == rountTuple(point) + /* "collisions.py":1113 + * colls = self.whereCollides(othershape) + * if colls != []: + * if returnAll: # <<<<<<<<<<<<<< + * return colls + * return colls[0] */ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1113, __pyx_L1_error) + if (__pyx_t_6) { - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_AddTraceback("collisions.Line.isCorner.rountTuple", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "collisions.py":1129 - * return tries[0][0] - * - * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< - * """ - * Finds whether a point is on a corner of this shape. + /* "collisions.py":1114 + * if colls != []: + * if returnAll: + * return colls # <<<<<<<<<<<<<< + * return colls[0] + * def calculate(ln, point, recalculate): */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_colls); + __pyx_r = __pyx_v_colls; + goto __pyx_L0; -static PyObject *__pyx_pf_10collisions_4Line_28isCorner(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_precision) { - struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner *__pyx_cur_scope; - PyObject *__pyx_v_rountTuple = 0; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("isCorner", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner *)__pyx_tp_new_10collisions___pyx_scope_struct_8_isCorner(__pyx_ptype_10collisions___pyx_scope_struct_8_isCorner, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1129, __pyx_L1_error) - } else { - __Pyx_GOTREF((PyObject *)__pyx_cur_scope); - } - __pyx_cur_scope->__pyx_v_precision = __pyx_v_precision; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_precision); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_precision); + /* "collisions.py":1113 + * colls = self.whereCollides(othershape) + * if colls != []: + * if returnAll: # <<<<<<<<<<<<<< + * return colls + * return colls[0] + */ + } - /* "collisions.py":1140 - * bool: Whether the point is on a corner of this shape - * """ - * def rountTuple(x): # <<<<<<<<<<<<<< - * return (round(x[0], precision), round(x[1], precision)) - * return rountTuple(self.p1) == rountTuple(point) or rountTuple(self.p2) == rountTuple(point) + /* "collisions.py":1115 + * if returnAll: + * return colls + * return colls[0] # <<<<<<<<<<<<<< + * def calculate(ln, point, recalculate): + * p2 = ln.closestPointTo(Point(*point)) */ - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_8isCorner_1rountTuple, 0, __pyx_n_s_Line_isCorner_locals_rountTuple, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1140, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_rountTuple = __pyx_t_1; - __pyx_t_1 = 0; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_colls, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1115, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; - /* "collisions.py":1142 - * def rountTuple(x): - * return (round(x[0], precision), round(x[1], precision)) - * return rountTuple(self.p1) == rountTuple(point) or rountTuple(self.p2) == rountTuple(point) # <<<<<<<<<<<<<< - * - * def tangent(self, point: pointLike, vel: pointLike) -> Number: + /* "collisions.py":1112 + * elif checkShpType(othershape, ShpTyps.Line): + * colls = self.whereCollides(othershape) + * if colls != []: # <<<<<<<<<<<<<< + * if returnAll: + * return colls */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1142, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __pyx_pf_10collisions_4Line_8isCorner_rountTuple(__pyx_v_rountTuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1142, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_pf_10collisions_4Line_8isCorner_rountTuple(__pyx_v_rountTuple, __pyx_v_point); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1142, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1142, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1142, __pyx_L1_error) - if (!__pyx_t_5) { - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } else { - __Pyx_INCREF(__pyx_t_4); - __pyx_t_1 = __pyx_t_4; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - goto __pyx_L3_bool_binop_done; - } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1142, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __pyx_pf_10collisions_4Line_8isCorner_rountTuple(__pyx_v_rountTuple, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1142, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __pyx_pf_10collisions_4Line_8isCorner_rountTuple(__pyx_v_rountTuple, __pyx_v_point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1142, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1142, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_INCREF(__pyx_t_3); - __pyx_t_1 = __pyx_t_3; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_L3_bool_binop_done:; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + } - /* "collisions.py":1129 - * return tries[0][0] - * - * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< - * """ - * Finds whether a point is on a corner of this shape. + /* "collisions.py":1116 + * return colls + * return colls[0] + * def calculate(ln, point, recalculate): # <<<<<<<<<<<<<< + * p2 = ln.closestPointTo(Point(*point)) + * olineP = point */ + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_14closestPointTo_1calculate, 0, __pyx_n_s_Line_closestPointTo_locals_calcu, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_calculate = __pyx_t_1; + __pyx_t_1 = 0; - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("collisions.Line.isCorner", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_rountTuple); - __Pyx_DECREF((PyObject *)__pyx_cur_scope); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "collisions.py":1144 - * return rountTuple(self.p1) == rountTuple(point) or rountTuple(self.p2) == rountTuple(point) - * - * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< - * """ - * Finds the tangent on this surface to a point with a given velocity. + /* "collisions.py":1124 + * return p2, abs(p2[0]-olineP[0])**2+abs(p2[1]-olineP[1])**2 + * tries = [ + * calculate(self, othershape.p1, False), # <<<<<<<<<<<<<< + * calculate(self, othershape.p2, False), + * calculate(othershape, self.p1, True), */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_self)) __PYX_ERR(0, 1124, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error); + __Pyx_INCREF(Py_False); + __Pyx_GIVEREF(Py_False); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, Py_False)) __PYX_ERR(0, 1124, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1124, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_31tangent(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_4Line_30tangent, "\n Finds the tangent on this surface to a point with a given velocity.\n\n Args:\n point (pointLike): The point to find the tangent of this surface from.\n vel (pointLike): Which direction the point is moving. In this case (for lines) it is actually very important, so please don't forget it.\n\n Returns:\n Number: The tangent of the line at the point. You can -90 to get the normal.\n "); -static PyMethodDef __pyx_mdef_10collisions_4Line_31tangent = {"tangent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_31tangent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_30tangent}; -static PyObject *__pyx_pw_10collisions_4Line_31tangent(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_point = 0; - PyObject *__pyx_v_vel = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[3] = {0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("tangent (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_point,&__pyx_n_s_vel,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1144, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1144, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 1); __PYX_ERR(0, 1144, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vel)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1144, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 2); __PYX_ERR(0, 1144, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tangent") < 0)) __PYX_ERR(0, 1144, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 3)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - } - __pyx_v_self = values[0]; - __pyx_v_point = values[1]; - __pyx_v_vel = values[2]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1144, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("collisions.Line.tangent", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_30tangent(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_vel); - - /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "collisions.py":1159 - * elif point == self.p2: - * return math.degrees(math.atan2(self.p1[1] - self.p2[1], self.p1[0] - self.p2[0])) - * def fixangle(angle): # <<<<<<<<<<<<<< - * angle = angle % 360 - * if angle > 180: + /* "collisions.py":1125 + * tries = [ + * calculate(self, othershape.p1, False), + * calculate(self, othershape.p2, False), # <<<<<<<<<<<<<< + * calculate(othershape, self.p1, True), + * calculate(othershape, self.p2, True), */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_self)) __PYX_ERR(0, 1125, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 1125, __pyx_L1_error); + __Pyx_INCREF(Py_False); + __Pyx_GIVEREF(Py_False); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, Py_False)) __PYX_ERR(0, 1125, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_7tangent_1fixangle(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_4Line_7tangent_1fixangle = {"fixangle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_7tangent_1fixangle, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_4Line_7tangent_1fixangle(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_angle = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("fixangle (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_angle,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_angle)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1159, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fixangle") < 0)) __PYX_ERR(0, 1159, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_angle = values[0]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("fixangle", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1159, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("collisions.Line.tangent.fixangle", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_7tangent_fixangle(__pyx_self, __pyx_v_angle); - - /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_pf_10collisions_4Line_7tangent_fixangle(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_angle) { - 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("fixangle", 0); - __Pyx_INCREF(__pyx_v_angle); - - /* "collisions.py":1160 - * return math.degrees(math.atan2(self.p1[1] - self.p2[1], self.p1[0] - self.p2[0])) - * def fixangle(angle): - * angle = angle % 360 # <<<<<<<<<<<<<< - * if angle > 180: - * angle = angle - 360 + /* "collisions.py":1126 + * calculate(self, othershape.p1, False), + * calculate(self, othershape.p2, False), + * calculate(othershape, self.p1, True), # <<<<<<<<<<<<<< + * calculate(othershape, self.p2, True), + * ] */ - __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_v_angle, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1160, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_angle, __pyx_t_1); - __pyx_t_1 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_othershape); + __Pyx_GIVEREF(__pyx_v_othershape); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_othershape)) __PYX_ERR(0, 1126, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 1126, __pyx_L1_error); + __Pyx_INCREF(Py_True); + __Pyx_GIVEREF(Py_True); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, Py_True)) __PYX_ERR(0, 1126, __pyx_L1_error); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1126, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":1161 - * def fixangle(angle): - * angle = angle % 360 - * if angle > 180: # <<<<<<<<<<<<<< - * angle = angle - 360 - * return abs(angle) # Because we don't need to use this for anything else + /* "collisions.py":1127 + * calculate(self, othershape.p2, False), + * calculate(othershape, self.p1, True), + * calculate(othershape, self.p2, True), # <<<<<<<<<<<<<< + * ] + * tries.sort(key=lambda x: x[1]) */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_angle, __pyx_int_180, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1161, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1161, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_2) { + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_v_othershape); + __Pyx_GIVEREF(__pyx_v_othershape); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_othershape)) __PYX_ERR(0, 1127, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_4)) __PYX_ERR(0, 1127, __pyx_L1_error); + __Pyx_INCREF(Py_True); + __Pyx_GIVEREF(Py_True); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, Py_True)) __PYX_ERR(0, 1127, __pyx_L1_error); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1162 - * angle = angle % 360 - * if angle > 180: - * angle = angle - 360 # <<<<<<<<<<<<<< - * return abs(angle) # Because we don't need to use this for anything else - * toDeg = (math.degrees(math.atan2(vel[1], vel[0]))-180) % 360 + /* "collisions.py":1123 + * p2 = self.closestPointTo(Point(*p2)) + * return p2, abs(p2[0]-olineP[0])**2+abs(p2[1]-olineP[1])**2 + * tries = [ # <<<<<<<<<<<<<< + * calculate(self, othershape.p1, False), + * calculate(self, othershape.p2, False), */ - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_angle, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1162, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF_SET(__pyx_v_angle, __pyx_t_1); + __pyx_t_8 = PyList_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1123, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_1)) __PYX_ERR(0, 1123, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_2)) __PYX_ERR(0, 1123, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 2, __pyx_t_3)) __PYX_ERR(0, 1123, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 3, __pyx_t_4)) __PYX_ERR(0, 1123, __pyx_L1_error); __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_4 = 0; + __pyx_v_tries = ((PyObject*)__pyx_t_8); + __pyx_t_8 = 0; - /* "collisions.py":1161 - * def fixangle(angle): - * angle = angle % 360 - * if angle > 180: # <<<<<<<<<<<<<< - * angle = angle - 360 - * return abs(angle) # Because we don't need to use this for anything else + /* "collisions.py":1129 + * calculate(othershape, self.p2, True), + * ] + * tries.sort(key=lambda x: x[1]) # <<<<<<<<<<<<<< + * if returnAll: + * return [i[0] for i in tries] */ - } + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_tries, __pyx_n_s_sort); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_14closestPointTo_4lambda7, 0, __pyx_n_s_Line_closestPointTo_locals_lambd, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_key, __pyx_t_3) < 0) __PYX_ERR(0, 1129, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1163 - * if angle > 180: - * angle = angle - 360 - * return abs(angle) # Because we don't need to use this for anything else # <<<<<<<<<<<<<< - * toDeg = (math.degrees(math.atan2(vel[1], vel[0]))-180) % 360 - * phi = (math.degrees(math.atan2(self.p2[1] - self.p1[1], self.p2[0] - self.p1[0]))-90) + /* "collisions.py":1130 + * ] + * tries.sort(key=lambda x: x[1]) + * if returnAll: # <<<<<<<<<<<<<< + * return [i[0] for i in tries] + * return tries[0][0] */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_v_angle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1163, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1130, __pyx_L1_error) + if (__pyx_t_6) { - /* "collisions.py":1159 - * elif point == self.p2: - * return math.degrees(math.atan2(self.p1[1] - self.p2[1], self.p1[0] - self.p2[0])) - * def fixangle(angle): # <<<<<<<<<<<<<< - * angle = angle % 360 - * if angle > 180: + /* "collisions.py":1131 + * tries.sort(key=lambda x: x[1]) + * if returnAll: + * return [i[0] for i in tries] # <<<<<<<<<<<<<< + * return tries[0][0] + * elif checkShpType(othershape, ShpTyps.Circle): */ + __Pyx_XDECREF(__pyx_r); + { /* enter inner scope */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1131, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __pyx_v_tries; __Pyx_INCREF(__pyx_t_4); + __pyx_t_9 = 0; + for (;;) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1131, __pyx_L11_error) + #endif + if (__pyx_t_9 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_8); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1131, __pyx_L11_error) + #else + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1131, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_8); + #endif + __Pyx_XDECREF_SET(__pyx_9genexpr15__pyx_v_i, __pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_GetItemInt(__pyx_9genexpr15__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1131, __pyx_L11_error) + __Pyx_GOTREF(__pyx_t_8); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 1131, __pyx_L11_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_i); __pyx_9genexpr15__pyx_v_i = 0; + goto __pyx_L15_exit_scope; + __pyx_L11_error:; + __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_i); __pyx_9genexpr15__pyx_v_i = 0; + goto __pyx_L1_error; + __pyx_L15_exit_scope:; + } /* exit inner scope */ + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("collisions.Line.tangent.fixangle", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_angle); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "collisions.py":1130 + * ] + * tries.sort(key=lambda x: x[1]) + * if returnAll: # <<<<<<<<<<<<<< + * return [i[0] for i in tries] + * return tries[0][0] + */ + } -/* "collisions.py":1144 - * return rountTuple(self.p1) == rountTuple(point) or rountTuple(self.p2) == rountTuple(point) - * - * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< - * """ - * Finds the tangent on this surface to a point with a given velocity. + /* "collisions.py":1132 + * if returnAll: + * return [i[0] for i in tries] + * return tries[0][0] # <<<<<<<<<<<<<< + * elif checkShpType(othershape, ShpTyps.Circle): + * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_tries, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; -static PyObject *__pyx_pf_10collisions_4Line_30tangent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_vel) { - PyObject *__pyx_v_fixangle = 0; - PyObject *__pyx_v_toDeg = NULL; - PyObject *__pyx_v_phi = NULL; - PyObject *__pyx_v_tries = NULL; - 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; - PyObject *__pyx_t_5 = NULL; - PyObject *__pyx_t_6 = NULL; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - unsigned int __pyx_t_10; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("tangent", 1); + /* "collisions.py":1110 + * return [p] + * return p + * elif checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< + * colls = self.whereCollides(othershape) + * if colls != []: + */ + } - /* "collisions.py":1155 - * Number: The tangent of the line at the point. You can -90 to get the normal. - * """ - * if point == self.p1: # <<<<<<<<<<<<<< - * return math.degrees(math.atan2(self.p2[1] - self.p1[1], self.p2[0] - self.p1[0])) - * elif point == self.p2: + /* "collisions.py":1133 + * return [i[0] for i in tries] + * return tries[0][0] + * elif checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< + * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) + * elif checkShpType(othershape, ShpTyps.Arc): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1155, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_point, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1155, __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_ERR(0, 1155, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_3) { + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_Circle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_othershape, __pyx_t_2}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1133, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1133, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { - /* "collisions.py":1156 - * """ - * if point == self.p1: - * return math.degrees(math.atan2(self.p2[1] - self.p1[1], self.p2[0] - self.p1[0])) # <<<<<<<<<<<<<< - * elif point == self.p2: - * return math.degrees(math.atan2(self.p1[1] - self.p2[1], self.p1[0] - self.p2[0])) + /* "collisions.py":1134 + * return tries[0][0] + * elif checkShpType(othershape, ShpTyps.Circle): + * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) # <<<<<<<<<<<<<< + * elif checkShpType(othershape, ShpTyps.Arc): + * return self.closestPointTo(Point(*othershape.closestPointTo(self))) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_degrees); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_atan2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Subtract(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Subtract(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1156, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Point); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = NULL; - __pyx_t_10 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = NULL; + __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_9); + if (unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_10 = 1; + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_5, __pyx_t_8}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_1, __pyx_t_10}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_6 = NULL; - __pyx_t_10 = 0; + __pyx_t_8 = NULL; + __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_6); + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_10 = 1; + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_1}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1156, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_2, __pyx_v_returnAll}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1134, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":1155 - * Number: The tangent of the line at the point. You can -90 to get the normal. - * """ - * if point == self.p1: # <<<<<<<<<<<<<< - * return math.degrees(math.atan2(self.p2[1] - self.p1[1], self.p2[0] - self.p1[0])) - * elif point == self.p2: + /* "collisions.py":1133 + * return [i[0] for i in tries] + * return tries[0][0] + * elif checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< + * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) + * elif checkShpType(othershape, ShpTyps.Arc): */ } - /* "collisions.py":1157 - * if point == self.p1: - * return math.degrees(math.atan2(self.p2[1] - self.p1[1], self.p2[0] - self.p1[0])) - * elif point == self.p2: # <<<<<<<<<<<<<< - * return math.degrees(math.atan2(self.p1[1] - self.p2[1], self.p1[0] - self.p2[0])) - * def fixangle(angle): + /* "collisions.py":1135 + * elif checkShpType(othershape, ShpTyps.Circle): + * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) + * elif checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< + * return self.closestPointTo(Point(*othershape.closestPointTo(self))) + * else: # Rects, Rotated rects and polygons */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1157, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1135, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_point, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1157, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Arc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1157, __pyx_L1_error) + __pyx_t_2 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_othershape, __pyx_t_8}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1135, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1135, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_3) { + if (__pyx_t_6) { - /* "collisions.py":1158 - * return math.degrees(math.atan2(self.p2[1] - self.p1[1], self.p2[0] - self.p1[0])) - * elif point == self.p2: - * return math.degrees(math.atan2(self.p1[1] - self.p2[1], self.p1[0] - self.p2[0])) # <<<<<<<<<<<<<< - * def fixangle(angle): - * angle = angle % 360 + /* "collisions.py":1136 + * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) + * elif checkShpType(othershape, ShpTyps.Arc): + * return self.closestPointTo(Point(*othershape.closestPointTo(self))) # <<<<<<<<<<<<<< + * else: # Rects, Rotated rects and polygons + * colls = self.whereCollides(othershape) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_degrees); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_math); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_atan2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1158, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Point); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Subtract(__pyx_t_5, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_9, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_9, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Subtract(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1158, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = NULL; - __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_1 = NULL; + __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_7); + if (likely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_10); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_10 = 1; + __Pyx_DECREF_SET(__pyx_t_10, function); + __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, __pyx_t_9}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1158, __pyx_L1_error) + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_cur_scope->__pyx_v_self}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } - __pyx_t_8 = NULL; - __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1136, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = NULL; + __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_8); + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_10); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_10 = 1; + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_2}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_2}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1158, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":1157 - * if point == self.p1: - * return math.degrees(math.atan2(self.p2[1] - self.p1[1], self.p2[0] - self.p1[0])) - * elif point == self.p2: # <<<<<<<<<<<<<< - * return math.degrees(math.atan2(self.p1[1] - self.p2[1], self.p1[0] - self.p2[0])) - * def fixangle(angle): + /* "collisions.py":1135 + * elif checkShpType(othershape, ShpTyps.Circle): + * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) + * elif checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< + * return self.closestPointTo(Point(*othershape.closestPointTo(self))) + * else: # Rects, Rotated rects and polygons */ } - /* "collisions.py":1159 - * elif point == self.p2: - * return math.degrees(math.atan2(self.p1[1] - self.p2[1], self.p1[0] - self.p2[0])) - * def fixangle(angle): # <<<<<<<<<<<<<< - * angle = angle % 360 - * if angle > 180: - */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_7tangent_1fixangle, 0, __pyx_n_s_Line_tangent_locals_fixangle, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_v_fixangle = __pyx_t_4; - __pyx_t_4 = 0; - - /* "collisions.py":1164 - * angle = angle - 360 - * return abs(angle) # Because we don't need to use this for anything else - * toDeg = (math.degrees(math.atan2(vel[1], vel[0]))-180) % 360 # <<<<<<<<<<<<<< - * phi = (math.degrees(math.atan2(self.p2[1] - self.p1[1], self.p2[0] - self.p1[0]))-90) - * tries = [fixangle(phi-toDeg), fixangle(phi-toDeg-180)] + /* "collisions.py":1138 + * return self.closestPointTo(Point(*othershape.closestPointTo(self))) + * else: # Rects, Rotated rects and polygons + * colls = self.whereCollides(othershape) # <<<<<<<<<<<<<< + * if colls != []: + * if returnAll: */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_degrees); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_math); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_atan2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = NULL; - __pyx_t_10 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - __pyx_t_10 = 1; + /*else*/ { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_8, __pyx_t_6}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __pyx_t_9 = NULL; - __pyx_t_10 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_10 = 1; + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_othershape}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1138, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_1}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_4, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_RemainderObjC(__pyx_t_2, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1164, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_toDeg = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_v_colls = __pyx_t_4; + __pyx_t_4 = 0; - /* "collisions.py":1165 - * return abs(angle) # Because we don't need to use this for anything else - * toDeg = (math.degrees(math.atan2(vel[1], vel[0]))-180) % 360 - * phi = (math.degrees(math.atan2(self.p2[1] - self.p1[1], self.p2[0] - self.p1[0]))-90) # <<<<<<<<<<<<<< - * tries = [fixangle(phi-toDeg), fixangle(phi-toDeg-180)] - * return [(phi-180)%360, phi % 360][tries.index(min(tries))] + /* "collisions.py":1139 + * else: # Rects, Rotated rects and polygons + * colls = self.whereCollides(othershape) + * if colls != []: # <<<<<<<<<<<<<< + * if returnAll: + * return colls */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_degrees); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_math); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_atan2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_9, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_9, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Subtract(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Subtract(__pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = NULL; - __pyx_t_10 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - __pyx_t_10 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_9, __pyx_t_7}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } - __pyx_t_6 = NULL; - __pyx_t_10 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_10 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_2}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1165, __pyx_L1_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_4, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1165, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_phi = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_3 = PyObject_RichCompare(__pyx_v_colls, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1139, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1139, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { - /* "collisions.py":1166 - * toDeg = (math.degrees(math.atan2(vel[1], vel[0]))-180) % 360 - * phi = (math.degrees(math.atan2(self.p2[1] - self.p1[1], self.p2[0] - self.p1[0]))-90) - * tries = [fixangle(phi-toDeg), fixangle(phi-toDeg-180)] # <<<<<<<<<<<<<< - * return [(phi-180)%360, phi % 360][tries.index(min(tries))] - * + /* "collisions.py":1140 + * colls = self.whereCollides(othershape) + * if colls != []: + * if returnAll: # <<<<<<<<<<<<<< + * return colls + * return colls[0] */ - __pyx_t_1 = PyNumber_Subtract(__pyx_v_phi, __pyx_v_toDeg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1166, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __pyx_pf_10collisions_4Line_7tangent_fixangle(__pyx_v_fixangle, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1166, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Subtract(__pyx_v_phi, __pyx_v_toDeg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1166, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_1, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1166, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_pf_10collisions_4Line_7tangent_fixangle(__pyx_v_fixangle, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1166, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1166, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 1166, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1166, __pyx_L1_error); - __pyx_t_4 = 0; - __pyx_t_1 = 0; - __pyx_v_tries = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1140, __pyx_L1_error) + if (__pyx_t_6) { - /* "collisions.py":1167 - * phi = (math.degrees(math.atan2(self.p2[1] - self.p1[1], self.p2[0] - self.p1[0]))-90) - * tries = [fixangle(phi-toDeg), fixangle(phi-toDeg-180)] - * return [(phi-180)%360, phi % 360][tries.index(min(tries))] # <<<<<<<<<<<<<< - * - * def handleCollisionsPos(self, + /* "collisions.py":1141 + * if colls != []: + * if returnAll: + * return colls # <<<<<<<<<<<<<< + * return colls[0] + * def calculate(ln, point, recalculate): */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_phi, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_t_2, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_v_phi, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 1167, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 1167, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_v_tries); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyList_Type_index, __pyx_v_tries, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1167, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_colls); + __pyx_r = __pyx_v_colls; + goto __pyx_L0; - /* "collisions.py":1144 - * return rountTuple(self.p1) == rountTuple(point) or rountTuple(self.p2) == rountTuple(point) - * - * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< - * """ - * Finds the tangent on this surface to a point with a given velocity. + /* "collisions.py":1140 + * colls = self.whereCollides(othershape) + * if colls != []: + * if returnAll: # <<<<<<<<<<<<<< + * return colls + * return colls[0] */ + } - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_XDECREF(__pyx_t_7); - __Pyx_XDECREF(__pyx_t_8); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("collisions.Line.tangent", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_fixangle); - __Pyx_XDECREF(__pyx_v_toDeg); - __Pyx_XDECREF(__pyx_v_phi); - __Pyx_XDECREF(__pyx_v_tries); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "collisions.py":1169 - * return [(phi-180)%360, phi % 360][tries.index(min(tries))] - * - * def handleCollisionsPos(self, # <<<<<<<<<<<<<< - * oldLine: 'Line', - * newLine: 'Line', + /* "collisions.py":1142 + * if returnAll: + * return colls + * return colls[0] # <<<<<<<<<<<<<< + * def calculate(ln, point, recalculate): + * p2 = ln.closestPointTo(Point(*point)) */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_colls, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1142, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; -static PyObject *__pyx_pf_10collisions_38__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { - PyObject *__pyx_r = NULL; - __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("__defaults__", 1); - __Pyx_XDECREF(__pyx_r); + /* "collisions.py":1139 + * else: # Rects, Rotated rects and polygons + * colls = self.whereCollides(othershape) + * if colls != []: # <<<<<<<<<<<<<< + * if returnAll: + * return colls + */ + } - /* "collisions.py":1176 - * replaceSelf: bool = True, - * precision: Number = BASEPRECISION, - * verbose: bool = False # <<<<<<<<<<<<<< - * ) -> tuple['Line', pointLike, verboseOutput]: - * """ + /* "collisions.py":1143 + * return colls + * return colls[0] + * def calculate(ln, point, recalculate): # <<<<<<<<<<<<<< + * p2 = ln.closestPointTo(Point(*point)) + * olineP = point */ - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self)->__pyx_arg_vel); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self)->__pyx_arg_vel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self)->__pyx_arg_vel)) __PYX_ERR(0, 1169, __pyx_L1_error); - __Pyx_INCREF(((PyObject *)Py_True)); - __Pyx_GIVEREF(((PyObject *)Py_True)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_True))) __PYX_ERR(0, 1169, __pyx_L1_error); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self)->__pyx_arg_precision); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self)->__pyx_arg_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 1169, __pyx_L1_error); - __Pyx_INCREF(((PyObject *)Py_False)); - __Pyx_GIVEREF(((PyObject *)Py_False)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)Py_False))) __PYX_ERR(0, 1169, __pyx_L1_error); + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_14closestPointTo_3calculate, 0, __pyx_n_s_Line_closestPointTo_locals_calcu, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1143, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_calculate = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":1169 - * return [(phi-180)%360, phi % 360][tries.index(min(tries))] - * - * def handleCollisionsPos(self, # <<<<<<<<<<<<<< - * oldLine: 'Line', - * newLine: 'Line', + /* "collisions.py":1154 + * ] + [ + * calculate(ln, self.p1, True) for ln in othershape.toLines() + * ] + [ # <<<<<<<<<<<<<< + * calculate(ln, self.p2, True) for ln in othershape.toLines() + * ] */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1169, __pyx_L1_error); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 1169, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; + { /* enter inner scope */ - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("collisions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "collisions.py":1150 + * p2 = self.closestPointTo(Point(*p2)) + * return p2, abs(p2[0]-olineP[0])**2+abs(p2[1]-olineP[1])**2 + * tries = [ # <<<<<<<<<<<<<< + * calculate(self, p, False) for p in othershape.toPoints() + * ] + [ + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1150, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_3); -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_33handleCollisionsPos(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_4Line_32handleCollisionsPos, "\n Handles movement of this line and it bouncing off of other objects.\n It is recommended you use `.handleCollisionsVel` instead of this, as it handles velocity instead of raw movement and is easier to use.\n\n But if you are to use this, remember to still provide the vel param. It will provide VERY weird results if you don't.\n It could even just be the difference in positions, it just needs to be something realistic.\n\n Args:\n oldLine (Line): The old Line object.\n newLine (Line): The new Line object. Should be the exact same as the old one except with the 2 points offset by the same amount.\n objs (Shapes / Iterable[Shape]): The objects this will bounce off.\n vel (pointLike, optional): The velocity that this object is going. Defaults to [0, 0].\n replaceSelf (bool, optional): Whether to move this Line to the new position after bouncing or not. Defaults to True.\n precision (Number, optional): The decimal places to round to to check (for things like corner checking). Defaults to 5.\n verbose (bool, optional): Whether to give verbose output or not. Defaults to False.\n\n Returns:\n tuple[Line, pointLike, veboseOutput?]: The new Line object and vel of this object respectively, and if verbose then the verboseOutput.\n \n VerboseOutput:\n CollisionType (list[int, ...] / None): The type of collision that occured for each sub-collision (if it ever collided, that is)\n DidReflect (bool): Whether the line reflected off of something\n "); -static PyMethodDef __pyx_mdef_10collisions_4Line_33handleCollisionsPos = {"handleCollisionsPos", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_33handleCollisionsPos, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_32handleCollisionsPos}; -static PyObject *__pyx_pw_10collisions_4Line_33handleCollisionsPos(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_oldLine = 0; - PyObject *__pyx_v_newLine = 0; - PyObject *__pyx_v_objs = 0; - PyObject *__pyx_v_vel = 0; - PyObject *__pyx_v_replaceSelf = 0; - PyObject *__pyx_v_precision = 0; - PyObject *__pyx_v_verbose = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[8] = {0,0,0,0,0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("handleCollisionsPos (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_oldLine,&__pyx_n_s_newLine,&__pyx_n_s_objs,&__pyx_n_s_vel,&__pyx_n_s_replaceSelf,&__pyx_n_s_precision,&__pyx_n_s_verbose,0}; - __pyx_defaults10 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self); - values[4] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_vel); - values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); - values[6] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_precision); - values[7] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - CYTHON_FALLTHROUGH; - case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - CYTHON_FALLTHROUGH; - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1169, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_oldLine)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1169, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 1); __PYX_ERR(0, 1169, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_newLine)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1169, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 2); __PYX_ERR(0, 1169, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_objs)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1169, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 3); __PYX_ERR(0, 1169, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vel); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1169, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 5: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_replaceSelf); - if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1169, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 6: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_precision); - if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1169, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 7: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_verbose); - if (value) { values[7] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1169, __pyx_L3_error) + /* "collisions.py":1151 + * return p2, abs(p2[0]-olineP[0])**2+abs(p2[1]-olineP[1])**2 + * tries = [ + * calculate(self, p, False) for p in othershape.toPoints() # <<<<<<<<<<<<<< + * ] + [ + * calculate(ln, self.p1, True) for ln in othershape.toLines() + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1151, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_10 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_10)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_10); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; } } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "handleCollisionsPos") < 0)) __PYX_ERR(0, 1169, __pyx_L3_error) + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1151, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - } else { - switch (__pyx_nargs) { - case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - CYTHON_FALLTHROUGH; - case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - CYTHON_FALLTHROUGH; - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; + if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { + __pyx_t_2 = __pyx_t_4; __Pyx_INCREF(__pyx_t_2); + __pyx_t_9 = 0; + __pyx_t_12 = NULL; + } else { + __pyx_t_9 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1151, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1151, __pyx_L20_error) } - } - __pyx_v_self = values[0]; - __pyx_v_oldLine = values[1]; - __pyx_v_newLine = values[2]; - __pyx_v_objs = values[3]; - __pyx_v_vel = values[4]; - __pyx_v_replaceSelf = values[5]; - __pyx_v_precision = values[6]; - __pyx_v_verbose = values[7]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, __pyx_nargs); __PYX_ERR(0, 1169, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("collisions.Line.handleCollisionsPos", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_32handleCollisionsPos(__pyx_self, __pyx_v_self, __pyx_v_oldLine, __pyx_v_newLine, __pyx_v_objs, __pyx_v_vel, __pyx_v_replaceSelf, __pyx_v_precision, __pyx_v_verbose); - - /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + for (;;) { + if (likely(!__pyx_t_12)) { + if (likely(PyList_CheckExact(__pyx_t_2))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1151, __pyx_L20_error) + #endif + if (__pyx_t_9 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1151, __pyx_L20_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1151, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1151, __pyx_L20_error) + #endif + if (__pyx_t_9 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_4); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1151, __pyx_L20_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1151, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_12(__pyx_t_2); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 1151, __pyx_L20_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_9genexpr16__pyx_v_p, __pyx_t_4); + __pyx_t_4 = 0; + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1151, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_self)) __PYX_ERR(0, 1151, __pyx_L20_error); + __Pyx_INCREF(__pyx_9genexpr16__pyx_v_p); + __Pyx_GIVEREF(__pyx_9genexpr16__pyx_v_p); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_9genexpr16__pyx_v_p)) __PYX_ERR(0, 1151, __pyx_L20_error); + __Pyx_INCREF(Py_False); + __Pyx_GIVEREF(Py_False); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, Py_False)) __PYX_ERR(0, 1151, __pyx_L20_error); + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_4, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1151, __pyx_L20_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 1150, __pyx_L20_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_p); __pyx_9genexpr16__pyx_v_p = 0; + goto __pyx_L24_exit_scope; + __pyx_L20_error:; + __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_p); __pyx_9genexpr16__pyx_v_p = 0; + goto __pyx_L1_error; + __pyx_L24_exit_scope:; + } /* exit inner scope */ + { /* enter inner scope */ -/* "collisions.py":1201 - * DidReflect (bool): Whether the line reflected off of something - * """ - * oldLine = Line(*sorted([oldLine.p1, oldLine.p2], key=lambda x: x[0])) # <<<<<<<<<<<<<< - * newLine = Line(*sorted([newLine.p1, newLine.p2], key=lambda x: x[0])) - * mvement = Polygon(oldLine.p1, oldLine.p2, newLine.p2, newLine.p1) + /* "collisions.py":1152 + * tries = [ + * calculate(self, p, False) for p in othershape.toPoints() + * ] + [ # <<<<<<<<<<<<<< + * calculate(ln, self.p1, True) for ln in othershape.toLines() + * ] + [ */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1152, __pyx_L27_error) + __Pyx_GOTREF(__pyx_t_2); -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_19handleCollisionsPos_lambda9(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_4Line_19handleCollisionsPos_lambda9 = {"lambda9", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_19handleCollisionsPos_lambda9, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_4Line_19handleCollisionsPos_lambda9(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_x = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lambda9 (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1201, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda9") < 0)) __PYX_ERR(0, 1201, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_x = values[0]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda9", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1201, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + /* "collisions.py":1153 + * calculate(self, p, False) for p in othershape.toPoints() + * ] + [ + * calculate(ln, self.p1, True) for ln in othershape.toLines() # <<<<<<<<<<<<<< + * ] + [ + * calculate(ln, self.p2, True) for ln in othershape.toLines() + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_toLines); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1153, __pyx_L27_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_8 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; + __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1153, __pyx_L27_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) { + __pyx_t_4 = __pyx_t_10; __Pyx_INCREF(__pyx_t_4); + __pyx_t_9 = 0; + __pyx_t_12 = NULL; + } else { + __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1153, __pyx_L27_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1153, __pyx_L27_error) + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + for (;;) { + if (likely(!__pyx_t_12)) { + if (likely(PyList_CheckExact(__pyx_t_4))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1153, __pyx_L27_error) + #endif + if (__pyx_t_9 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_10 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1153, __pyx_L27_error) + #else + __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1153, __pyx_L27_error) + __Pyx_GOTREF(__pyx_t_10); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1153, __pyx_L27_error) + #endif + if (__pyx_t_9 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1153, __pyx_L27_error) + #else + __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1153, __pyx_L27_error) + __Pyx_GOTREF(__pyx_t_10); + #endif + } + } else { + __pyx_t_10 = __pyx_t_12(__pyx_t_4); + if (unlikely(!__pyx_t_10)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 1153, __pyx_L27_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_10); + } + __Pyx_XDECREF_SET(__pyx_9genexpr17__pyx_v_ln, __pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1153, __pyx_L27_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1153, __pyx_L27_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_9genexpr17__pyx_v_ln); + __Pyx_GIVEREF(__pyx_9genexpr17__pyx_v_ln); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_9genexpr17__pyx_v_ln)) __PYX_ERR(0, 1153, __pyx_L27_error); + __Pyx_GIVEREF(__pyx_t_10); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_10)) __PYX_ERR(0, 1153, __pyx_L27_error); + __Pyx_INCREF(Py_True); + __Pyx_GIVEREF(Py_True); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, Py_True)) __PYX_ERR(0, 1153, __pyx_L27_error); + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_8, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1153, __pyx_L27_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 1152, __pyx_L27_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_ln); __pyx_9genexpr17__pyx_v_ln = 0; + goto __pyx_L31_exit_scope; + __pyx_L27_error:; + __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_ln); __pyx_9genexpr17__pyx_v_ln = 0; + goto __pyx_L1_error; + __pyx_L31_exit_scope:; + } /* exit inner scope */ + + /* "collisions.py":1152 + * tries = [ + * calculate(self, p, False) for p in othershape.toPoints() + * ] + [ # <<<<<<<<<<<<<< + * calculate(ln, self.p1, True) for ln in othershape.toLines() + * ] + [ + */ + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + { /* enter inner scope */ + + /* "collisions.py":1154 + * ] + [ + * calculate(ln, self.p1, True) for ln in othershape.toLines() + * ] + [ # <<<<<<<<<<<<<< + * calculate(ln, self.p2, True) for ln in othershape.toLines() + * ] + */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1154, __pyx_L34_error) + __Pyx_GOTREF(__pyx_t_2); + + /* "collisions.py":1155 + * calculate(ln, self.p1, True) for ln in othershape.toLines() + * ] + [ + * calculate(ln, self.p2, True) for ln in othershape.toLines() # <<<<<<<<<<<<<< + * ] + * tries.sort(key=lambda x: x[1]) + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_toLines); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1155, __pyx_L34_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_8 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_10))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_10); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_10, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1155, __pyx_L34_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_10 = __pyx_t_3; __Pyx_INCREF(__pyx_t_10); + __pyx_t_9 = 0; + __pyx_t_12 = NULL; + } else { + __pyx_t_9 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1155, __pyx_L34_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1155, __pyx_L34_error) + } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (likely(!__pyx_t_12)) { + if (likely(PyList_CheckExact(__pyx_t_10))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1155, __pyx_L34_error) + #endif + if (__pyx_t_9 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1155, __pyx_L34_error) + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1155, __pyx_L34_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_10); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1155, __pyx_L34_error) + #endif + if (__pyx_t_9 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1155, __pyx_L34_error) + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1155, __pyx_L34_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } + } else { + __pyx_t_3 = __pyx_t_12(__pyx_t_10); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 1155, __pyx_L34_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_9genexpr18__pyx_v_ln, __pyx_t_3); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1155, __pyx_L34_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1155, __pyx_L34_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_INCREF(__pyx_9genexpr18__pyx_v_ln); + __Pyx_GIVEREF(__pyx_9genexpr18__pyx_v_ln); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_9genexpr18__pyx_v_ln)) __PYX_ERR(0, 1155, __pyx_L34_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3)) __PYX_ERR(0, 1155, __pyx_L34_error); + __Pyx_INCREF(Py_True); + __Pyx_GIVEREF(Py_True); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 2, Py_True)) __PYX_ERR(0, 1155, __pyx_L34_error); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1155, __pyx_L34_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1154, __pyx_L34_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_ln); __pyx_9genexpr18__pyx_v_ln = 0; + goto __pyx_L38_exit_scope; + __pyx_L34_error:; + __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_ln); __pyx_9genexpr18__pyx_v_ln = 0; + goto __pyx_L1_error; + __pyx_L38_exit_scope:; + } /* exit inner scope */ + + /* "collisions.py":1154 + * ] + [ + * calculate(ln, self.p1, True) for ln in othershape.toLines() + * ] + [ # <<<<<<<<<<<<<< + * calculate(ln, self.p2, True) for ln in othershape.toLines() + * ] + */ + __pyx_t_10 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_tries = ((PyObject*)__pyx_t_10); + __pyx_t_10 = 0; + + /* "collisions.py":1157 + * calculate(ln, self.p2, True) for ln in othershape.toLines() + * ] + * tries.sort(key=lambda x: x[1]) # <<<<<<<<<<<<<< + * if returnAll: + * return [i[0] for i in tries] + */ + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_tries, __pyx_n_s_sort); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_14closestPointTo_5lambda8, 0, __pyx_n_s_Line_closestPointTo_locals_lambd, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_t_4) < 0) __PYX_ERR(0, 1157, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "collisions.py":1158 + * ] + * tries.sort(key=lambda x: x[1]) + * if returnAll: # <<<<<<<<<<<<<< + * return [i[0] for i in tries] + * return tries[0][0] + */ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1158, __pyx_L1_error) + if (__pyx_t_6) { + + /* "collisions.py":1159 + * tries.sort(key=lambda x: x[1]) + * if returnAll: + * return [i[0] for i in tries] # <<<<<<<<<<<<<< + * return tries[0][0] + * + */ + __Pyx_XDECREF(__pyx_r); + { /* enter inner scope */ + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1159, __pyx_L42_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __pyx_v_tries; __Pyx_INCREF(__pyx_t_2); + __pyx_t_9 = 0; + for (;;) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1159, __pyx_L42_error) + #endif + if (__pyx_t_9 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_10 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_9); __Pyx_INCREF(__pyx_t_10); __pyx_t_9++; if (unlikely((0 < 0))) __PYX_ERR(0, 1159, __pyx_L42_error) + #else + __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1159, __pyx_L42_error) + __Pyx_GOTREF(__pyx_t_10); + #endif + __Pyx_XDECREF_SET(__pyx_9genexpr19__pyx_v_i, __pyx_t_10); + __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_GetItemInt(__pyx_9genexpr19__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1159, __pyx_L42_error) + __Pyx_GOTREF(__pyx_t_10); + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 1159, __pyx_L42_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + } + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_i); __pyx_9genexpr19__pyx_v_i = 0; + goto __pyx_L46_exit_scope; + __pyx_L42_error:; + __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_i); __pyx_9genexpr19__pyx_v_i = 0; + goto __pyx_L1_error; + __pyx_L46_exit_scope:; + } /* exit inner scope */ + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "collisions.py":1158 + * ] + * tries.sort(key=lambda x: x[1]) + * if returnAll: # <<<<<<<<<<<<<< + * return [i[0] for i in tries] + * return tries[0][0] + */ } + + /* "collisions.py":1160 + * if returnAll: + * return [i[0] for i in tries] + * return tries[0][0] # <<<<<<<<<<<<<< + * + * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_tries, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1160, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; } - __Pyx_AddTraceback("collisions.Line.handleCollisionsPos.lambda9", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_lambda_funcdef_lambda9(__pyx_self, __pyx_v_x); + + /* "collisions.py":1088 + * return othershape._where(self) + * + * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLike|Iterable[pointLike]: # <<<<<<<<<<<<<< + * """ + * Find the closest point ON this object TO another object. + */ /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } + __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_8); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_AddTraceback("collisions.Line.closestPointTo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_dx); + __Pyx_XDECREF(__pyx_v_dy); + __Pyx_XDECREF(__pyx_v_det); + __Pyx_XDECREF(__pyx_v_a); + __Pyx_XDECREF(__pyx_v_p); + __Pyx_XDECREF(__pyx_v_colls); + __Pyx_XDECREF(__pyx_v_calculate); + __Pyx_XDECREF(__pyx_v_tries); + __Pyx_XDECREF(__pyx_9genexpr15__pyx_v_i); + __Pyx_XDECREF(__pyx_9genexpr16__pyx_v_p); + __Pyx_XDECREF(__pyx_9genexpr17__pyx_v_ln); + __Pyx_XDECREF(__pyx_9genexpr18__pyx_v_ln); + __Pyx_XDECREF(__pyx_9genexpr19__pyx_v_i); + __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_lambda_funcdef_lambda9(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { +/* "collisions.py":1162 + * return tries[0][0] + * + * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< + * """ + * Finds whether a point is on a corner of this shape. + */ + +static PyObject *__pyx_pf_10collisions_38__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __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("lambda9", 1); + __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1201, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self)->__pyx_arg_precision); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self)->__pyx_arg_precision); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 1162, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1162, __pyx_L1_error); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 1162, __pyx_L1_error); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("collisions.Line.handleCollisionsPos.lambda9", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("collisions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -40258,42 +39890,37 @@ static PyObject *__pyx_lambda_funcdef_lambda9(CYTHON_UNUSED PyObject *__pyx_self return __pyx_r; } -/* "collisions.py":1202 - * """ - * oldLine = Line(*sorted([oldLine.p1, oldLine.p2], key=lambda x: x[0])) - * newLine = Line(*sorted([newLine.p1, newLine.p2], key=lambda x: x[0])) # <<<<<<<<<<<<<< - * mvement = Polygon(oldLine.p1, oldLine.p2, newLine.p2, newLine.p1) - * # Don't let you move when you're in a wall - */ - /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_19handleCollisionsPos_1lambda10(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_4Line_29isCorner(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_4Line_19handleCollisionsPos_1lambda10 = {"lambda10", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_19handleCollisionsPos_1lambda10, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_4Line_19handleCollisionsPos_1lambda10(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_4Line_28isCorner, "\n Finds whether a point is on a corner of this shape.\n\n Args:\n point (pointLike): The point to find if it's a corner\n precision (Number, optional): The decimal places to round to to check. Defaults to 5.\n\n Returns:\n bool: Whether the point is on a corner of this shape\n "); +static PyMethodDef __pyx_mdef_10collisions_4Line_29isCorner = {"isCorner", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_29isCorner, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_28isCorner}; +static PyObject *__pyx_pw_10collisions_4Line_29isCorner(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_x = 0; + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_point = 0; + PyObject *__pyx_v_precision = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; + PyObject* values[3] = {0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lambda10 (wrapper)", 0); + __Pyx_RefNannySetupContext("isCorner (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -40303,10 +39930,16 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_point,&__pyx_n_s_precision,0}; + __pyx_defaults10 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_self); + values[2] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_precision); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; @@ -40315,27 +39948,51 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1202, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1162, __pyx_L3_error) else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1162, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, 1); __PYX_ERR(0, 1162, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_precision); + if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1162, __pyx_L3_error) + } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda10") < 0)) __PYX_ERR(0, 1202, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isCorner") < 0)) __PYX_ERR(0, 1162, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } } - __pyx_v_x = values[0]; + __pyx_v_self = values[0]; + __pyx_v_point = values[1]; + __pyx_v_precision = values[2]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda10", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1202, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1162, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -40345,11 +40002,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Line.handleCollisionsPos.lambda10", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Line.isCorner", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_lambda_funcdef_lambda10(__pyx_self, __pyx_v_x); + __pyx_r = __pyx_pf_10collisions_4Line_28isCorner(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_precision); /* function exit code */ { @@ -40362,50 +40019,24 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_lambda_funcdef_lambda10(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { - 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("lambda10", 1); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1202, __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("collisions.Line.handleCollisionsPos.lambda10", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "collisions.py":1224 - * return newLine, vel, [None, False] - * return newLine, vel - * points.sort(key=lambda x: x[3]) # <<<<<<<<<<<<<< - * closestP = points[0][0] # Closest point on the OTHER object - * cPoint = points[0][2] # closestP projected onto the oldLine +/* "collisions.py":1173 + * bool: Whether the point is on a corner of this shape + * """ + * def rountTuple(x): # <<<<<<<<<<<<<< + * return (round(x[0], precision), round(x[1], precision)) + * return rountTuple(self.p1) == rountTuple(point) or rountTuple(self.p2) == rountTuple(point) */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_19handleCollisionsPos_2lambda11(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_4Line_8isCorner_1rountTuple(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_4Line_19handleCollisionsPos_2lambda11 = {"lambda11", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_19handleCollisionsPos_2lambda11, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_4Line_19handleCollisionsPos_2lambda11(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_4Line_8isCorner_1rountTuple = {"rountTuple", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_8isCorner_1rountTuple, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_4Line_8isCorner_1rountTuple(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -40423,7 +40054,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lambda11 (wrapper)", 0); + __Pyx_RefNannySetupContext("rountTuple (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -40449,12 +40080,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1224, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1173, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda11") < 0)) __PYX_ERR(0, 1224, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rountTuple") < 0)) __PYX_ERR(0, 1173, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -40465,7 +40096,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda11", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1224, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rountTuple", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1173, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -40475,11 +40106,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Line.handleCollisionsPos.lambda11", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Line.isCorner.rountTuple", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_lambda_funcdef_lambda11(__pyx_self, __pyx_v_x); + __pyx_r = __pyx_pf_10collisions_4Line_8isCorner_rountTuple(__pyx_self, __pyx_v_x); /* function exit code */ { @@ -40492,25 +40123,83 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_lambda_funcdef_lambda11(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { +static PyObject *__pyx_pf_10collisions_4Line_8isCorner_rountTuple(PyObject *__pyx_self, PyObject *__pyx_v_x) { + struct __pyx_obj_10collisions___pyx_scope_struct_9_isCorner *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_9_isCorner *__pyx_outer_scope; 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("lambda11", 1); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __Pyx_RefNannySetupContext("rountTuple", 1); + __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_9_isCorner *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "collisions.py":1174 + * """ + * def rountTuple(x): + * return (round(x[0], precision), round(x[1], precision)) # <<<<<<<<<<<<<< + * return rountTuple(self.p1) == rountTuple(point) or rountTuple(self.p2) == rountTuple(point) + * + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(!__pyx_cur_scope->__pyx_v_precision)) { __Pyx_RaiseClosureNameError("precision"); __PYX_ERR(0, 1174, __pyx_L1_error) } + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1174, __pyx_L1_error); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_precision); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_precision); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_cur_scope->__pyx_v_precision)) __PYX_ERR(0, 1174, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (unlikely(!__pyx_cur_scope->__pyx_v_precision)) { __Pyx_RaiseClosureNameError("precision"); __PYX_ERR(0, 1174, __pyx_L1_error) } + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 1174, __pyx_L1_error); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_precision); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_precision); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_cur_scope->__pyx_v_precision)) __PYX_ERR(0, 1174, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1174, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 1174, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 1174, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "collisions.py":1173 + * bool: Whether the point is on a corner of this shape + * """ + * def rountTuple(x): # <<<<<<<<<<<<<< + * return (round(x[0], precision), round(x[1], precision)) + * return rountTuple(self.p1) == rountTuple(point) or rountTuple(self.p2) == rountTuple(point) + */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("collisions.Line.handleCollisionsPos.lambda11", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("collisions.Line.isCorner.rountTuple", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -40518,31 +40207,281 @@ static PyObject *__pyx_lambda_funcdef_lambda11(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "collisions.py":1246 - * paralell = True - * if cLine is not None: - * sortedOtherLn = Line(*sorted([cLine.p1, cLine.p2], key=lambda x: x[0])) # <<<<<<<<<<<<<< - * otherLnNormal = math.degrees(math.atan2(sortedOtherLn[0][1]-sortedOtherLn[1][1], sortedOtherLn[0][0]-sortedOtherLn[1][0])) - * paralell = abs(otherLnNormal%360 - thisNormal%360) < precision or abs((otherLnNormal-180)%360 - thisNormal%360) < precision +/* "collisions.py":1162 + * return tries[0][0] + * + * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< + * """ + * Finds whether a point is on a corner of this shape. + */ + +static PyObject *__pyx_pf_10collisions_4Line_28isCorner(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_precision) { + struct __pyx_obj_10collisions___pyx_scope_struct_9_isCorner *__pyx_cur_scope; + PyObject *__pyx_v_rountTuple = 0; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("isCorner", 0); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_9_isCorner *)__pyx_tp_new_10collisions___pyx_scope_struct_9_isCorner(__pyx_ptype_10collisions___pyx_scope_struct_9_isCorner, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_9_isCorner *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 1162, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); + } + __pyx_cur_scope->__pyx_v_precision = __pyx_v_precision; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_precision); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_precision); + + /* "collisions.py":1173 + * bool: Whether the point is on a corner of this shape + * """ + * def rountTuple(x): # <<<<<<<<<<<<<< + * return (round(x[0], precision), round(x[1], precision)) + * return rountTuple(self.p1) == rountTuple(point) or rountTuple(self.p2) == rountTuple(point) + */ + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_8isCorner_1rountTuple, 0, __pyx_n_s_Line_isCorner_locals_rountTuple, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_rountTuple = __pyx_t_1; + __pyx_t_1 = 0; + + /* "collisions.py":1175 + * def rountTuple(x): + * return (round(x[0], precision), round(x[1], precision)) + * return rountTuple(self.p1) == rountTuple(point) or rountTuple(self.p2) == rountTuple(point) # <<<<<<<<<<<<<< + * + * def tangent(self, point: pointLike, vel: pointLike) -> Number: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __pyx_pf_10collisions_4Line_8isCorner_rountTuple(__pyx_v_rountTuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __pyx_pf_10collisions_4Line_8isCorner_rountTuple(__pyx_v_rountTuple, __pyx_v_point); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1175, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1175, __pyx_L1_error) + if (!__pyx_t_5) { + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { + __Pyx_INCREF(__pyx_t_4); + __pyx_t_1 = __pyx_t_4; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + goto __pyx_L3_bool_binop_done; + } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __pyx_pf_10collisions_4Line_8isCorner_rountTuple(__pyx_v_rountTuple, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __pyx_pf_10collisions_4Line_8isCorner_rountTuple(__pyx_v_rountTuple, __pyx_v_point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1175, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1175, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_1 = __pyx_t_3; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_L3_bool_binop_done:; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "collisions.py":1162 + * return tries[0][0] + * + * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< + * """ + * Finds whether a point is on a corner of this shape. + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("collisions.Line.isCorner", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_rountTuple); + __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":1177 + * return rountTuple(self.p1) == rountTuple(point) or rountTuple(self.p2) == rountTuple(point) + * + * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< + * """ + * Finds the tangent on this surface to a point with a given velocity. */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_4Line_19handleCollisionsPos_3lambda12(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_4Line_31tangent(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_4Line_19handleCollisionsPos_3lambda12 = {"lambda12", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_19handleCollisionsPos_3lambda12, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_4Line_19handleCollisionsPos_3lambda12(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_4Line_30tangent, "\n Finds the tangent on this surface to a point with a given velocity.\n\n Args:\n point (pointLike): The point to find the tangent of this surface from.\n vel (pointLike): Which direction the point is moving. In this case (for lines) it is actually very important, so please don't forget it.\n\n Returns:\n Number: The tangent of the line at the point. You can -90 to get the normal.\n "); +static PyMethodDef __pyx_mdef_10collisions_4Line_31tangent = {"tangent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_31tangent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_30tangent}; +static PyObject *__pyx_pw_10collisions_4Line_31tangent(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_x = 0; + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_point = 0; + PyObject *__pyx_v_vel = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("tangent (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_point,&__pyx_n_s_vel,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 1); __PYX_ERR(0, 1177, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vel)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1177, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 2); __PYX_ERR(0, 1177, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tangent") < 0)) __PYX_ERR(0, 1177, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 3)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + } + __pyx_v_self = values[0]; + __pyx_v_point = values[1]; + __pyx_v_vel = values[2]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1177, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("collisions.Line.tangent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_4Line_30tangent(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_vel); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":1192 + * elif point == self.p2: + * return math.degrees(math.atan2(self.p1[1] - self.p2[1], self.p1[0] - self.p2[0])) + * def fixangle(angle): # <<<<<<<<<<<<<< + * angle = angle % 360 + * if angle > 180: + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_4Line_7tangent_1fixangle(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_10collisions_4Line_7tangent_1fixangle = {"fixangle", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_7tangent_1fixangle, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_4Line_7tangent_1fixangle(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_angle = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif @@ -40553,7 +40492,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lambda12 (wrapper)", 0); + __Pyx_RefNannySetupContext("fixangle (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -40563,7 +40502,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_angle,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -40575,27 +40514,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_angle)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1246, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1192, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda12") < 0)) __PYX_ERR(0, 1246, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "fixangle") < 0)) __PYX_ERR(0, 1192, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - __pyx_v_x = values[0]; + __pyx_v_angle = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda12", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1246, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("fixangle", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1192, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -40605,11 +40544,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Line.handleCollisionsPos.lambda12", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Line.tangent.fixangle", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_lambda_funcdef_lambda12(__pyx_self, __pyx_v_x); + __pyx_r = __pyx_pf_10collisions_4Line_7tangent_fixangle(__pyx_self, __pyx_v_angle); /* function exit code */ { @@ -40622,554 +40561,1967 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_lambda_funcdef_lambda12(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { +static PyObject *__pyx_pf_10collisions_4Line_7tangent_fixangle(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_angle) { 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("lambda12", 1); + __Pyx_RefNannySetupContext("fixangle", 0); + __Pyx_INCREF(__pyx_v_angle); + + /* "collisions.py":1193 + * return math.degrees(math.atan2(self.p1[1] - self.p2[1], self.p1[0] - self.p2[0])) + * def fixangle(angle): + * angle = angle % 360 # <<<<<<<<<<<<<< + * if angle > 180: + * angle = angle - 360 + */ + __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_v_angle, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_angle, __pyx_t_1); + __pyx_t_1 = 0; + + /* "collisions.py":1194 + * def fixangle(angle): + * angle = angle % 360 + * if angle > 180: # <<<<<<<<<<<<<< + * angle = angle - 360 + * return abs(angle) # Because we don't need to use this for anything else + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_v_angle, __pyx_int_180, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1194, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1194, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_2) { + + /* "collisions.py":1195 + * angle = angle % 360 + * if angle > 180: + * angle = angle - 360 # <<<<<<<<<<<<<< + * return abs(angle) # Because we don't need to use this for anything else + * toDeg = (math.degrees(math.atan2(vel[1], vel[0]))-180) % 360 + */ + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_angle, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF_SET(__pyx_v_angle, __pyx_t_1); + __pyx_t_1 = 0; + + /* "collisions.py":1194 + * def fixangle(angle): + * angle = angle % 360 + * if angle > 180: # <<<<<<<<<<<<<< + * angle = angle - 360 + * return abs(angle) # Because we don't need to use this for anything else + */ + } + + /* "collisions.py":1196 + * if angle > 180: + * angle = angle - 360 + * return abs(angle) # Because we don't need to use this for anything else # <<<<<<<<<<<<<< + * toDeg = (math.degrees(math.atan2(vel[1], vel[0]))-180) % 360 + * phi = (math.degrees(math.atan2(self.p2[1] - self.p1[1], self.p2[0] - self.p1[0]))-90) + */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1246, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_v_angle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; + /* "collisions.py":1192 + * elif point == self.p2: + * return math.degrees(math.atan2(self.p1[1] - self.p2[1], self.p1[0] - self.p2[0])) + * def fixangle(angle): # <<<<<<<<<<<<<< + * angle = angle % 360 + * if angle > 180: + */ + /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("collisions.Line.handleCollisionsPos.lambda12", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Line.tangent.fixangle", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_angle); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":1169 - * return [(phi-180)%360, phi % 360][tries.index(min(tries))] +/* "collisions.py":1177 + * return rountTuple(self.p1) == rountTuple(point) or rountTuple(self.p2) == rountTuple(point) * - * def handleCollisionsPos(self, # <<<<<<<<<<<<<< - * oldLine: 'Line', - * newLine: 'Line', + * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< + * """ + * Finds the tangent on this surface to a point with a given velocity. */ -static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_oldLine, PyObject *__pyx_v_newLine, PyObject *__pyx_v_objs, PyObject *__pyx_v_vel, PyObject *__pyx_v_replaceSelf, PyObject *__pyx_v_precision, PyObject *__pyx_v_verbose) { - PyObject *__pyx_v_mvement = NULL; - PyObject *__pyx_v_points = NULL; - int __pyx_v_hit; - PyObject *__pyx_v_o = NULL; - PyObject *__pyx_v_ps = NULL; - PyObject *__pyx_v_p = NULL; - PyObject *__pyx_v_cPoint = NULL; - PyObject *__pyx_v_closestP = NULL; - PyObject *__pyx_v_closestObj = NULL; - PyObject *__pyx_v_newPoint = NULL; - PyObject *__pyx_v_thisNormal = NULL; - PyObject *__pyx_v_paralell = NULL; - PyObject *__pyx_v_thisIsOnP = NULL; - PyObject *__pyx_v_cLine = NULL; - PyObject *__pyx_v_colllidingLns = NULL; - PyObject *__pyx_v_sortedOtherLn = NULL; - PyObject *__pyx_v_otherLnNormal = NULL; - PyObject *__pyx_v_velDiff = NULL; - PyObject *__pyx_v_collTyp = NULL; - PyObject *__pyx_v_normal = NULL; +static PyObject *__pyx_pf_10collisions_4Line_30tangent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_vel) { + PyObject *__pyx_v_fixangle = 0; + PyObject *__pyx_v_toDeg = NULL; PyObject *__pyx_v_phi = NULL; - PyObject *__pyx_v_otherIsOnP = NULL; - PyObject *__pyx_v_dist_left = NULL; - PyObject *__pyx_v_diff = NULL; - PyObject *__pyx_v_pos = NULL; - PyObject *__pyx_v_diff2Point = NULL; - PyObject *__pyx_v_odiff = NULL; - PyObject *__pyx_v_smallness = NULL; - PyObject *__pyx_v_newp1 = NULL; - PyObject *__pyx_v_newp2 = NULL; - PyObject *__pyx_v_out = NULL; - PyObject *__pyx_v_outvel = NULL; - PyObject *__pyx_9genexpr20__pyx_v_i = NULL; - PyObject *__pyx_9genexpr21__pyx_v_i = NULL; + PyObject *__pyx_v_tries = 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_3; PyObject *__pyx_t_4 = NULL; PyObject *__pyx_t_5 = NULL; PyObject *__pyx_t_6 = NULL; PyObject *__pyx_t_7 = NULL; - unsigned int __pyx_t_8; - int __pyx_t_9; - Py_ssize_t __pyx_t_10; - PyObject *(*__pyx_t_11)(PyObject *); - Py_ssize_t __pyx_t_12; - PyObject *(*__pyx_t_13)(PyObject *); - PyObject *__pyx_t_14 = NULL; - PyObject *__pyx_t_15 = NULL; - PyObject *__pyx_t_16 = NULL; - int __pyx_t_17; - int __pyx_t_18; - int __pyx_t_19; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + unsigned int __pyx_t_10; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("handleCollisionsPos", 0); - __Pyx_INCREF(__pyx_v_oldLine); - __Pyx_INCREF(__pyx_v_newLine); - __Pyx_INCREF(__pyx_v_vel); - - /* "collisions.py":1201 - * DidReflect (bool): Whether the line reflected off of something - * """ - * oldLine = Line(*sorted([oldLine.p1, oldLine.p2], key=lambda x: x[0])) # <<<<<<<<<<<<<< - * newLine = Line(*sorted([newLine.p1, newLine.p2], key=lambda x: x[0])) - * mvement = Polygon(oldLine.p1, oldLine.p2, newLine.p2, newLine.p1) - */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Line); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 1201, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 1201, __pyx_L1_error); - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_19handleCollisionsPos_lambda9, 0, __pyx_n_s_Line_handleCollisionsPos_locals, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_key, __pyx_t_2) < 0) __PYX_ERR(0, 1201, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF_SET(__pyx_v_oldLine, __pyx_t_2); - __pyx_t_2 = 0; + __Pyx_RefNannySetupContext("tangent", 1); - /* "collisions.py":1202 + /* "collisions.py":1188 + * Number: The tangent of the line at the point. You can -90 to get the normal. * """ - * oldLine = Line(*sorted([oldLine.p1, oldLine.p2], key=lambda x: x[0])) - * newLine = Line(*sorted([newLine.p1, newLine.p2], key=lambda x: x[0])) # <<<<<<<<<<<<<< - * mvement = Polygon(oldLine.p1, oldLine.p2, newLine.p2, newLine.p1) - * # Don't let you move when you're in a wall + * if point == self.p1: # <<<<<<<<<<<<<< + * return math.degrees(math.atan2(self.p2[1] - self.p1[1], self.p2[0] - self.p1[0])) + * elif point == self.p2: */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 1202, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 1202, __pyx_L1_error); - __pyx_t_4 = 0; - __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1202, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 1202, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_19handleCollisionsPos_1lambda10, 0, __pyx_n_s_Line_handleCollisionsPos_locals, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_key, __pyx_t_4) < 0) __PYX_ERR(0, 1202, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyObject_RichCompare(__pyx_v_point, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1188, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1202, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1188, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF_SET(__pyx_v_newLine, __pyx_t_4); - __pyx_t_4 = 0; + if (__pyx_t_3) { - /* "collisions.py":1203 - * oldLine = Line(*sorted([oldLine.p1, oldLine.p2], key=lambda x: x[0])) - * newLine = Line(*sorted([newLine.p1, newLine.p2], key=lambda x: x[0])) - * mvement = Polygon(oldLine.p1, oldLine.p2, newLine.p2, newLine.p1) # <<<<<<<<<<<<<< - * # Don't let you move when you're in a wall - * if oldLine.collides(objs): + /* "collisions.py":1189 + * """ + * if point == self.p1: + * return math.degrees(math.atan2(self.p2[1] - self.p1[1], self.p2[0] - self.p1[0])) # <<<<<<<<<<<<<< + * elif point == self.p2: + * return math.degrees(math.atan2(self.p1[1] - self.p2[1], self.p1[0] - self.p2[0])) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1203, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1203, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1203, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1203, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1203, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = NULL; - __pyx_t_8 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_degrees); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_atan2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_Subtract(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Subtract(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = NULL; + __pyx_t_10 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_10 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_5, __pyx_t_8}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } + __pyx_t_6 = NULL; + __pyx_t_10 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_10 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_1}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1189, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "collisions.py":1188 + * Number: The tangent of the line at the point. You can -90 to get the normal. + * """ + * if point == self.p1: # <<<<<<<<<<<<<< + * return math.degrees(math.atan2(self.p2[1] - self.p1[1], self.p2[0] - self.p1[0])) + * elif point == self.p2: + */ + } + + /* "collisions.py":1190 + * if point == self.p1: + * return math.degrees(math.atan2(self.p2[1] - self.p1[1], self.p2[0] - self.p1[0])) + * elif point == self.p2: # <<<<<<<<<<<<<< + * return math.degrees(math.atan2(self.p1[1] - self.p2[1], self.p1[0] - self.p2[0])) + * def fixangle(angle): + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_point, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1190, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1190, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_3) { + + /* "collisions.py":1191 + * return math.degrees(math.atan2(self.p2[1] - self.p1[1], self.p2[0] - self.p1[0])) + * elif point == self.p2: + * return math.degrees(math.atan2(self.p1[1] - self.p2[1], self.p1[0] - self.p2[0])) # <<<<<<<<<<<<<< + * def fixangle(angle): + * angle = angle % 360 + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_degrees); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_math); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_atan2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Subtract(__pyx_t_5, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_9, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_9, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_Subtract(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = NULL; + __pyx_t_10 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_10 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_6, __pyx_t_9}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __pyx_t_8 = NULL; + __pyx_t_10 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_10 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_2}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1191, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "collisions.py":1190 + * if point == self.p1: + * return math.degrees(math.atan2(self.p2[1] - self.p1[1], self.p2[0] - self.p1[0])) + * elif point == self.p2: # <<<<<<<<<<<<<< + * return math.degrees(math.atan2(self.p1[1] - self.p2[1], self.p1[0] - self.p2[0])) + * def fixangle(angle): + */ + } + + /* "collisions.py":1192 + * elif point == self.p2: + * return math.degrees(math.atan2(self.p1[1] - self.p2[1], self.p1[0] - self.p2[0])) + * def fixangle(angle): # <<<<<<<<<<<<<< + * angle = angle % 360 + * if angle > 180: + */ + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_7tangent_1fixangle, 0, __pyx_n_s_Line_tangent_locals_fixangle, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_fixangle = __pyx_t_4; + __pyx_t_4 = 0; + + /* "collisions.py":1197 + * angle = angle - 360 + * return abs(angle) # Because we don't need to use this for anything else + * toDeg = (math.degrees(math.atan2(vel[1], vel[0]))-180) % 360 # <<<<<<<<<<<<<< + * phi = (math.degrees(math.atan2(self.p2[1] - self.p1[1], self.p2[0] - self.p1[0]))-90) + * tries = [fixangle(phi-toDeg), fixangle(phi-toDeg-180)] + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_degrees); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_math); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_atan2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + __pyx_t_10 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_8 = 1; + __Pyx_DECREF_SET(__pyx_t_9, function); + __pyx_t_10 = 1; } } #endif { - PyObject *__pyx_callargs[5] = {__pyx_t_7, __pyx_t_2, __pyx_t_1, __pyx_t_5, __pyx_t_6}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 4+__pyx_t_8); + PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_8, __pyx_t_6}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1203, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __pyx_t_9 = NULL; + __pyx_t_10 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_10 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_1}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_v_mvement = __pyx_t_4; + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_4, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyInt_RemainderObjC(__pyx_t_2, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1197, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_toDeg = __pyx_t_4; __pyx_t_4 = 0; - /* "collisions.py":1205 - * mvement = Polygon(oldLine.p1, oldLine.p2, newLine.p2, newLine.p1) - * # Don't let you move when you're in a wall - * if oldLine.collides(objs): # <<<<<<<<<<<<<< - * if verbose: - * return oldLine, [0, 0], [None, True] + /* "collisions.py":1198 + * return abs(angle) # Because we don't need to use this for anything else + * toDeg = (math.degrees(math.atan2(vel[1], vel[0]))-180) % 360 + * phi = (math.degrees(math.atan2(self.p2[1] - self.p1[1], self.p2[0] - self.p1[0]))-90) # <<<<<<<<<<<<<< + * tries = [fixangle(phi-toDeg), fixangle(phi-toDeg-180)] + * return [(phi-180)%360, phi % 360][tries.index(min(tries))] */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1205, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_degrees); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_math); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_atan2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_9, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_9, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_Subtract(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyNumber_Subtract(__pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = NULL; + __pyx_t_10 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_6, function); + __pyx_t_10 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_t_9, __pyx_t_7}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + } __pyx_t_6 = NULL; - __pyx_t_8 = 0; + __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_8 = 1; + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_10 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_objs}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_2}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1205, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1205, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_4, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1198, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_9) { + __pyx_v_phi = __pyx_t_1; + __pyx_t_1 = 0; - /* "collisions.py":1206 - * # Don't let you move when you're in a wall - * if oldLine.collides(objs): - * if verbose: # <<<<<<<<<<<<<< - * return oldLine, [0, 0], [None, True] - * return oldLine, [0, 0] + /* "collisions.py":1199 + * toDeg = (math.degrees(math.atan2(vel[1], vel[0]))-180) % 360 + * phi = (math.degrees(math.atan2(self.p2[1] - self.p1[1], self.p2[0] - self.p1[0]))-90) + * tries = [fixangle(phi-toDeg), fixangle(phi-toDeg-180)] # <<<<<<<<<<<<<< + * return [(phi-180)%360, phi % 360][tries.index(min(tries))] + * */ - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1206, __pyx_L1_error) - if (__pyx_t_9) { + __pyx_t_1 = PyNumber_Subtract(__pyx_v_phi, __pyx_v_toDeg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __pyx_pf_10collisions_4Line_7tangent_fixangle(__pyx_v_fixangle, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_v_phi, __pyx_v_toDeg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_1, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __pyx_pf_10collisions_4Line_7tangent_fixangle(__pyx_v_fixangle, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1199, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 1199, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1199, __pyx_L1_error); + __pyx_t_4 = 0; + __pyx_t_1 = 0; + __pyx_v_tries = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; - /* "collisions.py":1207 - * if oldLine.collides(objs): - * if verbose: - * return oldLine, [0, 0], [None, True] # <<<<<<<<<<<<<< - * return oldLine, [0, 0] - * points = [] + /* "collisions.py":1200 + * phi = (math.degrees(math.atan2(self.p2[1] - self.p1[1], self.p2[0] - self.p1[0]))-90) + * tries = [fixangle(phi-toDeg), fixangle(phi-toDeg-180)] + * return [(phi-180)%360, phi % 360][tries.index(min(tries))] # <<<<<<<<<<<<<< + * + * def handleCollisionsPos(self, */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_int_0)) __PYX_ERR(0, 1207, __pyx_L1_error); - __Pyx_INCREF(__pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_int_0)) __PYX_ERR(0, 1207, __pyx_L1_error); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, Py_None)) __PYX_ERR(0, 1207, __pyx_L1_error); - __Pyx_INCREF(Py_True); - __Pyx_GIVEREF(Py_True); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, Py_True)) __PYX_ERR(0, 1207, __pyx_L1_error); - __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1207, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_v_oldLine); - __Pyx_GIVEREF(__pyx_v_oldLine); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_oldLine)) __PYX_ERR(0, 1207, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4)) __PYX_ERR(0, 1207, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3)) __PYX_ERR(0, 1207, __pyx_L1_error); - __pyx_t_4 = 0; - __pyx_t_3 = 0; - __pyx_r = ((PyObject*)__pyx_t_6); - __pyx_t_6 = 0; - goto __pyx_L0; + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_phi, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_t_2, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_v_phi, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 1200, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 1200, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_v_tries); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyList_Type_index, __pyx_v_tries, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1200, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; - /* "collisions.py":1206 - * # Don't let you move when you're in a wall - * if oldLine.collides(objs): - * if verbose: # <<<<<<<<<<<<<< - * return oldLine, [0, 0], [None, True] - * return oldLine, [0, 0] + /* "collisions.py":1177 + * return rountTuple(self.p1) == rountTuple(point) or rountTuple(self.p2) == rountTuple(point) + * + * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< + * """ + * Finds the tangent on this surface to a point with a given velocity. */ - } - /* "collisions.py":1208 - * if verbose: - * return oldLine, [0, 0], [None, True] - * return oldLine, [0, 0] # <<<<<<<<<<<<<< - * points = [] - * hit = False - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1208, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_INCREF(__pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_int_0)) __PYX_ERR(0, 1208, __pyx_L1_error); - __Pyx_INCREF(__pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_int_0)) __PYX_ERR(0, 1208, __pyx_L1_error); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1208, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_oldLine); - __Pyx_GIVEREF(__pyx_v_oldLine); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_oldLine)) __PYX_ERR(0, 1208, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6)) __PYX_ERR(0, 1208, __pyx_L1_error); - __pyx_t_6 = 0; - __pyx_r = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; - goto __pyx_L0; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("collisions.Line.tangent", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_fixangle); + __Pyx_XDECREF(__pyx_v_toDeg); + __Pyx_XDECREF(__pyx_v_phi); + __Pyx_XDECREF(__pyx_v_tries); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "collisions.py":1205 - * mvement = Polygon(oldLine.p1, oldLine.p2, newLine.p2, newLine.p1) - * # Don't let you move when you're in a wall - * if oldLine.collides(objs): # <<<<<<<<<<<<<< - * if verbose: - * return oldLine, [0, 0], [None, True] +/* "collisions.py":1202 + * return [(phi-180)%360, phi % 360][tries.index(min(tries))] + * + * def handleCollisionsPos(self, # <<<<<<<<<<<<<< + * oldLine: 'Line', + * newLine: 'Line', */ - } + +static PyObject *__pyx_pf_10collisions_40__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __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("__defaults__", 1); + __Pyx_XDECREF(__pyx_r); /* "collisions.py":1209 - * return oldLine, [0, 0], [None, True] - * return oldLine, [0, 0] - * points = [] # <<<<<<<<<<<<<< - * hit = False - * for o in objs: + * replaceSelf: bool = True, + * precision: Number = BASEPRECISION, + * verbose: bool = False # <<<<<<<<<<<<<< + * ) -> tuple['Line', pointLike, verboseOutput]: + * """ */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1209, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_v_points = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self)->__pyx_arg_vel); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self)->__pyx_arg_vel); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self)->__pyx_arg_vel)) __PYX_ERR(0, 1202, __pyx_L1_error); + __Pyx_INCREF(((PyObject *)Py_True)); + __Pyx_GIVEREF(((PyObject *)Py_True)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_True))) __PYX_ERR(0, 1202, __pyx_L1_error); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self)->__pyx_arg_precision); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self)->__pyx_arg_precision); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 1202, __pyx_L1_error); + __Pyx_INCREF(((PyObject *)Py_False)); + __Pyx_GIVEREF(((PyObject *)Py_False)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)Py_False))) __PYX_ERR(0, 1202, __pyx_L1_error); - /* "collisions.py":1210 - * return oldLine, [0, 0] - * points = [] - * hit = False # <<<<<<<<<<<<<< - * for o in objs: - * if o.collides(mvement): - */ - __pyx_v_hit = 0; - - /* "collisions.py":1211 - * points = [] - * hit = False - * for o in objs: # <<<<<<<<<<<<<< - * if o.collides(mvement): - * hit = True + /* "collisions.py":1202 + * return [(phi-180)%360, phi % 360][tries.index(min(tries))] + * + * def handleCollisionsPos(self, # <<<<<<<<<<<<<< + * oldLine: 'Line', + * newLine: 'Line', */ - if (likely(PyList_CheckExact(__pyx_v_objs)) || PyTuple_CheckExact(__pyx_v_objs)) { - __pyx_t_3 = __pyx_v_objs; __Pyx_INCREF(__pyx_t_3); - __pyx_t_10 = 0; - __pyx_t_11 = NULL; - } else { - __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_objs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1211, __pyx_L1_error) - } - for (;;) { - if (likely(!__pyx_t_11)) { - if (likely(PyList_CheckExact(__pyx_t_3))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1211, __pyx_L1_error) - #endif - if (__pyx_t_10 >= __pyx_temp) break; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1202, __pyx_L1_error); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 1202, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("collisions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_4Line_33handleCollisionsPos(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_10collisions_4Line_32handleCollisionsPos, "\n Handles movement of this line and it bouncing off of other objects.\n It is recommended you use `.handleCollisionsVel` instead of this, as it handles velocity instead of raw movement and is easier to use.\n\n But if you are to use this, remember to still provide the vel param. It will provide VERY weird results if you don't.\n It could even just be the difference in positions, it just needs to be something realistic.\n\n Args:\n oldLine (Line): The old Line object.\n newLine (Line): The new Line object. Should be the exact same as the old one except with the 2 points offset by the same amount.\n objs (Shapes / Iterable[Shape]): The objects this will bounce off.\n vel (pointLike, optional): The velocity that this object is going. Defaults to [0, 0].\n replaceSelf (bool, optional): Whether to move this Line to the new position after bouncing or not. Defaults to True.\n precision (Number, optional): The decimal places to round to to check (for things like corner checking). Defaults to 5.\n verbose (bool, optional): Whether to give verbose output or not. Defaults to False.\n\n Returns:\n tuple[Line, pointLike, veboseOutput?]: The new Line object and vel of this object respectively, and if verbose then the verboseOutput.\n \n VerboseOutput:\n CollisionType (list[int, ...] / None): The type of collision that occured for each sub-collision (if it ever collided, that is)\n DidReflect (bool): Whether the line reflected off of something\n "); +static PyMethodDef __pyx_mdef_10collisions_4Line_33handleCollisionsPos = {"handleCollisionsPos", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_33handleCollisionsPos, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_4Line_32handleCollisionsPos}; +static PyObject *__pyx_pw_10collisions_4Line_33handleCollisionsPos(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_oldLine = 0; + PyObject *__pyx_v_newLine = 0; + PyObject *__pyx_v_objs = 0; + PyObject *__pyx_v_vel = 0; + PyObject *__pyx_v_replaceSelf = 0; + PyObject *__pyx_v_precision = 0; + PyObject *__pyx_v_verbose = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[8] = {0,0,0,0,0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("handleCollisionsPos (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_oldLine,&__pyx_n_s_newLine,&__pyx_n_s_objs,&__pyx_n_s_vel,&__pyx_n_s_replaceSelf,&__pyx_n_s_precision,&__pyx_n_s_verbose,0}; + __pyx_defaults11 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self); + values[4] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_vel); + values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); + values[6] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_precision); + values[7] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1211, __pyx_L1_error) - #else - __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1211, __pyx_L1_error) - #endif - if (__pyx_t_10 >= __pyx_temp) break; + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1202, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_oldLine)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1211, __pyx_L1_error) - #else - __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1211, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - #endif + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1202, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 1); __PYX_ERR(0, 1202, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_newLine)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1202, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 2); __PYX_ERR(0, 1202, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_objs)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1202, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 3); __PYX_ERR(0, 1202, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vel); + if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1202, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_replaceSelf); + if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1202, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_precision); + if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1202, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_verbose); + if (value) { values[7] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1202, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "handleCollisionsPos") < 0)) __PYX_ERR(0, 1202, __pyx_L3_error) } } else { - __pyx_t_6 = __pyx_t_11(__pyx_t_3); - if (unlikely(!__pyx_t_6)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1211, __pyx_L1_error) - } + switch (__pyx_nargs) { + case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); break; + default: goto __pyx_L5_argtuple_error; } - __Pyx_GOTREF(__pyx_t_6); } - __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_6); - __pyx_t_6 = 0; + __pyx_v_self = values[0]; + __pyx_v_oldLine = values[1]; + __pyx_v_newLine = values[2]; + __pyx_v_objs = values[3]; + __pyx_v_vel = values[4]; + __pyx_v_replaceSelf = values[5]; + __pyx_v_precision = values[6]; + __pyx_v_verbose = values[7]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, __pyx_nargs); __PYX_ERR(0, 1202, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("collisions.Line.handleCollisionsPos", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_4Line_32handleCollisionsPos(__pyx_self, __pyx_v_self, __pyx_v_oldLine, __pyx_v_newLine, __pyx_v_objs, __pyx_v_vel, __pyx_v_replaceSelf, __pyx_v_precision, __pyx_v_verbose); - /* "collisions.py":1212 - * hit = False - * for o in objs: - * if o.collides(mvement): # <<<<<<<<<<<<<< - * hit = True - * ps = o.whereCollides(mvement) + [i for i in o.closestPointTo(oldLine, True) if mvement.collides(Point(*i))] + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":1234 + * DidReflect (bool): Whether the line reflected off of something + * """ + * oldLine = Line(*sorted([oldLine.p1, oldLine.p2], key=lambda x: x[0])) # <<<<<<<<<<<<<< + * newLine = Line(*sorted([newLine.p1, newLine.p2], key=lambda x: x[0])) + * mvement = Polygon(oldLine.p1, oldLine.p2, newLine.p2, newLine.p1) */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_8 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_8 = 1; + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_4Line_19handleCollisionsPos_lambda9(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_10collisions_4Line_19handleCollisionsPos_lambda9 = {"lambda9", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_19handleCollisionsPos_lambda9, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_4Line_19handleCollisionsPos_lambda9(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_x = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda9 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1234, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda9") < 0)) __PYX_ERR(0, 1234, __pyx_L3_error) } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_mvement}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_x = values[0]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("lambda9", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1234, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1212, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__pyx_t_9) { + } + __Pyx_AddTraceback("collisions.Line.handleCollisionsPos.lambda9", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_lambda_funcdef_lambda9(__pyx_self, __pyx_v_x); - /* "collisions.py":1213 - * for o in objs: - * if o.collides(mvement): - * hit = True # <<<<<<<<<<<<<< - * ps = o.whereCollides(mvement) + [i for i in o.closestPointTo(oldLine, True) if mvement.collides(Point(*i))] - * for p in ps: - */ - __pyx_v_hit = 1; + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "collisions.py":1214 - * if o.collides(mvement): - * hit = True - * ps = o.whereCollides(mvement) + [i for i in o.closestPointTo(oldLine, True) if mvement.collides(Point(*i))] # <<<<<<<<<<<<<< - * for p in ps: - * # The rotation is making sure the line crosses the oldLine +static PyObject *__pyx_lambda_funcdef_lambda9(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { + 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("lambda9", 1); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1234, __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("collisions.Line.handleCollisionsPos.lambda9", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":1235 + * """ + * oldLine = Line(*sorted([oldLine.p1, oldLine.p2], key=lambda x: x[0])) + * newLine = Line(*sorted([newLine.p1, newLine.p2], key=lambda x: x[0])) # <<<<<<<<<<<<<< + * mvement = Polygon(oldLine.p1, oldLine.p2, newLine.p2, newLine.p1) + * # Don't let you move when you're in a wall */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1214, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = NULL; - __pyx_t_8 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_8 = 1; + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_4Line_19handleCollisionsPos_1lambda10(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_10collisions_4Line_19handleCollisionsPos_1lambda10 = {"lambda10", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_19handleCollisionsPos_1lambda10, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_4Line_19handleCollisionsPos_1lambda10(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_x = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda10 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1235, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_mvement}; - __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1214, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda10") < 0)) __PYX_ERR(0, 1235, __pyx_L3_error) } - { /* enter inner scope */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1214, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1214, __pyx_L10_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = NULL; - __pyx_t_8 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_8 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_oldLine, Py_True}; + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_x = values[0]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("lambda10", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1235, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("collisions.Line.handleCollisionsPos.lambda10", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_lambda_funcdef_lambda10(__pyx_self, __pyx_v_x); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_lambda10(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { + 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("lambda10", 1); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1235, __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("collisions.Line.handleCollisionsPos.lambda10", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":1257 + * return newLine, vel, [None, False] + * return newLine, vel + * points.sort(key=lambda x: x[3]) # <<<<<<<<<<<<<< + * closestP = points[0][0] # Closest point on the OTHER object + * cPoint = points[0][2] # closestP projected onto the oldLine + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_4Line_19handleCollisionsPos_2lambda11(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_10collisions_4Line_19handleCollisionsPos_2lambda11 = {"lambda11", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_19handleCollisionsPos_2lambda11, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_4Line_19handleCollisionsPos_2lambda11(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_x = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda11 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1257, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda11") < 0)) __PYX_ERR(0, 1257, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_x = values[0]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("lambda11", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1257, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("collisions.Line.handleCollisionsPos.lambda11", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_lambda_funcdef_lambda11(__pyx_self, __pyx_v_x); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_lambda11(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { + 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("lambda11", 1); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1257, __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("collisions.Line.handleCollisionsPos.lambda11", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":1279 + * paralell = True + * if cLine is not None: + * sortedOtherLn = Line(*sorted([cLine.p1, cLine.p2], key=lambda x: x[0])) # <<<<<<<<<<<<<< + * otherLnNormal = math.degrees(math.atan2(sortedOtherLn[0][1]-sortedOtherLn[1][1], sortedOtherLn[0][0]-sortedOtherLn[1][0])) + * paralell = abs(otherLnNormal%360 - thisNormal%360) < precision or abs((otherLnNormal-180)%360 - thisNormal%360) < precision + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_4Line_19handleCollisionsPos_3lambda12(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_10collisions_4Line_19handleCollisionsPos_3lambda12 = {"lambda12", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_4Line_19handleCollisionsPos_3lambda12, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_4Line_19handleCollisionsPos_3lambda12(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_x = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda12 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1279, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda12") < 0)) __PYX_ERR(0, 1279, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_x = values[0]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("lambda12", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1279, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("collisions.Line.handleCollisionsPos.lambda12", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_lambda_funcdef_lambda12(__pyx_self, __pyx_v_x); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_lambda_funcdef_lambda12(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { + 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("lambda12", 1); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1279, __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("collisions.Line.handleCollisionsPos.lambda12", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":1202 + * return [(phi-180)%360, phi % 360][tries.index(min(tries))] + * + * def handleCollisionsPos(self, # <<<<<<<<<<<<<< + * oldLine: 'Line', + * newLine: 'Line', + */ + +static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_oldLine, PyObject *__pyx_v_newLine, PyObject *__pyx_v_objs, PyObject *__pyx_v_vel, PyObject *__pyx_v_replaceSelf, PyObject *__pyx_v_precision, PyObject *__pyx_v_verbose) { + PyObject *__pyx_v_mvement = NULL; + PyObject *__pyx_v_points = NULL; + int __pyx_v_hit; + PyObject *__pyx_v_o = NULL; + PyObject *__pyx_v_ps = NULL; + PyObject *__pyx_v_p = NULL; + PyObject *__pyx_v_cPoint = NULL; + PyObject *__pyx_v_closestP = NULL; + PyObject *__pyx_v_closestObj = NULL; + PyObject *__pyx_v_newPoint = NULL; + PyObject *__pyx_v_thisNormal = NULL; + PyObject *__pyx_v_paralell = NULL; + PyObject *__pyx_v_thisIsOnP = NULL; + PyObject *__pyx_v_cLine = NULL; + PyObject *__pyx_v_colllidingLns = NULL; + PyObject *__pyx_v_sortedOtherLn = NULL; + PyObject *__pyx_v_otherLnNormal = NULL; + PyObject *__pyx_v_velDiff = NULL; + PyObject *__pyx_v_collTyp = NULL; + PyObject *__pyx_v_normal = NULL; + PyObject *__pyx_v_phi = NULL; + PyObject *__pyx_v_otherIsOnP = NULL; + PyObject *__pyx_v_dist_left = NULL; + PyObject *__pyx_v_diff = NULL; + PyObject *__pyx_v_pos = NULL; + PyObject *__pyx_v_diff2Point = NULL; + PyObject *__pyx_v_odiff = NULL; + PyObject *__pyx_v_smallness = NULL; + PyObject *__pyx_v_newp1 = NULL; + PyObject *__pyx_v_newp2 = NULL; + PyObject *__pyx_v_out = NULL; + PyObject *__pyx_v_outvel = NULL; + PyObject *__pyx_9genexpr20__pyx_v_i = NULL; + PyObject *__pyx_9genexpr21__pyx_v_i = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + unsigned int __pyx_t_8; + int __pyx_t_9; + Py_ssize_t __pyx_t_10; + PyObject *(*__pyx_t_11)(PyObject *); + Py_ssize_t __pyx_t_12; + PyObject *(*__pyx_t_13)(PyObject *); + PyObject *__pyx_t_14 = NULL; + PyObject *__pyx_t_15 = NULL; + PyObject *__pyx_t_16 = NULL; + int __pyx_t_17; + int __pyx_t_18; + int __pyx_t_19; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("handleCollisionsPos", 0); + __Pyx_INCREF(__pyx_v_oldLine); + __Pyx_INCREF(__pyx_v_newLine); + __Pyx_INCREF(__pyx_v_vel); + + /* "collisions.py":1234 + * DidReflect (bool): Whether the line reflected off of something + * """ + * oldLine = Line(*sorted([oldLine.p1, oldLine.p2], key=lambda x: x[0])) # <<<<<<<<<<<<<< + * newLine = Line(*sorted([newLine.p1, newLine.p2], key=lambda x: x[0])) + * mvement = Polygon(oldLine.p1, oldLine.p2, newLine.p2, newLine.p1) + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Line); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 1234, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 1234, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 1234, __pyx_L1_error); + __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_19handleCollisionsPos_lambda9, 0, __pyx_n_s_Line_handleCollisionsPos_locals, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_key, __pyx_t_2) < 0) __PYX_ERR(0, 1234, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1234, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_oldLine, __pyx_t_2); + __pyx_t_2 = 0; + + /* "collisions.py":1235 + * """ + * oldLine = Line(*sorted([oldLine.p1, oldLine.p2], key=lambda x: x[0])) + * newLine = Line(*sorted([newLine.p1, newLine.p2], key=lambda x: x[0])) # <<<<<<<<<<<<<< + * mvement = Polygon(oldLine.p1, oldLine.p2, newLine.p2, newLine.p1) + * # Don't let you move when you're in a wall + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 1235, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 1235, __pyx_L1_error); + __pyx_t_4 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 1235, __pyx_L1_error); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_19handleCollisionsPos_1lambda10, 0, __pyx_n_s_Line_handleCollisionsPos_locals, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_key, __pyx_t_4) < 0) __PYX_ERR(0, 1235, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1235, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF_SET(__pyx_v_newLine, __pyx_t_4); + __pyx_t_4 = 0; + + /* "collisions.py":1236 + * oldLine = Line(*sorted([oldLine.p1, oldLine.p2], key=lambda x: x[0])) + * newLine = Line(*sorted([newLine.p1, newLine.p2], key=lambda x: x[0])) + * mvement = Polygon(oldLine.p1, oldLine.p2, newLine.p2, newLine.p1) # <<<<<<<<<<<<<< + * # Don't let you move when you're in a wall + * if oldLine.collides(objs): + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = NULL; + __pyx_t_8 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_8 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[5] = {__pyx_t_7, __pyx_t_2, __pyx_t_1, __pyx_t_5, __pyx_t_6}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 4+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1236, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_v_mvement = __pyx_t_4; + __pyx_t_4 = 0; + + /* "collisions.py":1238 + * mvement = Polygon(oldLine.p1, oldLine.p2, newLine.p2, newLine.p1) + * # Don't let you move when you're in a wall + * if oldLine.collides(objs): # <<<<<<<<<<<<<< + * if verbose: + * return oldLine, [0, 0], [None, True] + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = NULL; + __pyx_t_8 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_8 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_objs}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1238, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1238, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_9) { + + /* "collisions.py":1239 + * # Don't let you move when you're in a wall + * if oldLine.collides(objs): + * if verbose: # <<<<<<<<<<<<<< + * return oldLine, [0, 0], [None, True] + * return oldLine, [0, 0] + */ + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1239, __pyx_L1_error) + if (__pyx_t_9) { + + /* "collisions.py":1240 + * if oldLine.collides(objs): + * if verbose: + * return oldLine, [0, 0], [None, True] # <<<<<<<<<<<<<< + * return oldLine, [0, 0] + * points = [] + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1240, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_int_0)) __PYX_ERR(0, 1240, __pyx_L1_error); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_int_0)) __PYX_ERR(0, 1240, __pyx_L1_error); + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1240, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, Py_None)) __PYX_ERR(0, 1240, __pyx_L1_error); + __Pyx_INCREF(Py_True); + __Pyx_GIVEREF(Py_True); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, Py_True)) __PYX_ERR(0, 1240, __pyx_L1_error); + __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1240, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_v_oldLine); + __Pyx_GIVEREF(__pyx_v_oldLine); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_oldLine)) __PYX_ERR(0, 1240, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4)) __PYX_ERR(0, 1240, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3)) __PYX_ERR(0, 1240, __pyx_L1_error); + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_r = ((PyObject*)__pyx_t_6); + __pyx_t_6 = 0; + goto __pyx_L0; + + /* "collisions.py":1239 + * # Don't let you move when you're in a wall + * if oldLine.collides(objs): + * if verbose: # <<<<<<<<<<<<<< + * return oldLine, [0, 0], [None, True] + * return oldLine, [0, 0] + */ + } + + /* "collisions.py":1241 + * if verbose: + * return oldLine, [0, 0], [None, True] + * return oldLine, [0, 0] # <<<<<<<<<<<<<< + * points = [] + * hit = False + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_int_0)) __PYX_ERR(0, 1241, __pyx_L1_error); + __Pyx_INCREF(__pyx_int_0); + __Pyx_GIVEREF(__pyx_int_0); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_int_0)) __PYX_ERR(0, 1241, __pyx_L1_error); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_oldLine); + __Pyx_GIVEREF(__pyx_v_oldLine); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_oldLine)) __PYX_ERR(0, 1241, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6)) __PYX_ERR(0, 1241, __pyx_L1_error); + __pyx_t_6 = 0; + __pyx_r = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "collisions.py":1238 + * mvement = Polygon(oldLine.p1, oldLine.p2, newLine.p2, newLine.p1) + * # Don't let you move when you're in a wall + * if oldLine.collides(objs): # <<<<<<<<<<<<<< + * if verbose: + * return oldLine, [0, 0], [None, True] + */ + } + + /* "collisions.py":1242 + * return oldLine, [0, 0], [None, True] + * return oldLine, [0, 0] + * points = [] # <<<<<<<<<<<<<< + * hit = False + * for o in objs: + */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_points = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + + /* "collisions.py":1243 + * return oldLine, [0, 0] + * points = [] + * hit = False # <<<<<<<<<<<<<< + * for o in objs: + * if o.collides(mvement): + */ + __pyx_v_hit = 0; + + /* "collisions.py":1244 + * points = [] + * hit = False + * for o in objs: # <<<<<<<<<<<<<< + * if o.collides(mvement): + * hit = True + */ + if (likely(PyList_CheckExact(__pyx_v_objs)) || PyTuple_CheckExact(__pyx_v_objs)) { + __pyx_t_3 = __pyx_v_objs; __Pyx_INCREF(__pyx_t_3); + __pyx_t_10 = 0; + __pyx_t_11 = NULL; + } else { + __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_objs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1244, __pyx_L1_error) + } + for (;;) { + if (likely(!__pyx_t_11)) { + if (likely(PyList_CheckExact(__pyx_t_3))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1244, __pyx_L1_error) + #endif + if (__pyx_t_10 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1244, __pyx_L1_error) + #else + __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1244, __pyx_L1_error) + #endif + if (__pyx_t_10 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1244, __pyx_L1_error) + #else + __pyx_t_6 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1244, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + #endif + } + } else { + __pyx_t_6 = __pyx_t_11(__pyx_t_3); + if (unlikely(!__pyx_t_6)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 1244, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_6); + } + __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_6); + __pyx_t_6 = 0; + + /* "collisions.py":1245 + * hit = False + * for o in objs: + * if o.collides(mvement): # <<<<<<<<<<<<<< + * hit = True + * ps = o.whereCollides(mvement) + [i for i in o.closestPointTo(oldLine, True) if mvement.collides(Point(*i))] + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_8 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_8 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_mvement}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1245, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__pyx_t_9) { + + /* "collisions.py":1246 + * for o in objs: + * if o.collides(mvement): + * hit = True # <<<<<<<<<<<<<< + * ps = o.whereCollides(mvement) + [i for i in o.closestPointTo(oldLine, True) if mvement.collides(Point(*i))] + * for p in ps: + */ + __pyx_v_hit = 1; + + /* "collisions.py":1247 + * if o.collides(mvement): + * hit = True + * ps = o.whereCollides(mvement) + [i for i in o.closestPointTo(oldLine, True) if mvement.collides(Point(*i))] # <<<<<<<<<<<<<< + * for p in ps: + * # The rotation is making sure the line crosses the oldLine + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = NULL; + __pyx_t_8 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_5)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_5); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_8 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_mvement}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); + __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1247, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + { /* enter inner scope */ + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1247, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1247, __pyx_L10_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = NULL; + __pyx_t_8 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_8 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_oldLine, Py_True}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1214, __pyx_L10_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1247, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -41178,9 +42530,9 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __pyx_t_12 = 0; __pyx_t_13 = NULL; } else { - __pyx_t_12 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1214, __pyx_L10_error) + __pyx_t_12 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1247, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1214, __pyx_L10_error) + __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1247, __pyx_L10_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; for (;;) { @@ -41189,28 +42541,28 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1214, __pyx_L10_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1247, __pyx_L10_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_12); __Pyx_INCREF(__pyx_t_5); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1214, __pyx_L10_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_12); __Pyx_INCREF(__pyx_t_5); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1247, __pyx_L10_error) #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1214, __pyx_L10_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1247, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1214, __pyx_L10_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1247, __pyx_L10_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_12); __Pyx_INCREF(__pyx_t_5); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1214, __pyx_L10_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_12); __Pyx_INCREF(__pyx_t_5); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1247, __pyx_L10_error) #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1214, __pyx_L10_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1247, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -41220,7 +42572,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1214, __pyx_L10_error) + else __PYX_ERR(0, 1247, __pyx_L10_error) } break; } @@ -41228,13 +42580,13 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED } __Pyx_XDECREF_SET(__pyx_9genexpr20__pyx_v_i, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_mvement, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1214, __pyx_L10_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_mvement, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1247, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1214, __pyx_L10_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1247, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_14 = __Pyx_PySequence_Tuple(__pyx_9genexpr20__pyx_v_i); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1214, __pyx_L10_error) + __pyx_t_14 = __Pyx_PySequence_Tuple(__pyx_9genexpr20__pyx_v_i); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1247, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_14, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1214, __pyx_L10_error) + __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_14, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1247, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; @@ -41257,14 +42609,14 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1214, __pyx_L10_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1247, __pyx_L10_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1214, __pyx_L10_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1247, __pyx_L10_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_9) { - if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_9genexpr20__pyx_v_i))) __PYX_ERR(0, 1214, __pyx_L10_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_9genexpr20__pyx_v_i))) __PYX_ERR(0, 1247, __pyx_L10_error) } } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -41275,14 +42627,14 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED goto __pyx_L1_error; __pyx_L15_exit_scope:; } /* exit inner scope */ - __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1214, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_ps, __pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":1215 + /* "collisions.py":1248 * hit = True * ps = o.whereCollides(mvement) + [i for i in o.closestPointTo(oldLine, True) if mvement.collides(Point(*i))] * for p in ps: # <<<<<<<<<<<<<< @@ -41294,9 +42646,9 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __pyx_t_12 = 0; __pyx_t_13 = NULL; } else { - __pyx_t_12 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_ps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1215, __pyx_L1_error) + __pyx_t_12 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_ps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1215, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1248, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_13)) { @@ -41304,28 +42656,28 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1215, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1248, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1215, __pyx_L1_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1248, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1215, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1215, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1248, __pyx_L1_error) #endif if (__pyx_t_12 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1215, __pyx_L1_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1248, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1215, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -41335,7 +42687,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1215, __pyx_L1_error) + else __PYX_ERR(0, 1248, __pyx_L1_error) } break; } @@ -41344,39 +42696,39 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":1217 + /* "collisions.py":1250 * for p in ps: * # The rotation is making sure the line crosses the oldLine * cPoint = oldLine.closestPointTo(Line(p, (p[0]-vel[0],p[1]-vel[1]))) # <<<<<<<<<<<<<< * points.append([p, o, cPoint, abs(p[0]-cPoint[0])**2+abs(p[1]-cPoint[1])**2]) * #points.extend(list(zip(cs, [o for _ in range(len(cs))]))) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1217, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1217, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1217, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1217, __pyx_L1_error) + __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_7 = PyNumber_Subtract(__pyx_t_15, __pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1217, __pyx_L1_error) + __pyx_t_7 = PyNumber_Subtract(__pyx_t_15, __pyx_t_14); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1217, __pyx_L1_error) + __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1217, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_16 = PyNumber_Subtract(__pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1217, __pyx_L1_error) + __pyx_t_16 = PyNumber_Subtract(__pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1217, __pyx_L1_error) + __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_7)) __PYX_ERR(0, 1217, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_7)) __PYX_ERR(0, 1250, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_16); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_16)) __PYX_ERR(0, 1217, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_16)) __PYX_ERR(0, 1250, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_16 = 0; __pyx_t_16 = NULL; @@ -41398,7 +42750,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1217, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -41421,70 +42773,70 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1217, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_XDECREF_SET(__pyx_v_cPoint, __pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":1218 + /* "collisions.py":1251 * # The rotation is making sure the line crosses the oldLine * cPoint = oldLine.closestPointTo(Line(p, (p[0]-vel[0],p[1]-vel[1]))) * points.append([p, o, cPoint, abs(p[0]-cPoint[0])**2+abs(p[1]-cPoint[1])**2]) # <<<<<<<<<<<<<< * #points.extend(list(zip(cs, [o for _ in range(len(cs))]))) * if not hit: */ - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1218, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_cPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1218, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_cPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyNumber_Subtract(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1218, __pyx_L1_error) + __pyx_t_5 = PyNumber_Subtract(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1218, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Power(__pyx_t_6, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1218, __pyx_L1_error) + __pyx_t_5 = PyNumber_Power(__pyx_t_6, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1218, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_cPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1218, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_cPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1218, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1251, __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_t_4 = __Pyx_PyNumber_Absolute(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1218, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyNumber_Absolute(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1218, __pyx_L1_error) + __pyx_t_2 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1218, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1218, __pyx_L1_error) + __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_p); __Pyx_GIVEREF(__pyx_v_p); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_p)) __PYX_ERR(0, 1218, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_p)) __PYX_ERR(0, 1251, __pyx_L1_error); __Pyx_INCREF(__pyx_v_o); __Pyx_GIVEREF(__pyx_v_o); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_v_o)) __PYX_ERR(0, 1218, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_v_o)) __PYX_ERR(0, 1251, __pyx_L1_error); __Pyx_INCREF(__pyx_v_cPoint); __Pyx_GIVEREF(__pyx_v_cPoint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_v_cPoint)) __PYX_ERR(0, 1218, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 2, __pyx_v_cPoint)) __PYX_ERR(0, 1251, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 3, __pyx_t_4)) __PYX_ERR(0, 1218, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 3, __pyx_t_4)) __PYX_ERR(0, 1251, __pyx_L1_error); __pyx_t_4 = 0; - __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_points, __pyx_t_2); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 1218, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_points, __pyx_t_2); if (unlikely(__pyx_t_17 == ((int)-1))) __PYX_ERR(0, 1251, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":1215 + /* "collisions.py":1248 * hit = True * ps = o.whereCollides(mvement) + [i for i in o.closestPointTo(oldLine, True) if mvement.collides(Point(*i))] * for p in ps: # <<<<<<<<<<<<<< @@ -41494,7 +42846,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":1212 + /* "collisions.py":1245 * hit = False * for o in objs: * if o.collides(mvement): # <<<<<<<<<<<<<< @@ -41503,7 +42855,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED */ } - /* "collisions.py":1211 + /* "collisions.py":1244 * points = [] * hit = False * for o in objs: # <<<<<<<<<<<<<< @@ -41513,7 +42865,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1220 + /* "collisions.py":1253 * points.append([p, o, cPoint, abs(p[0]-cPoint[0])**2+abs(p[1]-cPoint[1])**2]) * #points.extend(list(zip(cs, [o for _ in range(len(cs))]))) * if not hit: # <<<<<<<<<<<<<< @@ -41523,17 +42875,17 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __pyx_t_9 = (!__pyx_v_hit); if (__pyx_t_9) { - /* "collisions.py":1221 + /* "collisions.py":1254 * #points.extend(list(zip(cs, [o for _ in range(len(cs))]))) * if not hit: * if verbose: # <<<<<<<<<<<<<< * return newLine, vel, [None, False] * return newLine, vel */ - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1221, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1254, __pyx_L1_error) if (__pyx_t_9) { - /* "collisions.py":1222 + /* "collisions.py":1255 * if not hit: * if verbose: * return newLine, vel, [None, False] # <<<<<<<<<<<<<< @@ -41541,30 +42893,30 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED * points.sort(key=lambda x: x[3]) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1222, __pyx_L1_error) + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, Py_None)) __PYX_ERR(0, 1222, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, Py_None)) __PYX_ERR(0, 1255, __pyx_L1_error); __Pyx_INCREF(Py_False); __Pyx_GIVEREF(Py_False); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, Py_False)) __PYX_ERR(0, 1222, __pyx_L1_error); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1222, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, Py_False)) __PYX_ERR(0, 1255, __pyx_L1_error); + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_newLine); __Pyx_GIVEREF(__pyx_v_newLine); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_newLine)) __PYX_ERR(0, 1222, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_newLine)) __PYX_ERR(0, 1255, __pyx_L1_error); __Pyx_INCREF(__pyx_v_vel); __Pyx_GIVEREF(__pyx_v_vel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_vel)) __PYX_ERR(0, 1222, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_vel)) __PYX_ERR(0, 1255, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_3)) __PYX_ERR(0, 1222, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_3)) __PYX_ERR(0, 1255, __pyx_L1_error); __pyx_t_3 = 0; __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1221 + /* "collisions.py":1254 * #points.extend(list(zip(cs, [o for _ in range(len(cs))]))) * if not hit: * if verbose: # <<<<<<<<<<<<<< @@ -41573,7 +42925,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED */ } - /* "collisions.py":1223 + /* "collisions.py":1256 * if verbose: * return newLine, vel, [None, False] * return newLine, vel # <<<<<<<<<<<<<< @@ -41581,19 +42933,19 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED * closestP = points[0][0] # Closest point on the OTHER object */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1223, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_newLine); __Pyx_GIVEREF(__pyx_v_newLine); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_newLine)) __PYX_ERR(0, 1223, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_newLine)) __PYX_ERR(0, 1256, __pyx_L1_error); __Pyx_INCREF(__pyx_v_vel); __Pyx_GIVEREF(__pyx_v_vel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_vel)) __PYX_ERR(0, 1223, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_vel)) __PYX_ERR(0, 1256, __pyx_L1_error); __pyx_r = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1220 + /* "collisions.py":1253 * points.append([p, o, cPoint, abs(p[0]-cPoint[0])**2+abs(p[1]-cPoint[1])**2]) * #points.extend(list(zip(cs, [o for _ in range(len(cs))]))) * if not hit: # <<<<<<<<<<<<<< @@ -41602,105 +42954,105 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED */ } - /* "collisions.py":1224 + /* "collisions.py":1257 * return newLine, vel, [None, False] * return newLine, vel * points.sort(key=lambda x: x[3]) # <<<<<<<<<<<<<< * closestP = points[0][0] # Closest point on the OTHER object * cPoint = points[0][2] # closestP projected onto the oldLine */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_points, __pyx_n_s_sort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_points, __pyx_n_s_sort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1224, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_19handleCollisionsPos_2lambda11, 0, __pyx_n_s_Line_handleCollisionsPos_locals, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1224, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_19handleCollisionsPos_2lambda11, 0, __pyx_n_s_Line_handleCollisionsPos_locals, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_key, __pyx_t_2) < 0) __PYX_ERR(0, 1224, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_key, __pyx_t_2) < 0) __PYX_ERR(0, 1257, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1224, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":1225 + /* "collisions.py":1258 * return newLine, vel * points.sort(key=lambda x: x[3]) * closestP = points[0][0] # Closest point on the OTHER object # <<<<<<<<<<<<<< * cPoint = points[0][2] # closestP projected onto the oldLine * closestObj = points[0][1] */ - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_points, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1225, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_points, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1225, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_closestP = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":1226 + /* "collisions.py":1259 * points.sort(key=lambda x: x[3]) * closestP = points[0][0] # Closest point on the OTHER object * cPoint = points[0][2] # closestP projected onto the oldLine # <<<<<<<<<<<<<< * closestObj = points[0][1] * newPoint = newLine.closestPointTo(Line(closestP, (closestP[0]+vel[0],closestP[1]+vel[1]))) # closestP projected onto the newLine */ - __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_points, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1226, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_points, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1226, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_cPoint, __pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":1227 + /* "collisions.py":1260 * closestP = points[0][0] # Closest point on the OTHER object * cPoint = points[0][2] # closestP projected onto the oldLine * closestObj = points[0][1] # <<<<<<<<<<<<<< * newPoint = newLine.closestPointTo(Line(closestP, (closestP[0]+vel[0],closestP[1]+vel[1]))) # closestP projected onto the newLine * */ - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_points, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1227, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_points, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1227, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_closestObj = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":1228 + /* "collisions.py":1261 * cPoint = points[0][2] # closestP projected onto the oldLine * closestObj = points[0][1] * newPoint = newLine.closestPointTo(Line(closestP, (closestP[0]+vel[0],closestP[1]+vel[1]))) # closestP projected onto the newLine # <<<<<<<<<<<<<< * * thisNormal = math.degrees(math.atan2(oldLine[0][1]-oldLine[1][1], oldLine[0][0]-oldLine[1][0])) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1228, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Line); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1228, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Line); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1228, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1228, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_15 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1228, __pyx_L1_error) + __pyx_t_15 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1228, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1228, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_16 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1228, __pyx_L1_error) + __pyx_t_16 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1228, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_15); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_15)) __PYX_ERR(0, 1228, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_15)) __PYX_ERR(0, 1261, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_16); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_16)) __PYX_ERR(0, 1228, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_16)) __PYX_ERR(0, 1261, __pyx_L1_error); __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_16 = NULL; @@ -41722,7 +43074,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1228, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -41745,55 +43097,55 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1228, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_newPoint = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":1230 + /* "collisions.py":1263 * newPoint = newLine.closestPointTo(Line(closestP, (closestP[0]+vel[0],closestP[1]+vel[1]))) # closestP projected onto the newLine * * thisNormal = math.degrees(math.atan2(oldLine[0][1]-oldLine[1][1], oldLine[0][0]-oldLine[1][0])) # <<<<<<<<<<<<<< * paralell = False * thisIsOnP = oldLine.isCorner(cPoint, precision) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1230, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_degrees); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1230, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_degrees); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1230, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_atan2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1230, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_atan2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_oldLine, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1230, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_oldLine, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1230, __pyx_L1_error) + __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_oldLine, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1230, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_oldLine, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1230, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Subtract(__pyx_t_16, __pyx_t_15); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1230, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_16, __pyx_t_15); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_oldLine, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1230, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_oldLine, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_15, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1230, __pyx_L1_error) + __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_15, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_oldLine, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1230, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_oldLine, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_15, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1230, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_15, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyNumber_Subtract(__pyx_t_16, __pyx_t_6); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1230, __pyx_L1_error) + __pyx_t_15 = PyNumber_Subtract(__pyx_t_16, __pyx_t_6); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -41817,7 +43169,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1230, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -41840,14 +43192,14 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1230, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_v_thisNormal = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":1231 + /* "collisions.py":1264 * * thisNormal = math.degrees(math.atan2(oldLine[0][1]-oldLine[1][1], oldLine[0][0]-oldLine[1][0])) * paralell = False # <<<<<<<<<<<<<< @@ -41857,14 +43209,14 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __Pyx_INCREF(Py_False); __pyx_v_paralell = Py_False; - /* "collisions.py":1232 + /* "collisions.py":1265 * thisNormal = math.degrees(math.atan2(oldLine[0][1]-oldLine[1][1], oldLine[0][0]-oldLine[1][0])) * paralell = False * thisIsOnP = oldLine.isCorner(cPoint, precision) # <<<<<<<<<<<<<< * if checkShpType(closestObj, ShpGroups.NOTSTRAIGHT): * paralell = not thisIsOnP */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_isCorner); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1232, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_isCorner); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; __pyx_t_8 = 0; @@ -41884,25 +43236,25 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_cPoint, __pyx_v_precision}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1232, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_v_thisIsOnP = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":1233 + /* "collisions.py":1266 * paralell = False * thisIsOnP = oldLine.isCorner(cPoint, precision) * if checkShpType(closestObj, ShpGroups.NOTSTRAIGHT): # <<<<<<<<<<<<<< * paralell = not thisIsOnP * if not paralell: */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1233, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1233, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NOTSTRAIGHT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1233, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_NOTSTRAIGHT); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -41924,28 +43276,28 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1233, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1233, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1266, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_9) { - /* "collisions.py":1234 + /* "collisions.py":1267 * thisIsOnP = oldLine.isCorner(cPoint, precision) * if checkShpType(closestObj, ShpGroups.NOTSTRAIGHT): * paralell = not thisIsOnP # <<<<<<<<<<<<<< * if not paralell: * cLine = None */ - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1234, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyBool_FromLong((!__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1234, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1267, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyBool_FromLong((!__pyx_t_9)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_paralell, __pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1233 + /* "collisions.py":1266 * paralell = False * thisIsOnP = oldLine.isCorner(cPoint, precision) * if checkShpType(closestObj, ShpGroups.NOTSTRAIGHT): # <<<<<<<<<<<<<< @@ -41954,18 +43306,18 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED */ } - /* "collisions.py":1235 + /* "collisions.py":1268 * if checkShpType(closestObj, ShpGroups.NOTSTRAIGHT): * paralell = not thisIsOnP * if not paralell: # <<<<<<<<<<<<<< * cLine = None * if checkShpType(closestObj, ShpTyps.Line): */ - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_paralell); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1235, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_paralell); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1268, __pyx_L1_error) __pyx_t_18 = (!__pyx_t_9); if (__pyx_t_18) { - /* "collisions.py":1236 + /* "collisions.py":1269 * paralell = not thisIsOnP * if not paralell: * cLine = None # <<<<<<<<<<<<<< @@ -41975,18 +43327,18 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __Pyx_INCREF(Py_None); __pyx_v_cLine = Py_None; - /* "collisions.py":1237 + /* "collisions.py":1270 * if not paralell: * cLine = None * if checkShpType(closestObj, ShpTyps.Line): # <<<<<<<<<<<<<< * cLine = closestObj * elif checkShpType(closestObj, ShpGroups.CLOSED): */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1237, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1237, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1237, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -42008,15 +43360,15 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1237, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1237, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_18) { - /* "collisions.py":1238 + /* "collisions.py":1271 * cLine = None * if checkShpType(closestObj, ShpTyps.Line): * cLine = closestObj # <<<<<<<<<<<<<< @@ -42026,7 +43378,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __Pyx_INCREF(__pyx_v_closestObj); __Pyx_DECREF_SET(__pyx_v_cLine, __pyx_v_closestObj); - /* "collisions.py":1237 + /* "collisions.py":1270 * if not paralell: * cLine = None * if checkShpType(closestObj, ShpTyps.Line): # <<<<<<<<<<<<<< @@ -42036,18 +43388,18 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED goto __pyx_L24; } - /* "collisions.py":1239 + /* "collisions.py":1272 * if checkShpType(closestObj, ShpTyps.Line): * cLine = closestObj * elif checkShpType(closestObj, ShpGroups.CLOSED): # <<<<<<<<<<<<<< * colllidingLns = [i for i in closestObj.toLines() if i.collides(Point(*closestP))] * if colllidingLns != []: */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1239, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1239, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_CLOSED); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1239, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_CLOSED); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -42069,15 +43421,15 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1239, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1239, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1272, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_18) { - /* "collisions.py":1240 + /* "collisions.py":1273 * cLine = closestObj * elif checkShpType(closestObj, ShpGroups.CLOSED): * colllidingLns = [i for i in closestObj.toLines() if i.collides(Point(*closestP))] # <<<<<<<<<<<<<< @@ -42085,9 +43437,9 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED * cLine = colllidingLns[0] */ { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1240, __pyx_L27_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1273, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_toLines); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1240, __pyx_L27_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_toLines); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1273, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = NULL; __pyx_t_8 = 0; @@ -42107,7 +43459,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1240, __pyx_L27_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1273, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -42116,9 +43468,9 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1240, __pyx_L27_error) + __pyx_t_10 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1273, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1240, __pyx_L27_error) + __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1273, __pyx_L27_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -42127,28 +43479,28 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1240, __pyx_L27_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1273, __pyx_L27_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1240, __pyx_L27_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1273, __pyx_L27_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1240, __pyx_L27_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1273, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1240, __pyx_L27_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1273, __pyx_L27_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1240, __pyx_L27_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1273, __pyx_L27_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1240, __pyx_L27_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1273, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -42158,7 +43510,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1240, __pyx_L27_error) + else __PYX_ERR(0, 1273, __pyx_L27_error) } break; } @@ -42166,13 +43518,13 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED } __Pyx_XDECREF_SET(__pyx_9genexpr21__pyx_v_i, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr21__pyx_v_i, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1240, __pyx_L27_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr21__pyx_v_i, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1273, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_Point); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1240, __pyx_L27_error) + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_Point); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1273, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_closestP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1240, __pyx_L27_error) + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_closestP); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1273, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1240, __pyx_L27_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1273, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -42195,14 +43547,14 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1240, __pyx_L27_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1273, __pyx_L27_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1240, __pyx_L27_error) + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1273, __pyx_L27_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_18) { - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_9genexpr21__pyx_v_i))) __PYX_ERR(0, 1240, __pyx_L27_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_9genexpr21__pyx_v_i))) __PYX_ERR(0, 1273, __pyx_L27_error) } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -42216,34 +43568,34 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __pyx_v_colllidingLns = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1241 + /* "collisions.py":1274 * elif checkShpType(closestObj, ShpGroups.CLOSED): * colllidingLns = [i for i in closestObj.toLines() if i.collides(Point(*closestP))] * if colllidingLns != []: # <<<<<<<<<<<<<< * cLine = colllidingLns[0] * elif checkShpType(closestObj, ShpTyps.Circle) and (not thisIsOnP): */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1241, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_colllidingLns, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1241, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_v_colllidingLns, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1274, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1241, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1274, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_18) { - /* "collisions.py":1242 + /* "collisions.py":1275 * colllidingLns = [i for i in closestObj.toLines() if i.collides(Point(*closestP))] * if colllidingLns != []: * cLine = colllidingLns[0] # <<<<<<<<<<<<<< * elif checkShpType(closestObj, ShpTyps.Circle) and (not thisIsOnP): * paralell = True */ - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_colllidingLns, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1242, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_colllidingLns, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_cLine, __pyx_t_5); __pyx_t_5 = 0; - /* "collisions.py":1241 + /* "collisions.py":1274 * elif checkShpType(closestObj, ShpGroups.CLOSED): * colllidingLns = [i for i in closestObj.toLines() if i.collides(Point(*closestP))] * if colllidingLns != []: # <<<<<<<<<<<<<< @@ -42252,7 +43604,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED */ } - /* "collisions.py":1239 + /* "collisions.py":1272 * if checkShpType(closestObj, ShpTyps.Line): * cLine = closestObj * elif checkShpType(closestObj, ShpGroups.CLOSED): # <<<<<<<<<<<<<< @@ -42262,18 +43614,18 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED goto __pyx_L24; } - /* "collisions.py":1243 + /* "collisions.py":1276 * if colllidingLns != []: * cLine = colllidingLns[0] * elif checkShpType(closestObj, ShpTyps.Circle) and (not thisIsOnP): # <<<<<<<<<<<<<< * paralell = True * if cLine is not None: */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1243, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1243, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Circle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1243, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Circle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -42295,24 +43647,24 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1243, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1243, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1276, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_9) { } else { __pyx_t_18 = __pyx_t_9; goto __pyx_L34_bool_binop_done; } - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1243, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1276, __pyx_L1_error) __pyx_t_19 = (!__pyx_t_9); __pyx_t_18 = __pyx_t_19; __pyx_L34_bool_binop_done:; if (__pyx_t_18) { - /* "collisions.py":1244 + /* "collisions.py":1277 * cLine = colllidingLns[0] * elif checkShpType(closestObj, ShpTyps.Circle) and (not thisIsOnP): * paralell = True # <<<<<<<<<<<<<< @@ -42322,7 +43674,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __Pyx_INCREF(Py_True); __Pyx_DECREF_SET(__pyx_v_paralell, Py_True); - /* "collisions.py":1243 + /* "collisions.py":1276 * if colllidingLns != []: * cLine = colllidingLns[0] * elif checkShpType(closestObj, ShpTyps.Circle) and (not thisIsOnP): # <<<<<<<<<<<<<< @@ -42332,7 +43684,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED } __pyx_L24:; - /* "collisions.py":1245 + /* "collisions.py":1278 * elif checkShpType(closestObj, ShpTyps.Circle) and (not thisIsOnP): * paralell = True * if cLine is not None: # <<<<<<<<<<<<<< @@ -42342,94 +43694,94 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __pyx_t_18 = (__pyx_v_cLine != Py_None); if (__pyx_t_18) { - /* "collisions.py":1246 + /* "collisions.py":1279 * paralell = True * if cLine is not None: * sortedOtherLn = Line(*sorted([cLine.p1, cLine.p2], key=lambda x: x[0])) # <<<<<<<<<<<<<< * otherLnNormal = math.degrees(math.atan2(sortedOtherLn[0][1]-sortedOtherLn[1][1], sortedOtherLn[0][0]-sortedOtherLn[1][0])) * paralell = abs(otherLnNormal%360 - thisNormal%360) < precision or abs((otherLnNormal-180)%360 - thisNormal%360) < precision */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Line); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1246, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Line); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1246, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1246, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1246, __pyx_L1_error) + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 1246, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 1279, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 1246, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 1279, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1246, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1246, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1279, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1246, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_19handleCollisionsPos_3lambda12, 0, __pyx_n_s_Line_handleCollisionsPos_locals, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1246, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_19handleCollisionsPos_3lambda12, 0, __pyx_n_s_Line_handleCollisionsPos_locals, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_t_3) < 0) __PYX_ERR(0, 1246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_t_3) < 0) __PYX_ERR(0, 1279, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1246, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1246, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1246, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1279, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sortedOtherLn = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":1247 + /* "collisions.py":1280 * if cLine is not None: * sortedOtherLn = Line(*sorted([cLine.p1, cLine.p2], key=lambda x: x[0])) * otherLnNormal = math.degrees(math.atan2(sortedOtherLn[0][1]-sortedOtherLn[1][1], sortedOtherLn[0][0]-sortedOtherLn[1][0])) # <<<<<<<<<<<<<< * paralell = abs(otherLnNormal%360 - thisNormal%360) < precision or abs((otherLnNormal-180)%360 - thisNormal%360) < precision * velDiff = 180 */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1247, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_degrees); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1247, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_degrees); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1247, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_atan2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1247, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_atan2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_sortedOtherLn, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_sortedOtherLn, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1247, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_sortedOtherLn, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1247, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_sortedOtherLn, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1247, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Subtract(__pyx_t_4, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1247, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_t_4, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_sortedOtherLn, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1247, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_sortedOtherLn, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_15, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1247, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_15, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_sortedOtherLn, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1247, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_sortedOtherLn, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_15, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1247, __pyx_L1_error) + __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_15, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyNumber_Subtract(__pyx_t_4, __pyx_t_16); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1247, __pyx_L1_error) + __pyx_t_15 = PyNumber_Subtract(__pyx_t_4, __pyx_t_16); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; @@ -42453,7 +43805,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1247, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -42476,34 +43828,34 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1247, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1280, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __pyx_v_otherLnNormal = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":1248 + /* "collisions.py":1281 * sortedOtherLn = Line(*sorted([cLine.p1, cLine.p2], key=lambda x: x[0])) * otherLnNormal = math.degrees(math.atan2(sortedOtherLn[0][1]-sortedOtherLn[1][1], sortedOtherLn[0][0]-sortedOtherLn[1][0])) * paralell = abs(otherLnNormal%360 - thisNormal%360) < precision or abs((otherLnNormal-180)%360 - thisNormal%360) < precision # <<<<<<<<<<<<<< * velDiff = 180 * if paralell: # Line off line */ - __pyx_t_5 = __Pyx_PyInt_RemainderObjC(__pyx_v_otherLnNormal, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1248, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_RemainderObjC(__pyx_v_otherLnNormal, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_v_thisNormal, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1248, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_v_thisNormal, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyNumber_Subtract(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1248, __pyx_L1_error) + __pyx_t_6 = PyNumber_Subtract(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1248, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_v_precision, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1248, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_v_precision, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1281, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1248, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1281, __pyx_L1_error) if (!__pyx_t_18) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { @@ -42512,21 +43864,21 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L37_bool_binop_done; } - __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_v_otherLnNormal, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1248, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_v_otherLnNormal, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_t_6, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1248, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_t_6, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyInt_RemainderObjC(__pyx_v_thisNormal, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1248, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_RemainderObjC(__pyx_v_thisNormal, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyNumber_Subtract(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1248, __pyx_L1_error) + __pyx_t_5 = PyNumber_Subtract(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1248, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_v_precision, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1248, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_v_precision, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1281, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = __pyx_t_5; @@ -42535,7 +43887,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __Pyx_DECREF_SET(__pyx_v_paralell, __pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1245 + /* "collisions.py":1278 * elif checkShpType(closestObj, ShpTyps.Circle) and (not thisIsOnP): * paralell = True * if cLine is not None: # <<<<<<<<<<<<<< @@ -42544,7 +43896,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED */ } - /* "collisions.py":1235 + /* "collisions.py":1268 * if checkShpType(closestObj, ShpGroups.NOTSTRAIGHT): * paralell = not thisIsOnP * if not paralell: # <<<<<<<<<<<<<< @@ -42553,7 +43905,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED */ } - /* "collisions.py":1249 + /* "collisions.py":1282 * otherLnNormal = math.degrees(math.atan2(sortedOtherLn[0][1]-sortedOtherLn[1][1], sortedOtherLn[0][0]-sortedOtherLn[1][0])) * paralell = abs(otherLnNormal%360 - thisNormal%360) < precision or abs((otherLnNormal-180)%360 - thisNormal%360) < precision * velDiff = 180 # <<<<<<<<<<<<<< @@ -42563,17 +43915,17 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __Pyx_INCREF(__pyx_int_180); __pyx_v_velDiff = __pyx_int_180; - /* "collisions.py":1250 + /* "collisions.py":1283 * paralell = abs(otherLnNormal%360 - thisNormal%360) < precision or abs((otherLnNormal-180)%360 - thisNormal%360) < precision * velDiff = 180 * if paralell: # Line off line # <<<<<<<<<<<<<< * collTyp = 3 * # Reflect off the object's normal to the point (but really could be either point; the tangents *should* be the same) */ - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_paralell); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1250, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_paralell); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1283, __pyx_L1_error) if (__pyx_t_18) { - /* "collisions.py":1251 + /* "collisions.py":1284 * velDiff = 180 * if paralell: # Line off line * collTyp = 3 # <<<<<<<<<<<<<< @@ -42583,7 +43935,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __Pyx_INCREF(__pyx_int_3); __pyx_v_collTyp = __pyx_int_3; - /* "collisions.py":1253 + /* "collisions.py":1286 * collTyp = 3 * # Reflect off the object's normal to the point (but really could be either point; the tangents *should* be the same) * normal = thisNormal # <<<<<<<<<<<<<< @@ -42593,36 +43945,36 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __Pyx_INCREF(__pyx_v_thisNormal); __pyx_v_normal = __pyx_v_thisNormal; - /* "collisions.py":1254 + /* "collisions.py":1287 * # Reflect off the object's normal to the point (but really could be either point; the tangents *should* be the same) * normal = thisNormal * phi = math.degrees(math.atan2(newPoint[1] - closestP[1], newPoint[0] - closestP[0]))-90 # <<<<<<<<<<<<<< * else: * otherIsOnP = closestObj.isCorner(closestP, precision) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1254, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_degrees); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1254, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_degrees); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1254, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_atan2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1254, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_atan2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_newPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1254, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_newPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1254, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_16 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1254, __pyx_L1_error) + __pyx_t_16 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_newPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1254, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_newPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1254, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1254, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -42646,7 +43998,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1254, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } @@ -42669,17 +44021,17 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1254, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_t_3, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1254, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_t_3, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_phi = __pyx_t_6; __pyx_t_6 = 0; - /* "collisions.py":1250 + /* "collisions.py":1283 * paralell = abs(otherLnNormal%360 - thisNormal%360) < precision or abs((otherLnNormal-180)%360 - thisNormal%360) < precision * velDiff = 180 * if paralell: # Line off line # <<<<<<<<<<<<<< @@ -42689,7 +44041,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED goto __pyx_L39; } - /* "collisions.py":1256 + /* "collisions.py":1289 * phi = math.degrees(math.atan2(newPoint[1] - closestP[1], newPoint[0] - closestP[0]))-90 * else: * otherIsOnP = closestObj.isCorner(closestP, precision) # <<<<<<<<<<<<<< @@ -42697,7 +44049,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED * collTyp = 0 */ /*else*/ { - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_isCorner); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1256, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_isCorner); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_8 = 0; @@ -42717,32 +44069,32 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_closestP, __pyx_v_precision}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1256, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_otherIsOnP = __pyx_t_6; __pyx_t_6 = 0; - /* "collisions.py":1257 + /* "collisions.py":1290 * else: * otherIsOnP = closestObj.isCorner(closestP, precision) * if thisIsOnP and otherIsOnP: # Point off point collision # <<<<<<<<<<<<<< * collTyp = 0 * # Reflect off the same way as you came in (as if you can land an infintesimally small point on another infintesimally small point anyway) */ - __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_19 < 0))) __PYX_ERR(0, 1257, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_19 < 0))) __PYX_ERR(0, 1290, __pyx_L1_error) if (__pyx_t_19) { } else { __pyx_t_18 = __pyx_t_19; goto __pyx_L41_bool_binop_done; } - __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_v_otherIsOnP); if (unlikely((__pyx_t_19 < 0))) __PYX_ERR(0, 1257, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_v_otherIsOnP); if (unlikely((__pyx_t_19 < 0))) __PYX_ERR(0, 1290, __pyx_L1_error) __pyx_t_18 = __pyx_t_19; __pyx_L41_bool_binop_done:; if (__pyx_t_18) { - /* "collisions.py":1258 + /* "collisions.py":1291 * otherIsOnP = closestObj.isCorner(closestP, precision) * if thisIsOnP and otherIsOnP: # Point off point collision * collTyp = 0 # <<<<<<<<<<<<<< @@ -42752,7 +44104,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __Pyx_INCREF(__pyx_int_0); __pyx_v_collTyp = __pyx_int_0; - /* "collisions.py":1260 + /* "collisions.py":1293 * collTyp = 0 * # Reflect off the same way as you came in (as if you can land an infintesimally small point on another infintesimally small point anyway) * normal, phi = 0, 0 # <<<<<<<<<<<<<< @@ -42768,7 +44120,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __pyx_v_phi = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":1257 + /* "collisions.py":1290 * else: * otherIsOnP = closestObj.isCorner(closestP, precision) * if thisIsOnP and otherIsOnP: # Point off point collision # <<<<<<<<<<<<<< @@ -42778,26 +44130,26 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED goto __pyx_L40; } - /* "collisions.py":1261 + /* "collisions.py":1294 * # Reflect off the same way as you came in (as if you can land an infintesimally small point on another infintesimally small point anyway) * normal, phi = 0, 0 * elif thisIsOnP and (not otherIsOnP): # Point off line # <<<<<<<<<<<<<< * collTyp = 1 * # Reflect off the other object's normal to the point */ - __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_19 < 0))) __PYX_ERR(0, 1261, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_19 < 0))) __PYX_ERR(0, 1294, __pyx_L1_error) if (__pyx_t_19) { } else { __pyx_t_18 = __pyx_t_19; goto __pyx_L43_bool_binop_done; } - __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_v_otherIsOnP); if (unlikely((__pyx_t_19 < 0))) __PYX_ERR(0, 1261, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_v_otherIsOnP); if (unlikely((__pyx_t_19 < 0))) __PYX_ERR(0, 1294, __pyx_L1_error) __pyx_t_9 = (!__pyx_t_19); __pyx_t_18 = __pyx_t_9; __pyx_L43_bool_binop_done:; if (__pyx_t_18) { - /* "collisions.py":1262 + /* "collisions.py":1295 * normal, phi = 0, 0 * elif thisIsOnP and (not otherIsOnP): # Point off line * collTyp = 1 # <<<<<<<<<<<<<< @@ -42807,14 +44159,14 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __Pyx_INCREF(__pyx_int_1); __pyx_v_collTyp = __pyx_int_1; - /* "collisions.py":1264 + /* "collisions.py":1297 * collTyp = 1 * # Reflect off the other object's normal to the point * normal = closestObj.tangent(closestP, vel)-90 # <<<<<<<<<<<<<< * phi = math.degrees(math.atan2(newPoint[1] - closestP[1], newPoint[0] - closestP[0]))-90 # The angle of incidence * elif (not thisIsOnP) and otherIsOnP: # Line off point */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_tangent); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1264, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_tangent); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_5 = NULL; __pyx_t_8 = 0; @@ -42834,46 +44186,46 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_closestP, __pyx_v_vel}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1264, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_t_3, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1264, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_t_3, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_normal = __pyx_t_6; __pyx_t_6 = 0; - /* "collisions.py":1265 + /* "collisions.py":1298 * # Reflect off the other object's normal to the point * normal = closestObj.tangent(closestP, vel)-90 * phi = math.degrees(math.atan2(newPoint[1] - closestP[1], newPoint[0] - closestP[0]))-90 # The angle of incidence # <<<<<<<<<<<<<< * elif (not thisIsOnP) and otherIsOnP: # Line off point * collTyp = 2 */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1265, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_degrees); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1265, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_degrees); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_math); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1265, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_math); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_atan2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1265, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_atan2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_newPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1265, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_newPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_16 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1265, __pyx_L1_error) + __pyx_t_16 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __pyx_t_1 = PyNumber_Subtract(__pyx_t_15, __pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1265, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_15, __pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __pyx_t_16 = __Pyx_GetItemInt(__pyx_v_newPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1265, __pyx_L1_error) + __pyx_t_16 = __Pyx_GetItemInt(__pyx_v_newPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1265, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_16, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1265, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_t_16, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; @@ -42897,7 +44249,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1265, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -42920,17 +44272,17 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1265, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_t_6, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1265, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_t_6, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_phi = __pyx_t_5; __pyx_t_5 = 0; - /* "collisions.py":1261 + /* "collisions.py":1294 * # Reflect off the same way as you came in (as if you can land an infintesimally small point on another infintesimally small point anyway) * normal, phi = 0, 0 * elif thisIsOnP and (not otherIsOnP): # Point off line # <<<<<<<<<<<<<< @@ -42940,26 +44292,26 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED goto __pyx_L40; } - /* "collisions.py":1266 + /* "collisions.py":1299 * normal = closestObj.tangent(closestP, vel)-90 * phi = math.degrees(math.atan2(newPoint[1] - closestP[1], newPoint[0] - closestP[0]))-90 # The angle of incidence * elif (not thisIsOnP) and otherIsOnP: # Line off point # <<<<<<<<<<<<<< * collTyp = 2 * # Reflect off this line's normal */ - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1266, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 1299, __pyx_L1_error) __pyx_t_19 = (!__pyx_t_9); if (__pyx_t_19) { } else { __pyx_t_18 = __pyx_t_19; goto __pyx_L45_bool_binop_done; } - __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_v_otherIsOnP); if (unlikely((__pyx_t_19 < 0))) __PYX_ERR(0, 1266, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_v_otherIsOnP); if (unlikely((__pyx_t_19 < 0))) __PYX_ERR(0, 1299, __pyx_L1_error) __pyx_t_18 = __pyx_t_19; __pyx_L45_bool_binop_done:; if (__pyx_t_18) { - /* "collisions.py":1267 + /* "collisions.py":1300 * phi = math.degrees(math.atan2(newPoint[1] - closestP[1], newPoint[0] - closestP[0]))-90 # The angle of incidence * elif (not thisIsOnP) and otherIsOnP: # Line off point * collTyp = 2 # <<<<<<<<<<<<<< @@ -42969,48 +44321,48 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __Pyx_INCREF(__pyx_int_2); __pyx_v_collTyp = __pyx_int_2; - /* "collisions.py":1269 + /* "collisions.py":1302 * collTyp = 2 * # Reflect off this line's normal * normal = thisNormal-90 # The normal off the line # <<<<<<<<<<<<<< * phi = math.degrees(math.atan2(closestP[1] - newPoint[1], closestP[0] - newPoint[0]))-90 # The angle of incidence * velDiff = 0 */ - __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_thisNormal, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1269, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_thisNormal, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1302, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_v_normal = __pyx_t_5; __pyx_t_5 = 0; - /* "collisions.py":1270 + /* "collisions.py":1303 * # Reflect off this line's normal * normal = thisNormal-90 # The normal off the line * phi = math.degrees(math.atan2(closestP[1] - newPoint[1], closestP[0] - newPoint[0]))-90 # The angle of incidence # <<<<<<<<<<<<<< * velDiff = 0 * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_math); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1270, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_math); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_degrees); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1270, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_degrees); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1270, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_atan2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1270, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_atan2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1270, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_newPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1270, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_newPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_15 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1270, __pyx_L1_error) + __pyx_t_15 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1270, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_newPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1270, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_newPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_16 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1270, __pyx_L1_error) + __pyx_t_16 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -43034,7 +44386,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1270, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -43057,17 +44409,17 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1270, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_t_5, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1270, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_t_5, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_phi = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":1271 + /* "collisions.py":1304 * normal = thisNormal-90 # The normal off the line * phi = math.degrees(math.atan2(closestP[1] - newPoint[1], closestP[0] - newPoint[0]))-90 # The angle of incidence * velDiff = 0 # <<<<<<<<<<<<<< @@ -43077,7 +44429,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __Pyx_INCREF(__pyx_int_0); __Pyx_DECREF_SET(__pyx_v_velDiff, __pyx_int_0); - /* "collisions.py":1266 + /* "collisions.py":1299 * normal = closestObj.tangent(closestP, vel)-90 * phi = math.degrees(math.atan2(newPoint[1] - closestP[1], newPoint[0] - closestP[0]))-90 # The angle of incidence * elif (not thisIsOnP) and otherIsOnP: # Line off point # <<<<<<<<<<<<<< @@ -43087,7 +44439,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED goto __pyx_L40; } - /* "collisions.py":1276 + /* "collisions.py":1309 * # 'Cannot have a line reflecting off of another line when they aren\'t paralell; something bad must have occured!' * #) * collTyp = None # <<<<<<<<<<<<<< @@ -43098,7 +44450,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __Pyx_INCREF(Py_None); __pyx_v_collTyp = Py_None; - /* "collisions.py":1277 + /* "collisions.py":1310 * #) * collTyp = None * normal, phi = 0, 0 # <<<<<<<<<<<<<< @@ -43118,97 +44470,97 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED } __pyx_L39:; - /* "collisions.py":1279 + /* "collisions.py":1312 * normal, phi = 0, 0 * * if round(newPoint[0], precision) == round(closestP[0], precision) and round(newPoint[1], precision) == round(closestP[1], precision): # <<<<<<<<<<<<<< * phi = normal+180 * */ - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_newPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_newPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5)) __PYX_ERR(0, 1279, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5)) __PYX_ERR(0, 1312, __pyx_L1_error); __Pyx_INCREF(__pyx_v_precision); __Pyx_GIVEREF(__pyx_v_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_precision)) __PYX_ERR(0, 1279, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_precision)) __PYX_ERR(0, 1312, __pyx_L1_error); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 1279, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 1312, __pyx_L1_error); __Pyx_INCREF(__pyx_v_precision); __Pyx_GIVEREF(__pyx_v_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_precision)) __PYX_ERR(0, 1279, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_precision)) __PYX_ERR(0, 1312, __pyx_L1_error); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_19 < 0))) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_19 < 0))) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_19) { } else { __pyx_t_18 = __pyx_t_19; goto __pyx_L48_bool_binop_done; } - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_newPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_newPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6)) __PYX_ERR(0, 1279, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6)) __PYX_ERR(0, 1312, __pyx_L1_error); __Pyx_INCREF(__pyx_v_precision); __Pyx_GIVEREF(__pyx_v_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_precision)) __PYX_ERR(0, 1279, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_precision)) __PYX_ERR(0, 1312, __pyx_L1_error); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(0, 1279, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(0, 1312, __pyx_L1_error); __Pyx_INCREF(__pyx_v_precision); __Pyx_GIVEREF(__pyx_v_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_precision)) __PYX_ERR(0, 1279, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_precision)) __PYX_ERR(0, 1312, __pyx_L1_error); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_19 < 0))) __PYX_ERR(0, 1279, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_19 < 0))) __PYX_ERR(0, 1312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_18 = __pyx_t_19; __pyx_L48_bool_binop_done:; if (__pyx_t_18) { - /* "collisions.py":1280 + /* "collisions.py":1313 * * if round(newPoint[0], precision) == round(closestP[0], precision) and round(newPoint[1], precision) == round(closestP[1], precision): * phi = normal+180 # <<<<<<<<<<<<<< * * # the distance between the closest point on the other object and the corresponding point on the newLine */ - __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_normal, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1280, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_normal, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF_SET(__pyx_v_phi, __pyx_t_5); __pyx_t_5 = 0; - /* "collisions.py":1279 + /* "collisions.py":1312 * normal, phi = 0, 0 * * if round(newPoint[0], precision) == round(closestP[0], precision) and round(newPoint[1], precision) == round(closestP[1], precision): # <<<<<<<<<<<<<< @@ -43217,31 +44569,31 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED */ } - /* "collisions.py":1283 + /* "collisions.py":1316 * * # the distance between the closest point on the other object and the corresponding point on the newLine * dist_left = math.hypot(newPoint[0]-closestP[0], newPoint[1]-closestP[1]) * closestObj.bounciness # <<<<<<<<<<<<<< * diff = (phi-normal) % 360 # The difference between the angle of incidence and the normal * if diff > 180: # Do we even need this? */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1283, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_hypot); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1283, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_hypot); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_newPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1283, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_newPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1283, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_16 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1283, __pyx_L1_error) + __pyx_t_16 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_newPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1283, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_newPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1283, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_15 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1283, __pyx_L1_error) + __pyx_t_15 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -43265,59 +44617,59 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1283, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1283, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_15 = PyNumber_Multiply(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1283, __pyx_L1_error) + __pyx_t_15 = PyNumber_Multiply(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_dist_left = __pyx_t_15; __pyx_t_15 = 0; - /* "collisions.py":1284 + /* "collisions.py":1317 * # the distance between the closest point on the other object and the corresponding point on the newLine * dist_left = math.hypot(newPoint[0]-closestP[0], newPoint[1]-closestP[1]) * closestObj.bounciness * diff = (phi-normal) % 360 # The difference between the angle of incidence and the normal # <<<<<<<<<<<<<< * if diff > 180: # Do we even need this? * diff -= 360 */ - __pyx_t_15 = PyNumber_Subtract(__pyx_v_phi, __pyx_v_normal); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1284, __pyx_L1_error) + __pyx_t_15 = PyNumber_Subtract(__pyx_v_phi, __pyx_v_normal); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_6 = __Pyx_PyInt_RemainderObjC(__pyx_t_15, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1284, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_RemainderObjC(__pyx_t_15, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1317, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __pyx_v_diff = __pyx_t_6; __pyx_t_6 = 0; - /* "collisions.py":1285 + /* "collisions.py":1318 * dist_left = math.hypot(newPoint[0]-closestP[0], newPoint[1]-closestP[1]) * closestObj.bounciness * diff = (phi-normal) % 360 # The difference between the angle of incidence and the normal * if diff > 180: # Do we even need this? # <<<<<<<<<<<<<< * diff -= 360 * pos = rotate(closestP, [closestP[0], closestP[1] + dist_left], phi-180-diff*2) */ - __pyx_t_6 = PyObject_RichCompare(__pyx_v_diff, __pyx_int_180, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1285, __pyx_L1_error) - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1285, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_diff, __pyx_int_180, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1318, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1318, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_18) { - /* "collisions.py":1286 + /* "collisions.py":1319 * diff = (phi-normal) % 360 # The difference between the angle of incidence and the normal * if diff > 180: # Do we even need this? * diff -= 360 # <<<<<<<<<<<<<< * pos = rotate(closestP, [closestP[0], closestP[1] + dist_left], phi-180-diff*2) * vel = list(rotateBy0(vel, velDiff-diff*2)) */ - __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_v_diff, __pyx_int_360, 0x168, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1286, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_v_diff, __pyx_int_360, 0x168, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF_SET(__pyx_v_diff, __pyx_t_6); __pyx_t_6 = 0; - /* "collisions.py":1285 + /* "collisions.py":1318 * dist_left = math.hypot(newPoint[0]-closestP[0], newPoint[1]-closestP[1]) * closestObj.bounciness * diff = (phi-normal) % 360 # The difference between the angle of incidence and the normal * if diff > 180: # Do we even need this? # <<<<<<<<<<<<<< @@ -43326,35 +44678,35 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED */ } - /* "collisions.py":1287 + /* "collisions.py":1320 * if diff > 180: # Do we even need this? * diff -= 360 * pos = rotate(closestP, [closestP[0], closestP[1] + dist_left], phi-180-diff*2) # <<<<<<<<<<<<<< * vel = list(rotateBy0(vel, velDiff-diff*2)) * vel = [vel[0]*closestObj.bounciness, vel[1]*closestObj.bounciness] */ - __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_rotate); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1287, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_rotate); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1287, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_16 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1287, __pyx_L1_error) + __pyx_t_16 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __pyx_t_3 = PyNumber_Add(__pyx_t_16, __pyx_v_dist_left); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1287, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_16, __pyx_v_dist_left); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - __pyx_t_16 = PyList_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1287, __pyx_L1_error) + __pyx_t_16 = PyList_New(2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 0, __pyx_t_5)) __PYX_ERR(0, 1287, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 0, __pyx_t_5)) __PYX_ERR(0, 1320, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 1, __pyx_t_3)) __PYX_ERR(0, 1287, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_16, 1, __pyx_t_3)) __PYX_ERR(0, 1320, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_phi, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1287, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_phi, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1287, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1287, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -43378,25 +44730,25 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1287, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __pyx_v_pos = __pyx_t_6; __pyx_t_6 = 0; - /* "collisions.py":1288 + /* "collisions.py":1321 * diff -= 360 * pos = rotate(closestP, [closestP[0], closestP[1] + dist_left], phi-180-diff*2) * vel = list(rotateBy0(vel, velDiff-diff*2)) # <<<<<<<<<<<<<< * vel = [vel[0]*closestObj.bounciness, vel[1]*closestObj.bounciness] * diff2Point = (closestP[0]-cPoint[0], closestP[1]-cPoint[1]) */ - __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_rotateBy0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1288, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_n_s_rotateBy0); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_2 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1288, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_16 = PyNumber_Subtract(__pyx_v_velDiff, __pyx_t_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1288, __pyx_L1_error) + __pyx_t_16 = PyNumber_Subtract(__pyx_v_velDiff, __pyx_t_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -43418,142 +44770,142 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_15, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1288, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } - __pyx_t_15 = __Pyx_PySequence_ListKeepNew(__pyx_t_6); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1288, __pyx_L1_error) + __pyx_t_15 = __Pyx_PySequence_ListKeepNew(__pyx_t_6); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1321, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF_SET(__pyx_v_vel, __pyx_t_15); __pyx_t_15 = 0; - /* "collisions.py":1289 + /* "collisions.py":1322 * pos = rotate(closestP, [closestP[0], closestP[1] + dist_left], phi-180-diff*2) * vel = list(rotateBy0(vel, velDiff-diff*2)) * vel = [vel[0]*closestObj.bounciness, vel[1]*closestObj.bounciness] # <<<<<<<<<<<<<< * diff2Point = (closestP[0]-cPoint[0], closestP[1]-cPoint[1]) * odiff = (pos[0]-cPoint[0], pos[1]-cPoint[1]) */ - __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1289, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1289, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_16 = PyNumber_Multiply(__pyx_t_15, __pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1289, __pyx_L1_error) + __pyx_t_16 = PyNumber_Multiply(__pyx_t_15, __pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1289, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1289, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_2 = PyNumber_Multiply(__pyx_t_6, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1289, __pyx_L1_error) + __pyx_t_2 = PyNumber_Multiply(__pyx_t_6, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyList_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1289, __pyx_L1_error) + __pyx_t_15 = PyList_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_GIVEREF(__pyx_t_16); - if (__Pyx_PyList_SET_ITEM(__pyx_t_15, 0, __pyx_t_16)) __PYX_ERR(0, 1289, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_15, 0, __pyx_t_16)) __PYX_ERR(0, 1322, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_15, 1, __pyx_t_2)) __PYX_ERR(0, 1289, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_15, 1, __pyx_t_2)) __PYX_ERR(0, 1322, __pyx_L1_error); __pyx_t_16 = 0; __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_vel, __pyx_t_15); __pyx_t_15 = 0; - /* "collisions.py":1290 + /* "collisions.py":1323 * vel = list(rotateBy0(vel, velDiff-diff*2)) * vel = [vel[0]*closestObj.bounciness, vel[1]*closestObj.bounciness] * diff2Point = (closestP[0]-cPoint[0], closestP[1]-cPoint[1]) # <<<<<<<<<<<<<< * odiff = (pos[0]-cPoint[0], pos[1]-cPoint[1]) * # HACK */ - __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1290, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_cPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1290, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_cPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_16 = PyNumber_Subtract(__pyx_t_15, __pyx_t_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1290, __pyx_L1_error) + __pyx_t_16 = PyNumber_Subtract(__pyx_t_15, __pyx_t_2); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1290, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_cPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1290, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_cPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1290, __pyx_L1_error) + __pyx_t_6 = PyNumber_Subtract(__pyx_t_2, __pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1290, __pyx_L1_error) + __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_GIVEREF(__pyx_t_16); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_16)) __PYX_ERR(0, 1290, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_16)) __PYX_ERR(0, 1323, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_6)) __PYX_ERR(0, 1290, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_6)) __PYX_ERR(0, 1323, __pyx_L1_error); __pyx_t_16 = 0; __pyx_t_6 = 0; __pyx_v_diff2Point = ((PyObject*)__pyx_t_15); __pyx_t_15 = 0; - /* "collisions.py":1291 + /* "collisions.py":1324 * vel = [vel[0]*closestObj.bounciness, vel[1]*closestObj.bounciness] * diff2Point = (closestP[0]-cPoint[0], closestP[1]-cPoint[1]) * odiff = (pos[0]-cPoint[0], pos[1]-cPoint[1]) # <<<<<<<<<<<<<< * # HACK * smallness = rotateBy0([0, AVERYSMALLNUMBER], phi-180-diff*2) */ - __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1291, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_cPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1291, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_cPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_16 = PyNumber_Subtract(__pyx_t_15, __pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1291, __pyx_L1_error) + __pyx_t_16 = PyNumber_Subtract(__pyx_t_15, __pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1291, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_cPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1291, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_cPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_6, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1291, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_t_6, __pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1291, __pyx_L1_error) + __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1324, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_GIVEREF(__pyx_t_16); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_16)) __PYX_ERR(0, 1291, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_16)) __PYX_ERR(0, 1324, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_2)) __PYX_ERR(0, 1291, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_2)) __PYX_ERR(0, 1324, __pyx_L1_error); __pyx_t_16 = 0; __pyx_t_2 = 0; __pyx_v_odiff = ((PyObject*)__pyx_t_15); __pyx_t_15 = 0; - /* "collisions.py":1293 + /* "collisions.py":1326 * odiff = (pos[0]-cPoint[0], pos[1]-cPoint[1]) * # HACK * smallness = rotateBy0([0, AVERYSMALLNUMBER], phi-180-diff*2) # <<<<<<<<<<<<<< * newp1, newp2 = (oldLine.p1[0]+odiff[0], oldLine.p1[1]+odiff[1]), (oldLine.p2[0]+odiff[0], oldLine.p2[1]+odiff[1]) * o = self.handleCollisionsPos( */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_rotateBy0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1293, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_rotateBy0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_AVERYSMALLNUMBER); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1293, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_n_s_AVERYSMALLNUMBER); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1293, __pyx_L1_error) + __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_int_0)) __PYX_ERR(0, 1293, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_int_0)) __PYX_ERR(0, 1326, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_16); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_16)) __PYX_ERR(0, 1293, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_16)) __PYX_ERR(0, 1326, __pyx_L1_error); __pyx_t_16 = 0; - __pyx_t_16 = __Pyx_PyInt_SubtractObjC(__pyx_v_phi, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1293, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyInt_SubtractObjC(__pyx_v_phi, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); - __pyx_t_5 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1293, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_16, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1293, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_16, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -43577,78 +44929,78 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1293, __pyx_L1_error) + if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_smallness = __pyx_t_15; __pyx_t_15 = 0; - /* "collisions.py":1294 + /* "collisions.py":1327 * # HACK * smallness = rotateBy0([0, AVERYSMALLNUMBER], phi-180-diff*2) * newp1, newp2 = (oldLine.p1[0]+odiff[0], oldLine.p1[1]+odiff[1]), (oldLine.p2[0]+odiff[0], oldLine.p2[1]+odiff[1]) # <<<<<<<<<<<<<< * o = self.handleCollisionsPos( * Line((oldLine.p1[0]+diff2Point[0]+smallness[0], oldLine.p1[1]+diff2Point[1]+smallness[1]), */ - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1294, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_15, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1294, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_15, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = __Pyx_GetItemInt_Tuple(__pyx_v_odiff, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1294, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetItemInt_Tuple(__pyx_v_odiff, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_15); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1294, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_15); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1294, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_15, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1294, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_15, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = __Pyx_GetItemInt_Tuple(__pyx_v_odiff, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1294, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetItemInt_Tuple(__pyx_v_odiff, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1294, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_15); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1294, __pyx_L1_error) + __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_3)) __PYX_ERR(0, 1294, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_3)) __PYX_ERR(0, 1327, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_6)) __PYX_ERR(0, 1294, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_6)) __PYX_ERR(0, 1327, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1294, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1294, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_odiff, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1294, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_odiff, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1294, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1294, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1294, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_odiff, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1294, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_odiff, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1294, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1294, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(0, 1294, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(0, 1327, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 1294, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 1327, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_5 = 0; __pyx_v_newp1 = ((PyObject*)__pyx_t_15); @@ -43656,115 +45008,115 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __pyx_v_newp2 = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; - /* "collisions.py":1295 + /* "collisions.py":1328 * smallness = rotateBy0([0, AVERYSMALLNUMBER], phi-180-diff*2) * newp1, newp2 = (oldLine.p1[0]+odiff[0], oldLine.p1[1]+odiff[1]), (oldLine.p2[0]+odiff[0], oldLine.p2[1]+odiff[1]) * o = self.handleCollisionsPos( # <<<<<<<<<<<<<< * Line((oldLine.p1[0]+diff2Point[0]+smallness[0], oldLine.p1[1]+diff2Point[1]+smallness[1]), * (oldLine.p2[0]+diff2Point[0]+smallness[0], oldLine.p2[1]+diff2Point[1]+smallness[1])), */ - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handleCollisionsPos); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1295, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handleCollisionsPos); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - /* "collisions.py":1296 + /* "collisions.py":1329 * newp1, newp2 = (oldLine.p1[0]+odiff[0], oldLine.p1[1]+odiff[1]), (oldLine.p2[0]+odiff[0], oldLine.p2[1]+odiff[1]) * o = self.handleCollisionsPos( * Line((oldLine.p1[0]+diff2Point[0]+smallness[0], oldLine.p1[1]+diff2Point[1]+smallness[1]), # <<<<<<<<<<<<<< * (oldLine.p2[0]+diff2Point[0]+smallness[0], oldLine.p2[1]+diff2Point[1]+smallness[1])), * Line(newp1, newp2), objs, vel, False, precision, verbose) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1296, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1296, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1296, __pyx_L1_error) + __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_diff2Point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1296, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_diff2Point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_Add(__pyx_t_16, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1296, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_16, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_smallness, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1296, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_smallness, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_16 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1296, __pyx_L1_error) + __pyx_t_16 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1296, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1296, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_diff2Point, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1296, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_diff2Point, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1296, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_smallness, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1296, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_smallness, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1296, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1296, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_16); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_16)) __PYX_ERR(0, 1296, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_16)) __PYX_ERR(0, 1329, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4)) __PYX_ERR(0, 1296, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4)) __PYX_ERR(0, 1329, __pyx_L1_error); __pyx_t_16 = 0; __pyx_t_4 = 0; - /* "collisions.py":1297 + /* "collisions.py":1330 * o = self.handleCollisionsPos( * Line((oldLine.p1[0]+diff2Point[0]+smallness[0], oldLine.p1[1]+diff2Point[1]+smallness[1]), * (oldLine.p2[0]+diff2Point[0]+smallness[0], oldLine.p2[1]+diff2Point[1]+smallness[1])), # <<<<<<<<<<<<<< * Line(newp1, newp2), objs, vel, False, precision, verbose) * out, outvel = o[0], o[1] */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1297, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1297, __pyx_L1_error) + __pyx_t_16 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_diff2Point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1297, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_diff2Point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyNumber_Add(__pyx_t_16, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1297, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_16, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_smallness, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1297, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_smallness, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_16 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1297, __pyx_L1_error) + __pyx_t_16 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_16); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1297, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1297, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_diff2Point, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1297, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_diff2Point, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1297, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_smallness, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1297, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_smallness, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1297, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1297, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_16); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_16)) __PYX_ERR(0, 1297, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_16)) __PYX_ERR(0, 1330, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 1297, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error); __pyx_t_16 = 0; __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -43787,19 +45139,19 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1296, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - /* "collisions.py":1298 + /* "collisions.py":1331 * Line((oldLine.p1[0]+diff2Point[0]+smallness[0], oldLine.p1[1]+diff2Point[1]+smallness[1]), * (oldLine.p2[0]+diff2Point[0]+smallness[0], oldLine.p2[1]+diff2Point[1]+smallness[1])), * Line(newp1, newp2), objs, vel, False, precision, verbose) # <<<<<<<<<<<<<< * out, outvel = o[0], o[1] * if replaceSelf: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Line); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1298, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Line); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_8 = 0; @@ -43819,7 +45171,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_newp1, __pyx_v_newp2}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1298, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -43843,56 +45195,56 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1295, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; } __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_6); __pyx_t_6 = 0; - /* "collisions.py":1299 + /* "collisions.py":1332 * (oldLine.p2[0]+diff2Point[0]+smallness[0], oldLine.p2[1]+diff2Point[1]+smallness[1])), * Line(newp1, newp2), objs, vel, False, precision, verbose) * out, outvel = o[0], o[1] # <<<<<<<<<<<<<< * if replaceSelf: * self.p1, self.p2 = out.p1, out.p2 */ - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_o, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1299, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_o, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_o, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1299, __pyx_L1_error) + __pyx_t_15 = __Pyx_GetItemInt(__pyx_v_o, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __pyx_v_out = __pyx_t_6; __pyx_t_6 = 0; __pyx_v_outvel = __pyx_t_15; __pyx_t_15 = 0; - /* "collisions.py":1300 + /* "collisions.py":1333 * Line(newp1, newp2), objs, vel, False, precision, verbose) * out, outvel = o[0], o[1] * if replaceSelf: # <<<<<<<<<<<<<< * self.p1, self.p2 = out.p1, out.p2 * if verbose: */ - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_replaceSelf); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1300, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_replaceSelf); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1333, __pyx_L1_error) if (__pyx_t_18) { - /* "collisions.py":1301 + /* "collisions.py":1334 * out, outvel = o[0], o[1] * if replaceSelf: * self.p1, self.p2 = out.p1, out.p2 # <<<<<<<<<<<<<< * if verbose: * return out, outvel, [collTyp, True] */ - __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_p1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1301, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_p1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_p2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1301, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_p2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p1, __pyx_t_15) < 0) __PYX_ERR(0, 1301, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p1, __pyx_t_15) < 0) __PYX_ERR(0, 1334, __pyx_L1_error) __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p2, __pyx_t_6) < 0) __PYX_ERR(0, 1301, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p2, __pyx_t_6) < 0) __PYX_ERR(0, 1334, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "collisions.py":1300 + /* "collisions.py":1333 * Line(newp1, newp2), objs, vel, False, precision, verbose) * out, outvel = o[0], o[1] * if replaceSelf: # <<<<<<<<<<<<<< @@ -43901,17 +45253,17 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED */ } - /* "collisions.py":1302 + /* "collisions.py":1335 * if replaceSelf: * self.p1, self.p2 = out.p1, out.p2 * if verbose: # <<<<<<<<<<<<<< * return out, outvel, [collTyp, True] * return out, outvel */ - __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1302, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1335, __pyx_L1_error) if (__pyx_t_18) { - /* "collisions.py":1303 + /* "collisions.py":1336 * self.p1, self.p2 = out.p1, out.p2 * if verbose: * return out, outvel, [collTyp, True] # <<<<<<<<<<<<<< @@ -43919,30 +45271,30 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1303, __pyx_L1_error) + __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_collTyp); __Pyx_GIVEREF(__pyx_v_collTyp); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_v_collTyp)) __PYX_ERR(0, 1303, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_v_collTyp)) __PYX_ERR(0, 1336, __pyx_L1_error); __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, Py_True)) __PYX_ERR(0, 1303, __pyx_L1_error); - __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1303, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, Py_True)) __PYX_ERR(0, 1336, __pyx_L1_error); + __pyx_t_15 = PyTuple_New(3); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_v_out); __Pyx_GIVEREF(__pyx_v_out); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_out)) __PYX_ERR(0, 1303, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_out)) __PYX_ERR(0, 1336, __pyx_L1_error); __Pyx_INCREF(__pyx_v_outvel); __Pyx_GIVEREF(__pyx_v_outvel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_v_outvel)) __PYX_ERR(0, 1303, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_v_outvel)) __PYX_ERR(0, 1336, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_6)) __PYX_ERR(0, 1303, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 2, __pyx_t_6)) __PYX_ERR(0, 1336, __pyx_L1_error); __pyx_t_6 = 0; __pyx_r = ((PyObject*)__pyx_t_15); __pyx_t_15 = 0; goto __pyx_L0; - /* "collisions.py":1302 + /* "collisions.py":1335 * if replaceSelf: * self.p1, self.p2 = out.p1, out.p2 * if verbose: # <<<<<<<<<<<<<< @@ -43951,7 +45303,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED */ } - /* "collisions.py":1304 + /* "collisions.py":1337 * if verbose: * return out, outvel, [collTyp, True] * return out, outvel # <<<<<<<<<<<<<< @@ -43959,19 +45311,19 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED * def handleCollisionsVel(self, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1304, __pyx_L1_error) + __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_15); __Pyx_INCREF(__pyx_v_out); __Pyx_GIVEREF(__pyx_v_out); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_out)) __PYX_ERR(0, 1304, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_v_out)) __PYX_ERR(0, 1337, __pyx_L1_error); __Pyx_INCREF(__pyx_v_outvel); __Pyx_GIVEREF(__pyx_v_outvel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_v_outvel)) __PYX_ERR(0, 1304, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_v_outvel)) __PYX_ERR(0, 1337, __pyx_L1_error); __pyx_r = ((PyObject*)__pyx_t_15); __pyx_t_15 = 0; goto __pyx_L0; - /* "collisions.py":1169 + /* "collisions.py":1202 * return [(phi-180)%360, phi % 360][tries.index(min(tries))] * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< @@ -44035,7 +45387,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED return __pyx_r; } -/* "collisions.py":1306 +/* "collisions.py":1339 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< @@ -44043,7 +45395,7 @@ static PyObject *__pyx_pf_10collisions_4Line_32handleCollisionsPos(CYTHON_UNUSED * objs: Union[Shapes, Iterable[Shape]], */ -static PyObject *__pyx_pf_10collisions_40__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { +static PyObject *__pyx_pf_10collisions_42__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -44054,39 +45406,39 @@ static PyObject *__pyx_pf_10collisions_40__defaults__(CYTHON_UNUSED PyObject *__ __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - /* "collisions.py":1311 + /* "collisions.py":1344 * replaceSelf: bool = True, * precision: Number = BASEPRECISION, * verbose: bool = False # <<<<<<<<<<<<<< * ) -> tuple['Line', pointLike, verboseOutput]: * """ */ - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1306, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_True)); __Pyx_GIVEREF(((PyObject *)Py_True)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_True))) __PYX_ERR(0, 1306, __pyx_L1_error); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self)->__pyx_arg_precision); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self)->__pyx_arg_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 1306, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_True))) __PYX_ERR(0, 1339, __pyx_L1_error); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_self)->__pyx_arg_precision); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_self)->__pyx_arg_precision); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 1339, __pyx_L1_error); __Pyx_INCREF(((PyObject *)Py_False)); __Pyx_GIVEREF(((PyObject *)Py_False)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)Py_False))) __PYX_ERR(0, 1306, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)Py_False))) __PYX_ERR(0, 1339, __pyx_L1_error); - /* "collisions.py":1306 + /* "collisions.py":1339 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< * vel: pointLike, * objs: Union[Shapes, Iterable[Shape]], */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1306, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1306, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1339, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 1306, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 1339, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -44148,7 +45500,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_vel,&__pyx_n_s_objs,&__pyx_n_s_replaceSelf,&__pyx_n_s_precision,&__pyx_n_s_verbose,0}; - __pyx_defaults11 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_self); + __pyx_defaults12 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_self); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); values[4] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_precision); values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); @@ -44177,7 +45529,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1306, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1339, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -44185,9 +45537,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1306, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1339, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 1); __PYX_ERR(0, 1306, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 1); __PYX_ERR(0, 1339, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -44195,35 +45547,35 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1306, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1339, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 2); __PYX_ERR(0, 1306, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 2); __PYX_ERR(0, 1339, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_replaceSelf); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1306, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1339, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_precision); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1306, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1339, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_verbose); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1306, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1339, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "handleCollisionsVel") < 0)) __PYX_ERR(0, 1306, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "handleCollisionsVel") < 0)) __PYX_ERR(0, 1339, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -44249,7 +45601,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, __pyx_nargs); __PYX_ERR(0, 1306, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, __pyx_nargs); __PYX_ERR(0, 1339, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -44298,75 +45650,75 @@ static PyObject *__pyx_pf_10collisions_4Line_34handleCollisionsVel(CYTHON_UNUSED int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handleCollisionsVel", 1); - /* "collisions.py":1330 + /* "collisions.py":1363 * DidReflect (bool): Whether the line reflected off of something * """ * o = self.handleCollisionsPos(self, Line((self.p1[0]+vel[0], self.p1[1]+vel[1]), (self.p2[0]+vel[0], self.p2[1]+vel[1])), objs, vel, False, precision, verbose) # <<<<<<<<<<<<<< * out, outvel = o[0], o[1] * if replaceSelf: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handleCollisionsPos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handleCollisionsPos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Line); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1330, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Line); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_8 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7)) __PYX_ERR(0, 1330, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7)) __PYX_ERR(0, 1363, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_8)) __PYX_ERR(0, 1330, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_8)) __PYX_ERR(0, 1363, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyNumber_Add(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_9 = PyNumber_Add(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1330, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6)) __PYX_ERR(0, 1330, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6)) __PYX_ERR(0, 1363, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9)) __PYX_ERR(0, 1330, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_9)) __PYX_ERR(0, 1363, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -44389,7 +45741,7 @@ static PyObject *__pyx_pf_10collisions_4Line_34handleCollisionsVel(CYTHON_UNUSED __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1330, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -44412,56 +45764,56 @@ static PyObject *__pyx_pf_10collisions_4Line_34handleCollisionsVel(CYTHON_UNUSED __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 7+__pyx_t_10); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_o = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":1331 + /* "collisions.py":1364 * """ * o = self.handleCollisionsPos(self, Line((self.p1[0]+vel[0], self.p1[1]+vel[1]), (self.p2[0]+vel[0], self.p2[1]+vel[1])), objs, vel, False, precision, verbose) * out, outvel = o[0], o[1] # <<<<<<<<<<<<<< * if replaceSelf: * self.p1, self.p2 = out.p1, out.p2 */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_o, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1331, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_o, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_o, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1331, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_o, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_out = __pyx_t_1; __pyx_t_1 = 0; __pyx_v_outvel = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":1332 + /* "collisions.py":1365 * o = self.handleCollisionsPos(self, Line((self.p1[0]+vel[0], self.p1[1]+vel[1]), (self.p2[0]+vel[0], self.p2[1]+vel[1])), objs, vel, False, precision, verbose) * out, outvel = o[0], o[1] * if replaceSelf: # <<<<<<<<<<<<<< * self.p1, self.p2 = out.p1, out.p2 * if verbose: */ - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_replaceSelf); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1332, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_replaceSelf); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1365, __pyx_L1_error) if (__pyx_t_11) { - /* "collisions.py":1333 + /* "collisions.py":1366 * out, outvel = o[0], o[1] * if replaceSelf: * self.p1, self.p2 = out.p1, out.p2 # <<<<<<<<<<<<<< * if verbose: * return out, outvel, o[2] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1333, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1333, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p1, __pyx_t_2) < 0) __PYX_ERR(0, 1333, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p1, __pyx_t_2) < 0) __PYX_ERR(0, 1366, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p2, __pyx_t_1) < 0) __PYX_ERR(0, 1333, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p2, __pyx_t_1) < 0) __PYX_ERR(0, 1366, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":1332 + /* "collisions.py":1365 * o = self.handleCollisionsPos(self, Line((self.p1[0]+vel[0], self.p1[1]+vel[1]), (self.p2[0]+vel[0], self.p2[1]+vel[1])), objs, vel, False, precision, verbose) * out, outvel = o[0], o[1] * if replaceSelf: # <<<<<<<<<<<<<< @@ -44470,17 +45822,17 @@ static PyObject *__pyx_pf_10collisions_4Line_34handleCollisionsVel(CYTHON_UNUSED */ } - /* "collisions.py":1334 + /* "collisions.py":1367 * if replaceSelf: * self.p1, self.p2 = out.p1, out.p2 * if verbose: # <<<<<<<<<<<<<< * return out, outvel, o[2] * return out, outvel */ - __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1334, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1367, __pyx_L1_error) if (__pyx_t_11) { - /* "collisions.py":1335 + /* "collisions.py":1368 * self.p1, self.p2 = out.p1, out.p2 * if verbose: * return out, outvel, o[2] # <<<<<<<<<<<<<< @@ -44488,24 +45840,24 @@ static PyObject *__pyx_pf_10collisions_4Line_34handleCollisionsVel(CYTHON_UNUSED * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_o, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1335, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_o, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1335, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_out); __Pyx_GIVEREF(__pyx_v_out); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_out)) __PYX_ERR(0, 1335, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_out)) __PYX_ERR(0, 1368, __pyx_L1_error); __Pyx_INCREF(__pyx_v_outvel); __Pyx_GIVEREF(__pyx_v_outvel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_outvel)) __PYX_ERR(0, 1335, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_outvel)) __PYX_ERR(0, 1368, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1)) __PYX_ERR(0, 1335, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1)) __PYX_ERR(0, 1368, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1334 + /* "collisions.py":1367 * if replaceSelf: * self.p1, self.p2 = out.p1, out.p2 * if verbose: # <<<<<<<<<<<<<< @@ -44514,7 +45866,7 @@ static PyObject *__pyx_pf_10collisions_4Line_34handleCollisionsVel(CYTHON_UNUSED */ } - /* "collisions.py":1336 + /* "collisions.py":1369 * if verbose: * return out, outvel, o[2] * return out, outvel # <<<<<<<<<<<<<< @@ -44522,19 +45874,19 @@ static PyObject *__pyx_pf_10collisions_4Line_34handleCollisionsVel(CYTHON_UNUSED * def copy(self) -> 'Line': */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1336, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_out); __Pyx_GIVEREF(__pyx_v_out); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_out)) __PYX_ERR(0, 1336, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_out)) __PYX_ERR(0, 1369, __pyx_L1_error); __Pyx_INCREF(__pyx_v_outvel); __Pyx_GIVEREF(__pyx_v_outvel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_outvel)) __PYX_ERR(0, 1336, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_outvel)) __PYX_ERR(0, 1369, __pyx_L1_error); __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1306 + /* "collisions.py":1339 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< @@ -44564,7 +45916,7 @@ static PyObject *__pyx_pf_10collisions_4Line_34handleCollisionsVel(CYTHON_UNUSED return __pyx_r; } -/* "collisions.py":1338 +/* "collisions.py":1371 * return out, outvel * * def copy(self) -> 'Line': # <<<<<<<<<<<<<< @@ -44626,12 +45978,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1338, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1371, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(0, 1338, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(0, 1371, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -44642,7 +45994,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("copy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1338, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("copy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1371, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -44684,7 +46036,7 @@ static PyObject *__pyx_pf_10collisions_4Line_36copy(CYTHON_UNUSED PyObject *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 1); - /* "collisions.py":1342 + /* "collisions.py":1375 * Make a copy of the Line with the same values! * """ * return Line(self.p1, self.p2, self.bounciness) # <<<<<<<<<<<<<< @@ -44692,13 +46044,13 @@ static PyObject *__pyx_pf_10collisions_4Line_36copy(CYTHON_UNUSED PyObject *__py * def __getitem__(self, item: int) -> pointLike: */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1342, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1342, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1342, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1342, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -44721,7 +46073,7 @@ static PyObject *__pyx_pf_10collisions_4Line_36copy(CYTHON_UNUSED PyObject *__py __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1375, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -44729,7 +46081,7 @@ static PyObject *__pyx_pf_10collisions_4Line_36copy(CYTHON_UNUSED PyObject *__py __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1338 + /* "collisions.py":1371 * return out, outvel * * def copy(self) -> 'Line': # <<<<<<<<<<<<<< @@ -44753,7 +46105,7 @@ static PyObject *__pyx_pf_10collisions_4Line_36copy(CYTHON_UNUSED PyObject *__py return __pyx_r; } -/* "collisions.py":1344 +/* "collisions.py":1377 * return Line(self.p1, self.p2, self.bounciness) * * def __getitem__(self, item: int) -> pointLike: # <<<<<<<<<<<<<< @@ -44817,7 +46169,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1344, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1377, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -44825,14 +46177,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1344, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1377, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 1344, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 1377, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__getitem__") < 0)) __PYX_ERR(0, 1344, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__getitem__") < 0)) __PYX_ERR(0, 1377, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -44845,7 +46197,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1344, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1377, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -44859,7 +46211,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_item), (&PyInt_Type), 0, "item", 1))) __PYX_ERR(0, 1344, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_item), (&PyInt_Type), 0, "item", 1))) __PYX_ERR(0, 1377, __pyx_L1_error) __pyx_r = __pyx_pf_10collisions_4Line_38__getitem__(__pyx_self, __pyx_v_self, __pyx_v_item); /* function exit code */ @@ -44888,19 +46240,19 @@ static PyObject *__pyx_pf_10collisions_4Line_38__getitem__(CYTHON_UNUSED PyObjec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 1); - /* "collisions.py":1345 + /* "collisions.py":1378 * * def __getitem__(self, item: int) -> pointLike: * if item == 0: # <<<<<<<<<<<<<< * return self.p1 * elif item == 1: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1345, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1345, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1378, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1378, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":1346 + /* "collisions.py":1379 * def __getitem__(self, item: int) -> pointLike: * if item == 0: * return self.p1 # <<<<<<<<<<<<<< @@ -44908,13 +46260,13 @@ static PyObject *__pyx_pf_10collisions_4Line_38__getitem__(CYTHON_UNUSED PyObjec * return self.p2 */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1346, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1345 + /* "collisions.py":1378 * * def __getitem__(self, item: int) -> pointLike: * if item == 0: # <<<<<<<<<<<<<< @@ -44923,19 +46275,19 @@ static PyObject *__pyx_pf_10collisions_4Line_38__getitem__(CYTHON_UNUSED PyObjec */ } - /* "collisions.py":1347 + /* "collisions.py":1380 * if item == 0: * return self.p1 * elif item == 1: # <<<<<<<<<<<<<< * return self.p2 * else: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1347, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1347, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1380, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_2)) { - /* "collisions.py":1348 + /* "collisions.py":1381 * return self.p1 * elif item == 1: * return self.p2 # <<<<<<<<<<<<<< @@ -44943,13 +46295,13 @@ static PyObject *__pyx_pf_10collisions_4Line_38__getitem__(CYTHON_UNUSED PyObjec * raise IndexError( */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1348, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1347 + /* "collisions.py":1380 * if item == 0: * return self.p1 * elif item == 1: # <<<<<<<<<<<<<< @@ -44958,7 +46310,7 @@ static PyObject *__pyx_pf_10collisions_4Line_38__getitem__(CYTHON_UNUSED PyObjec */ } - /* "collisions.py":1350 + /* "collisions.py":1383 * return self.p2 * else: * raise IndexError( # <<<<<<<<<<<<<< @@ -44967,35 +46319,35 @@ static PyObject *__pyx_pf_10collisions_4Line_38__getitem__(CYTHON_UNUSED PyObjec */ /*else*/ { - /* "collisions.py":1351 + /* "collisions.py":1384 * else: * raise IndexError( * 'List index out of range! Must be 0-1, found: '+str(item) # <<<<<<<<<<<<<< * ) * */ - __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1351, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_List_index_out_of_range_Must_be, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1351, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_List_index_out_of_range_Must_be, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":1350 + /* "collisions.py":1383 * return self.p2 * else: * raise IndexError( # <<<<<<<<<<<<<< * 'List index out of range! Must be 0-1, found: '+str(item) * ) */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1350, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 1350, __pyx_L1_error) + __PYX_ERR(0, 1383, __pyx_L1_error) } - /* "collisions.py":1344 + /* "collisions.py":1377 * return Line(self.p1, self.p2, self.bounciness) * * def __getitem__(self, item: int) -> pointLike: # <<<<<<<<<<<<<< @@ -45015,7 +46367,7 @@ static PyObject *__pyx_pf_10collisions_4Line_38__getitem__(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "collisions.py":1354 +/* "collisions.py":1387 * ) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< @@ -45082,7 +46434,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1354, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1387, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -45090,9 +46442,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1354, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1387, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 1354, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 1387, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -45100,14 +46452,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1354, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1387, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 1354, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 1387, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(0, 1354, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(0, 1387, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -45122,7 +46474,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1354, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1387, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -45136,7 +46488,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_item), (&PyInt_Type), 0, "item", 1))) __PYX_ERR(0, 1354, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_item), (&PyInt_Type), 0, "item", 1))) __PYX_ERR(0, 1387, __pyx_L1_error) __pyx_r = __pyx_pf_10collisions_4Line_40__setitem__(__pyx_self, __pyx_v_self, __pyx_v_item, __pyx_v_new); /* function exit code */ @@ -45165,28 +46517,28 @@ static PyObject *__pyx_pf_10collisions_4Line_40__setitem__(CYTHON_UNUSED PyObjec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 1); - /* "collisions.py":1355 + /* "collisions.py":1388 * * def __setitem__(self, item: int, new: pointLike) -> None: * if item == 0: # <<<<<<<<<<<<<< * self.p1 = new * elif item == 1: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1355, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1355, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1388, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1388, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":1356 + /* "collisions.py":1389 * def __setitem__(self, item: int, new: pointLike) -> None: * if item == 0: * self.p1 = new # <<<<<<<<<<<<<< * elif item == 1: * self.p2 = new */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p1, __pyx_v_new) < 0) __PYX_ERR(0, 1356, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p1, __pyx_v_new) < 0) __PYX_ERR(0, 1389, __pyx_L1_error) - /* "collisions.py":1355 + /* "collisions.py":1388 * * def __setitem__(self, item: int, new: pointLike) -> None: * if item == 0: # <<<<<<<<<<<<<< @@ -45196,28 +46548,28 @@ static PyObject *__pyx_pf_10collisions_4Line_40__setitem__(CYTHON_UNUSED PyObjec goto __pyx_L3; } - /* "collisions.py":1357 + /* "collisions.py":1390 * if item == 0: * self.p1 = new * elif item == 1: # <<<<<<<<<<<<<< * self.p2 = new * else: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1357, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1390, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1390, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_2)) { - /* "collisions.py":1358 + /* "collisions.py":1391 * self.p1 = new * elif item == 1: * self.p2 = new # <<<<<<<<<<<<<< * else: * raise IndexError( */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p2, __pyx_v_new) < 0) __PYX_ERR(0, 1358, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_p2, __pyx_v_new) < 0) __PYX_ERR(0, 1391, __pyx_L1_error) - /* "collisions.py":1357 + /* "collisions.py":1390 * if item == 0: * self.p1 = new * elif item == 1: # <<<<<<<<<<<<<< @@ -45227,7 +46579,7 @@ static PyObject *__pyx_pf_10collisions_4Line_40__setitem__(CYTHON_UNUSED PyObjec goto __pyx_L3; } - /* "collisions.py":1360 + /* "collisions.py":1393 * self.p2 = new * else: * raise IndexError( # <<<<<<<<<<<<<< @@ -45236,36 +46588,36 @@ static PyObject *__pyx_pf_10collisions_4Line_40__setitem__(CYTHON_UNUSED PyObjec */ /*else*/ { - /* "collisions.py":1361 + /* "collisions.py":1394 * else: * raise IndexError( * 'List index out of range! Must be 0-1, found: '+str(item) # <<<<<<<<<<<<<< * ) * */ - __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1361, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_List_index_out_of_range_Must_be, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1361, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_List_index_out_of_range_Must_be, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":1360 + /* "collisions.py":1393 * self.p2 = new * else: * raise IndexError( # <<<<<<<<<<<<<< * 'List index out of range! Must be 0-1, found: '+str(item) * ) */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1360, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1393, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 1360, __pyx_L1_error) + __PYX_ERR(0, 1393, __pyx_L1_error) } __pyx_L3:; - /* "collisions.py":1354 + /* "collisions.py":1387 * ) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< @@ -45287,7 +46639,7 @@ static PyObject *__pyx_pf_10collisions_4Line_40__setitem__(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "collisions.py":1364 +/* "collisions.py":1397 * ) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -45348,12 +46700,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1364, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1397, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__iter__") < 0)) __PYX_ERR(0, 1364, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__iter__") < 0)) __PYX_ERR(0, 1397, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -45364,7 +46716,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1364, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1397, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -45402,7 +46754,7 @@ static PyObject *__pyx_pf_10collisions_4Line_42__iter__(CYTHON_UNUSED PyObject * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 1); - /* "collisions.py":1365 + /* "collisions.py":1398 * * def __iter__(self): * return iter((self.p1, self.p2)) # <<<<<<<<<<<<<< @@ -45410,26 +46762,26 @@ static PyObject *__pyx_pf_10collisions_4Line_42__iter__(CYTHON_UNUSED PyObject * * def __str__(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1365, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1365, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1365, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 1365, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 1398, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 1365, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 1398, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; - __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1365, __pyx_L1_error) + __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1364 + /* "collisions.py":1397 * ) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -45450,7 +46802,7 @@ static PyObject *__pyx_pf_10collisions_4Line_42__iter__(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "collisions.py":1367 +/* "collisions.py":1400 * return iter((self.p1, self.p2)) * * def __str__(self): # <<<<<<<<<<<<<< @@ -45511,12 +46863,521 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1367, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1400, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 1400, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_self = values[0]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1400, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("collisions.Line.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_4Line_44__str__(__pyx_self, __pyx_v_self); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10collisions_4Line_44__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + Py_ssize_t __pyx_t_2; + Py_UCS4 __pyx_t_3; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__str__", 1); + + /* "collisions.py":1401 + * + * def __str__(self): + * return f'' # <<<<<<<<<<<<<< + * + * class Circle(Shape): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1401, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = 0; + __pyx_t_3 = 127; + __Pyx_INCREF(__pyx_kp_u_Line_from); + __pyx_t_2 += 11; + __Pyx_GIVEREF(__pyx_kp_u_Line_from); + PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Line_from); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1401, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1401, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; + __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); + __pyx_t_5 = 0; + __Pyx_INCREF(__pyx_kp_u_to); + __pyx_t_2 += 4; + __Pyx_GIVEREF(__pyx_kp_u_to); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_to); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1401, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1401, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; + __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_4); + PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4); + __pyx_t_4 = 0; + __Pyx_INCREF(__pyx_kp_u__7); + __pyx_t_2 += 1; + __Pyx_GIVEREF(__pyx_kp_u__7); + PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__7); + __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1401, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "collisions.py":1400 + * return iter((self.p1, self.p2)) + * + * def __str__(self): # <<<<<<<<<<<<<< + * return f'' + * + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("collisions.Line.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":1409 + * GROUPS = {ShpGroups.CLOSED, ShpGroups.NOTSTRAIGHT} + * TYPE = ShpTyps.Circle + * def __init__(self, x: Number, y: Number, r: Number, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< + * """ + * Args: + */ + +static PyObject *__pyx_pf_10collisions_44__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __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("__defaults__", 1); + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1409, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 1409, __pyx_L1_error); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None)) __PYX_ERR(0, 1409, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("collisions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_6Circle_1__init__(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_10collisions_6Circle___init__, "\n Args:\n x (Number): The x ordinate of the centre of this circle.\n y (Number): The y ordinate of the centre of this circle.\n r (Number): The radius of the circle\n bounciness (float, optional): How bouncy this object is. 1 = rebounds perfectly, <1 = eventually will stop, >1 = will bounce more each time. Defaults to 0.7.\n "); +static PyMethodDef __pyx_mdef_10collisions_6Circle_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Circle___init__}; +static PyObject *__pyx_pw_10collisions_6Circle_1__init__(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_x = 0; + PyObject *__pyx_v_y = 0; + PyObject *__pyx_v_r = 0; + double __pyx_v_bounciness; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[5] = {0,0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_bounciness,0}; + __pyx_defaults13 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_self); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1409, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1409, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 1); __PYX_ERR(0, 1409, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1409, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 2); __PYX_ERR(0, 1409, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1409, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 3); __PYX_ERR(0, 1409, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bounciness); + if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1409, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 1409, __pyx_L3_error) + } + } else { + switch (__pyx_nargs) { + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_x = values[1]; + __pyx_v_y = values[2]; + __pyx_v_r = values[3]; + if (values[4]) { + __pyx_v_bounciness = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_bounciness == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1409, __pyx_L3_error) + } else { + __pyx_v_bounciness = __pyx_dynamic_args->__pyx_arg_bounciness; + } + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1409, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("collisions.Circle.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_6Circle___init__(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_bounciness); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10collisions_6Circle___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, double __pyx_v_bounciness) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + unsigned int __pyx_t_5; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 1); + + /* "collisions.py":1417 + * bounciness (float, optional): How bouncy this object is. 1 = rebounds perfectly, <1 = eventually will stop, >1 = will bounce more each time. Defaults to 0.7. + * """ + * super().__init__(bounciness) # <<<<<<<<<<<<<< + * self.x, self.y, self.r = x, y, r + * + */ + __pyx_t_2 = __Pyx_CyFunction_GetClassObj(__pyx_self); + if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 1417, __pyx_L1_error) } + __Pyx_INCREF(__pyx_t_2); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1417, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 1417, __pyx_L1_error); + __Pyx_INCREF(__pyx_v_self); + __Pyx_GIVEREF(__pyx_v_self); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(0, 1417, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1417, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1417, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1417, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1417, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "collisions.py":1418 + * """ + * super().__init__(bounciness) + * self.x, self.y, self.r = x, y, r # <<<<<<<<<<<<<< + * + * @property + */ + __pyx_t_1 = __pyx_v_x; + __Pyx_INCREF(__pyx_t_1); + __pyx_t_3 = __pyx_v_y; + __Pyx_INCREF(__pyx_t_3); + __pyx_t_2 = __pyx_v_r; + __Pyx_INCREF(__pyx_t_2); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_1) < 0) __PYX_ERR(0, 1418, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_3) < 0) __PYX_ERR(0, 1418, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_r, __pyx_t_2) < 0) __PYX_ERR(0, 1418, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + + /* "collisions.py":1409 + * GROUPS = {ShpGroups.CLOSED, ShpGroups.NOTSTRAIGHT} + * TYPE = ShpTyps.Circle + * def __init__(self, x: Number, y: Number, r: Number, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< + * """ + * Args: + */ + + /* 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_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("collisions.Circle.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":1420 + * self.x, self.y, self.r = x, y, r + * + * @property # <<<<<<<<<<<<<< + * def d(self): + * """The diameter of the circle.""" + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_6Circle_3d(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_10collisions_6Circle_2d, "The diameter of the circle."); +static PyMethodDef __pyx_mdef_10collisions_6Circle_3d = {"d", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_3d, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Circle_2d}; +static PyObject *__pyx_pw_10collisions_6Circle_3d(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("d (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1420, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 1367, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "d") < 0)) __PYX_ERR(0, 1420, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -45527,7 +47388,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1367, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("d", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1420, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -45537,11 +47398,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Line.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Circle.d", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_4Line_44__str__(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_6Circle_2d(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -45554,84 +47415,46 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_4Line_44__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_6Circle_2d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - Py_UCS4 __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_2 = NULL; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__str__", 1); + __Pyx_RefNannySetupContext("d", 1); - /* "collisions.py":1368 - * - * def __str__(self): - * return f'' # <<<<<<<<<<<<<< + /* "collisions.py":1423 + * def d(self): + * """The diameter of the circle.""" + * return self.r*2 # <<<<<<<<<<<<<< * - * class Circle(Shape): + * @d.setter */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1368, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = 0; - __pyx_t_3 = 127; - __Pyx_INCREF(__pyx_kp_u_Line_from); - __pyx_t_2 += 11; - __Pyx_GIVEREF(__pyx_kp_u_Line_from); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Line_from); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1368, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1368, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; - __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_5); - PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); - __pyx_t_5 = 0; - __Pyx_INCREF(__pyx_kp_u_to); - __pyx_t_2 += 4; - __Pyx_GIVEREF(__pyx_kp_u_to); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_to); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_p2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1368, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1368, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; - __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_4); - PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_4); - __pyx_t_4 = 0; - __Pyx_INCREF(__pyx_kp_u__5); - __pyx_t_2 += 1; - __Pyx_GIVEREF(__pyx_kp_u__5); - PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u__5); - __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1368, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyInt_MultiplyObjC(__pyx_t_1, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1423, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1367 - * return iter((self.p1, self.p2)) - * - * def __str__(self): # <<<<<<<<<<<<<< - * return f'' + /* "collisions.py":1420 + * self.x, self.y, self.r = x, y, r * + * @property # <<<<<<<<<<<<<< + * def d(self): + * """The diameter of the circle.""" */ /* function exit code */ __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("collisions.Line.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("collisions.Circle.d", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -45639,66 +47462,24 @@ static PyObject *__pyx_pf_10collisions_4Line_44__str__(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":1376 - * GROUPS = {ShpGroups.CLOSED, ShpGroups.NOTSTRAIGHT} - * TYPE = ShpTyps.Circle - * def __init__(self, x: Number, y: Number, r: Number, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< - * """ - * Args: +/* "collisions.py":1425 + * return self.r*2 + * + * @d.setter # <<<<<<<<<<<<<< + * def d(self, value): + * self.r = value/2 */ -static PyObject *__pyx_pf_10collisions_42__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { - PyObject *__pyx_r = NULL; - __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("__defaults__", 1); - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1376, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1376, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1376, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1376, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 1376, __pyx_L1_error); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None)) __PYX_ERR(0, 1376, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("collisions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_1__init__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Circle_5d(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_6Circle___init__, "\n Args:\n x (Number): The x ordinate of the centre of this circle.\n y (Number): The y ordinate of the centre of this circle.\n r (Number): The radius of the circle\n bounciness (float, optional): How bouncy this object is. 1 = rebounds perfectly, <1 = eventually will stop, >1 = will bounce more each time. Defaults to 0.7.\n "); -static PyMethodDef __pyx_mdef_10collisions_6Circle_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Circle___init__}; -static PyObject *__pyx_pw_10collisions_6Circle_1__init__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_6Circle_5d = {"d", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_5d, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_6Circle_5d(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -45706,21 +47487,18 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_x = 0; - PyObject *__pyx_v_y = 0; - PyObject *__pyx_v_r = 0; - double __pyx_v_bounciness; + PyObject *__pyx_v_value = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[5] = {0,0,0,0,0}; + PyObject* values[2] = {0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); + __Pyx_RefNannySetupContext("d (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -45730,17 +47508,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_r,&__pyx_n_s_bounciness,0}; - __pyx_defaults12 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_self); + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); @@ -45755,75 +47526,35 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1376, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1425, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_value)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1376, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 1); __PYX_ERR(0, 1376, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_y)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1376, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 2); __PYX_ERR(0, 1376, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_r)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1376, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1425, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 3); __PYX_ERR(0, 1376, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bounciness); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1376, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("d", 1, 2, 2, 1); __PYX_ERR(0, 1425, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 1376, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "d") < 0)) __PYX_ERR(0, 1425, __pyx_L3_error) } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; } else { - switch (__pyx_nargs) { - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } __pyx_v_self = values[0]; - __pyx_v_x = values[1]; - __pyx_v_y = values[2]; - __pyx_v_r = values[3]; - if (values[4]) { - __pyx_v_bounciness = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_bounciness == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1376, __pyx_L3_error) - } else { - __pyx_v_bounciness = __pyx_dynamic_args->__pyx_arg_bounciness; - } + __pyx_v_value = values[1]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, __pyx_nargs); __PYX_ERR(0, 1376, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("d", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1425, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -45833,11 +47564,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("collisions.Circle.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Circle.d", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Circle___init__(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_y, __pyx_v_r, __pyx_v_bounciness); + __pyx_r = __pyx_pf_10collisions_6Circle_4d(__pyx_self, __pyx_v_self, __pyx_v_value); /* function exit code */ { @@ -45850,96 +47581,33 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Circle___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_r, double __pyx_v_bounciness) { +static PyObject *__pyx_pf_10collisions_6Circle_4d(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - unsigned int __pyx_t_5; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("__init__", 1); + __Pyx_RefNannySetupContext("d", 1); - /* "collisions.py":1384 - * bounciness (float, optional): How bouncy this object is. 1 = rebounds perfectly, <1 = eventually will stop, >1 = will bounce more each time. Defaults to 0.7. - * """ - * super().__init__(bounciness) # <<<<<<<<<<<<<< - * self.x, self.y, self.r = x, y, r - * - */ - __pyx_t_2 = __Pyx_CyFunction_GetClassObj(__pyx_self); - if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 1384, __pyx_L1_error) } - __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1384, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 1384, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_self); - __Pyx_GIVEREF(__pyx_v_self); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(0, 1384, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1384, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1384, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1384, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1384, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "collisions.py":1385 - * """ - * super().__init__(bounciness) - * self.x, self.y, self.r = x, y, r # <<<<<<<<<<<<<< + /* "collisions.py":1427 + * @d.setter + * def d(self, value): + * self.r = value/2 # <<<<<<<<<<<<<< * * def rect(self) -> Iterable[Number]: */ - __pyx_t_1 = __pyx_v_x; - __Pyx_INCREF(__pyx_t_1); - __pyx_t_3 = __pyx_v_y; - __Pyx_INCREF(__pyx_t_3); - __pyx_t_2 = __pyx_v_r; - __Pyx_INCREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_1) < 0) __PYX_ERR(0, 1385, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_TrueDivideObjC(__pyx_v_value, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1427, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_r, __pyx_t_1) < 0) __PYX_ERR(0, 1427, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_3) < 0) __PYX_ERR(0, 1385, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_r, __pyx_t_2) < 0) __PYX_ERR(0, 1385, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":1376 - * GROUPS = {ShpGroups.CLOSED, ShpGroups.NOTSTRAIGHT} - * TYPE = ShpTyps.Circle - * def __init__(self, x: Number, y: Number, r: Number, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< - * """ - * Args: + /* "collisions.py":1425 + * return self.r*2 + * + * @d.setter # <<<<<<<<<<<<<< + * def d(self, value): + * self.r = value/2 */ /* function exit code */ @@ -45947,10 +47615,7 @@ static PyObject *__pyx_pf_10collisions_6Circle___init__(CYTHON_UNUSED PyObject * 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_AddTraceback("collisions.Circle.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Circle.d", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -45958,8 +47623,8 @@ static PyObject *__pyx_pf_10collisions_6Circle___init__(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "collisions.py":1387 - * self.x, self.y, self.r = x, y, r +/* "collisions.py":1429 + * self.r = value/2 * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ @@ -45967,16 +47632,16 @@ static PyObject *__pyx_pf_10collisions_6Circle___init__(CYTHON_UNUSED PyObject * */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_3rect(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Circle_7rect(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_6Circle_2rect, "\n Returns the rectangle bounding box surrounding this circle.\n\n Returns:\n Iterable[Number]: (min x, min y, max x, max y)\n "); -static PyMethodDef __pyx_mdef_10collisions_6Circle_3rect = {"rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_3rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Circle_2rect}; -static PyObject *__pyx_pw_10collisions_6Circle_3rect(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_6Circle_6rect, "\n Returns the rectangle bounding box surrounding this circle.\n\n Returns:\n Iterable[Number]: (min x, min y, max x, max y)\n "); +static PyMethodDef __pyx_mdef_10collisions_6Circle_7rect = {"rect", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_7rect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Circle_6rect}; +static PyObject *__pyx_pw_10collisions_6Circle_7rect(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -46020,12 +47685,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1387, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1429, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rect") < 0)) __PYX_ERR(0, 1387, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rect") < 0)) __PYX_ERR(0, 1429, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -46036,7 +47701,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1429, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -46050,7 +47715,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Circle_2rect(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_6Circle_6rect(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -46063,7 +47728,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Circle_2rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_6Circle_6rect(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -46077,7 +47742,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_2rect(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rect", 1); - /* "collisions.py":1394 + /* "collisions.py":1436 * Iterable[Number]: (min x, min y, max x, max y) * """ * return self.x - self.r, self.y - self.r, self.x + self.r, self.y + self.r # <<<<<<<<<<<<<< @@ -46085,48 +47750,48 @@ static PyObject *__pyx_pf_10collisions_6Circle_2rect(CYTHON_UNUSED PyObject *__p * def area(self) -> Number: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1394, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1394, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1394, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1394, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1394, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1394, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1394, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1394, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1394, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1394, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1394, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1394, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1394, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 1394, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 1436, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4)) __PYX_ERR(0, 1394, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4)) __PYX_ERR(0, 1436, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_5)) __PYX_ERR(0, 1394, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_5)) __PYX_ERR(0, 1436, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_6)) __PYX_ERR(0, 1394, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_6)) __PYX_ERR(0, 1436, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; @@ -46135,8 +47800,8 @@ static PyObject *__pyx_pf_10collisions_6Circle_2rect(CYTHON_UNUSED PyObject *__p __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1387 - * self.x, self.y, self.r = x, y, r + /* "collisions.py":1429 + * self.r = value/2 * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ @@ -46159,7 +47824,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_2rect(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "collisions.py":1396 +/* "collisions.py":1438 * return self.x - self.r, self.y - self.r, self.x + self.r, self.y + self.r * * def area(self) -> Number: # <<<<<<<<<<<<<< @@ -46168,16 +47833,16 @@ static PyObject *__pyx_pf_10collisions_6Circle_2rect(CYTHON_UNUSED PyObject *__p */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_5area(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Circle_9area(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_6Circle_4area, "\n Gets the area of the circle.\n\n Returns:\n Number: The area of the circle.\n "); -static PyMethodDef __pyx_mdef_10collisions_6Circle_5area = {"area", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_5area, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Circle_4area}; -static PyObject *__pyx_pw_10collisions_6Circle_5area(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_6Circle_8area, "\n Gets the area of the circle.\n\n Returns:\n Number: The area of the circle.\n "); +static PyMethodDef __pyx_mdef_10collisions_6Circle_9area = {"area", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_9area, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Circle_8area}; +static PyObject *__pyx_pw_10collisions_6Circle_9area(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -46221,12 +47886,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1396, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1438, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "area") < 0)) __PYX_ERR(0, 1396, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "area") < 0)) __PYX_ERR(0, 1438, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -46237,7 +47902,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1396, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1438, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -46251,7 +47916,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Circle_4area(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_6Circle_8area(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -46264,7 +47929,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Circle_4area(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_6Circle_8area(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -46275,7 +47940,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_4area(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("area", 1); - /* "collisions.py":1403 + /* "collisions.py":1445 * Number: The area of the circle. * """ * return math.pi * self.r**2 # <<<<<<<<<<<<<< @@ -46283,17 +47948,17 @@ static PyObject *__pyx_pf_10collisions_6Circle_4area(CYTHON_UNUSED PyObject *__p * def _contains(self, othershape: Shape) -> bool: */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1403, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1403, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1403, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1403, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1403, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -46301,7 +47966,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_4area(CYTHON_UNUSED PyObject *__p __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1396 + /* "collisions.py":1438 * return self.x - self.r, self.y - self.r, self.x + self.r, self.y + self.r * * def area(self) -> Number: # <<<<<<<<<<<<<< @@ -46322,7 +47987,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_4area(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "collisions.py":1405 +/* "collisions.py":1447 * return math.pi * self.r**2 * * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< @@ -46331,15 +47996,15 @@ static PyObject *__pyx_pf_10collisions_6Circle_4area(CYTHON_UNUSED PyObject *__p */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_7_contains(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Circle_11_contains(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_6Circle_7_contains = {"_contains", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_7_contains, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Circle_7_contains(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_6Circle_11_contains = {"_contains", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_11_contains, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_6Circle_11_contains(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -46386,7 +48051,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1405, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1447, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -46394,14 +48059,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1405, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1447, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, 1); __PYX_ERR(0, 1405, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, 1); __PYX_ERR(0, 1447, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_contains") < 0)) __PYX_ERR(0, 1405, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_contains") < 0)) __PYX_ERR(0, 1447, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -46414,7 +48079,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1405, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1447, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -46428,7 +48093,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Circle_6_contains(__pyx_self, __pyx_v_self, __pyx_v_othershape); + __pyx_r = __pyx_pf_10collisions_6Circle_10_contains(__pyx_self, __pyx_v_self, __pyx_v_othershape); /* function exit code */ { @@ -46442,7 +48107,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10collisions_6Circle_9_contains_2generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "collisions.py":1416 +/* "collisions.py":1458 * return self._contains(ps[0]) and self._contains(ps[1]) * if checkShpType(othershape, ShpGroups.CLOSED): * return all(self._contains(Point(*p)) for p in othershape.toPoints()) # <<<<<<<<<<<<<< @@ -46451,29 +48116,29 @@ static PyObject *__pyx_gb_10collisions_6Circle_9_contains_2generator6(__pyx_Coro */ static PyObject *__pyx_pf_10collisions_6Circle_9_contains_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10collisions___pyx_scope_struct_10_genexpr *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_11_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_10_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_10_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_10_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_11_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_11_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_11_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_10_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_11_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1416, __pyx_L1_error) + __PYX_ERR(0, 1458, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_9__contains *) __pyx_self; + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_10__contains *) __pyx_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_6Circle_9_contains_2generator6, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Circle__contains_locals_genexpr, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 1416, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_6Circle_9_contains_2generator6, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Circle__contains_locals_genexpr, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 1458, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -46491,7 +48156,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_9_contains_genexpr(PyObject *__py static PyObject *__pyx_gb_10collisions_6Circle_9_contains_2generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10collisions___pyx_scope_struct_10_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_10_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10collisions___pyx_scope_struct_11_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_11_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -46516,16 +48181,16 @@ static PyObject *__pyx_gb_10collisions_6Circle_9_contains_2generator6(__pyx_Coro return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1416, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1416, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1458, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1458, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1416, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1416, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1458, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -46533,28 +48198,28 @@ static PyObject *__pyx_gb_10collisions_6Circle_9_contains_2generator6(__pyx_Coro { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1416, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1458, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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_ERR(0, 1416, __pyx_L1_error) + __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_ERR(0, 1458, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1416, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1416, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1458, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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_ERR(0, 1416, __pyx_L1_error) + __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_ERR(0, 1458, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1416, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -46564,7 +48229,7 @@ static PyObject *__pyx_gb_10collisions_6Circle_9_contains_2generator6(__pyx_Coro PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1416, __pyx_L1_error) + else __PYX_ERR(0, 1458, __pyx_L1_error) } break; } @@ -46574,14 +48239,14 @@ static PyObject *__pyx_gb_10collisions_6Circle_9_contains_2generator6(__pyx_Coro __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_p, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1416, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_contains); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1416, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1458, __pyx_L1_error) } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_contains); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Point); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1416, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Point); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_p); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1416, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_p); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1416, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -46604,11 +48269,11 @@ static PyObject *__pyx_gb_10collisions_6Circle_9_contains_2generator6(__pyx_Coro __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1416, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1416, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = (!__pyx_t_10); if (__pyx_t_11) { @@ -46650,7 +48315,7 @@ static PyObject *__pyx_gb_10collisions_6Circle_9_contains_2generator6(__pyx_Coro return __pyx_r; } -/* "collisions.py":1405 +/* "collisions.py":1447 * return math.pi * self.r**2 * * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< @@ -46658,8 +48323,8 @@ static PyObject *__pyx_gb_10collisions_6Circle_9_contains_2generator6(__pyx_Coro * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < self.r**2 */ -static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { - struct __pyx_obj_10collisions___pyx_scope_struct_9__contains *__pyx_cur_scope; +static PyObject *__pyx_pf_10collisions_6Circle_10_contains(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { + struct __pyx_obj_10collisions___pyx_scope_struct_10__contains *__pyx_cur_scope; PyObject *__pyx_v_ps = NULL; PyObject *__pyx_gb_10collisions_6Circle_9_contains_2generator6 = 0; PyObject *__pyx_r = NULL; @@ -46677,11 +48342,11 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_contains", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_9__contains *)__pyx_tp_new_10collisions___pyx_scope_struct_9__contains(__pyx_ptype_10collisions___pyx_scope_struct_9__contains, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_10__contains *)__pyx_tp_new_10collisions___pyx_scope_struct_10__contains(__pyx_ptype_10collisions___pyx_scope_struct_10__contains, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_9__contains *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_10__contains *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1405, __pyx_L1_error) + __PYX_ERR(0, 1447, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -46689,18 +48354,18 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); - /* "collisions.py":1406 + /* "collisions.py":1448 * * def _contains(self, othershape: Shape) -> bool: * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < self.r**2 * if checkShpType(othershape, ShpTyps.Line): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1406, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1406, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1406, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -46722,15 +48387,15 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1406, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1406, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1448, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":1407 + /* "collisions.py":1449 * def _contains(self, othershape: Shape) -> bool: * if checkShpType(othershape, ShpTyps.Point): * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < self.r**2 # <<<<<<<<<<<<<< @@ -46738,45 +48403,45 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject * return self._contains(Point(*othershape.p1)) and self._contains(Point(*othershape.p2)) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1407, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1407, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1407, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1407, __pyx_L1_error) + __pyx_t_2 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1407, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1407, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1407, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1407, __pyx_L1_error) + __pyx_t_1 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1407, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1407, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1407, __pyx_L1_error) + __pyx_t_2 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1407, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1406 + /* "collisions.py":1448 * * def _contains(self, othershape: Shape) -> bool: * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< @@ -46785,18 +48450,18 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject */ } - /* "collisions.py":1408 + /* "collisions.py":1450 * if checkShpType(othershape, ShpTyps.Point): * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < self.r**2 * if checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< * return self._contains(Point(*othershape.p1)) and self._contains(Point(*othershape.p2)) * if checkShpType(othershape, ShpTyps.Circle): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1408, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1408, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Line); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1408, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Line); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -46818,15 +48483,15 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1408, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1408, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1450, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":1409 + /* "collisions.py":1451 * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < self.r**2 * if checkShpType(othershape, ShpTyps.Line): * return self._contains(Point(*othershape.p1)) and self._contains(Point(*othershape.p2)) # <<<<<<<<<<<<<< @@ -46834,16 +48499,16 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < max(self.r-othershape.r, 0)**2 */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_contains); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1409, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_contains); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1409, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1409, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1409, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1409, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -46866,11 +48531,11 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1409, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1409, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1451, __pyx_L1_error) if (__pyx_t_6) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { @@ -46879,16 +48544,16 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L5_bool_binop_done; } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_contains); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1409, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_contains); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1409, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1409, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1409, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1409, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -46911,7 +48576,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1409, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1451, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -46923,7 +48588,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1408 + /* "collisions.py":1450 * if checkShpType(othershape, ShpTyps.Point): * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < self.r**2 * if checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< @@ -46932,18 +48597,18 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject */ } - /* "collisions.py":1410 + /* "collisions.py":1452 * if checkShpType(othershape, ShpTyps.Line): * return self._contains(Point(*othershape.p1)) and self._contains(Point(*othershape.p2)) * if checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < max(self.r-othershape.r, 0)**2 * if checkShpType(othershape, ShpTyps.Arc): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1410, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1410, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Circle); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1410, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Circle); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -46965,15 +48630,15 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1410, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1452, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1410, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1452, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":1411 + /* "collisions.py":1453 * return self._contains(Point(*othershape.p1)) and self._contains(Point(*othershape.p2)) * if checkShpType(othershape, ShpTyps.Circle): * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < max(self.r-othershape.r, 0)**2 # <<<<<<<<<<<<<< @@ -46981,49 +48646,49 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject * ps = othershape.toPoints() */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1411, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1411, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1411, __pyx_L1_error) + __pyx_t_8 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Power(__pyx_t_8, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1411, __pyx_L1_error) + __pyx_t_2 = PyNumber_Power(__pyx_t_8, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1411, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1411, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1411, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1411, __pyx_L1_error) + __pyx_t_1 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1411, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_9 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1411, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1411, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1411, __pyx_L1_error) + __pyx_t_8 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1411, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1411, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1453, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1411, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1453, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { - __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1411, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; @@ -47032,17 +48697,17 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject __pyx_t_2 = __pyx_t_8; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1411, __pyx_L1_error) + __pyx_t_8 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1453, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1411, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1453, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1410 + /* "collisions.py":1452 * if checkShpType(othershape, ShpTyps.Line): * return self._contains(Point(*othershape.p1)) and self._contains(Point(*othershape.p2)) * if checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< @@ -47051,18 +48716,18 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject */ } - /* "collisions.py":1412 + /* "collisions.py":1454 * if checkShpType(othershape, ShpTyps.Circle): * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < max(self.r-othershape.r, 0)**2 * if checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< * ps = othershape.toPoints() * return self._contains(ps[0]) and self._contains(ps[1]) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1412, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1412, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Arc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1412, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Arc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -47084,22 +48749,22 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1412, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1412, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1454, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "collisions.py":1413 + /* "collisions.py":1455 * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < max(self.r-othershape.r, 0)**2 * if checkShpType(othershape, ShpTyps.Arc): * ps = othershape.toPoints() # <<<<<<<<<<<<<< * return self._contains(ps[0]) and self._contains(ps[1]) * if checkShpType(othershape, ShpGroups.CLOSED): */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1413, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = NULL; __pyx_t_5 = 0; @@ -47119,14 +48784,14 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1413, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1455, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_v_ps = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":1414 + /* "collisions.py":1456 * if checkShpType(othershape, ShpTyps.Arc): * ps = othershape.toPoints() * return self._contains(ps[0]) and self._contains(ps[1]) # <<<<<<<<<<<<<< @@ -47134,9 +48799,9 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject * return all(self._contains(Point(*p)) for p in othershape.toPoints()) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_contains); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1414, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_contains); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_ps, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1414, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_ps, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; __pyx_t_5 = 0; @@ -47157,11 +48822,11 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1414, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1414, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1456, __pyx_L1_error) if (__pyx_t_6) { __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { @@ -47170,9 +48835,9 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L9_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_contains); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1414, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_contains); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_ps, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1414, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_ps, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; __pyx_t_5 = 0; @@ -47193,7 +48858,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1414, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1456, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -47205,7 +48870,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1412 + /* "collisions.py":1454 * if checkShpType(othershape, ShpTyps.Circle): * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < max(self.r-othershape.r, 0)**2 * if checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< @@ -47214,18 +48879,18 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject */ } - /* "collisions.py":1415 + /* "collisions.py":1457 * ps = othershape.toPoints() * return self._contains(ps[0]) and self._contains(ps[1]) * if checkShpType(othershape, ShpGroups.CLOSED): # <<<<<<<<<<<<<< * return all(self._contains(Point(*p)) for p in othershape.toPoints()) * */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1415, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1415, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CLOSED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1415, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CLOSED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -47247,15 +48912,15 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1415, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1415, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1457, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "collisions.py":1416 + /* "collisions.py":1458 * return self._contains(ps[0]) and self._contains(ps[1]) * if checkShpType(othershape, ShpGroups.CLOSED): * return all(self._contains(Point(*p)) for p in othershape.toPoints()) # <<<<<<<<<<<<<< @@ -47263,7 +48928,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject * def _collides(self, othershape: Shape) -> bool: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1416, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -47283,21 +48948,21 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1416, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __pyx_t_8 = __pyx_pf_10collisions_6Circle_9_contains_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1416, __pyx_L1_error) + __pyx_t_8 = __pyx_pf_10collisions_6Circle_9_contains_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_Generator_Next(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1416, __pyx_L1_error) + __pyx_t_2 = __Pyx_Generator_Next(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1415 + /* "collisions.py":1457 * ps = othershape.toPoints() * return self._contains(ps[0]) and self._contains(ps[1]) * if checkShpType(othershape, ShpGroups.CLOSED): # <<<<<<<<<<<<<< @@ -47306,7 +48971,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject */ } - /* "collisions.py":1405 + /* "collisions.py":1447 * return math.pi * self.r**2 * * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< @@ -47335,7 +49000,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":1418 +/* "collisions.py":1460 * return all(self._contains(Point(*p)) for p in othershape.toPoints()) * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< @@ -47344,15 +49009,15 @@ static PyObject *__pyx_pf_10collisions_6Circle_6_contains(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_9_collides(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Circle_13_collides(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_6Circle_9_collides = {"_collides", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_9_collides, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Circle_9_collides(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_6Circle_13_collides = {"_collides", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_13_collides, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_6Circle_13_collides(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -47399,7 +49064,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1418, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1460, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -47407,14 +49072,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1418, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1460, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 1418, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 1460, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_collides") < 0)) __PYX_ERR(0, 1418, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_collides") < 0)) __PYX_ERR(0, 1460, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -47427,7 +49092,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1418, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1460, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -47441,7 +49106,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Circle_8_collides(__pyx_self, __pyx_v_self, __pyx_v_othershape); + __pyx_r = __pyx_pf_10collisions_6Circle_12_collides(__pyx_self, __pyx_v_self, __pyx_v_othershape); /* function exit code */ { @@ -47454,7 +49119,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Circle_8_collides(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { +static PyObject *__pyx_pf_10collisions_6Circle_12_collides(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { PyObject *__pyx_v_line_mag = NULL; PyObject *__pyx_v_u = NULL; PyObject *__pyx_v_ix = NULL; @@ -47476,18 +49141,18 @@ static PyObject *__pyx_pf_10collisions_6Circle_8_collides(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_collides", 1); - /* "collisions.py":1419 + /* "collisions.py":1461 * * def _collides(self, othershape: Shape) -> bool: * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 <= self.r**2 * if checkShpType(othershape, ShpTyps.Line): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1419, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1419, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1419, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -47509,15 +49174,15 @@ static PyObject *__pyx_pf_10collisions_6Circle_8_collides(CYTHON_UNUSED PyObject __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1419, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1461, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1419, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1461, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":1420 + /* "collisions.py":1462 * def _collides(self, othershape: Shape) -> bool: * if checkShpType(othershape, ShpTyps.Point): * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 <= self.r**2 # <<<<<<<<<<<<<< @@ -47525,45 +49190,45 @@ static PyObject *__pyx_pf_10collisions_6Circle_8_collides(CYTHON_UNUSED PyObject * if not self.check_rects(othershape): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1420, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1420, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1420, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1420, __pyx_L1_error) + __pyx_t_2 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1420, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1420, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1420, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1420, __pyx_L1_error) + __pyx_t_1 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1420, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1420, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1420, __pyx_L1_error) + __pyx_t_2 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1420, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1462, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1419 + /* "collisions.py":1461 * * def _collides(self, othershape: Shape) -> bool: * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< @@ -47572,18 +49237,18 @@ static PyObject *__pyx_pf_10collisions_6Circle_8_collides(CYTHON_UNUSED PyObject */ } - /* "collisions.py":1421 + /* "collisions.py":1463 * if checkShpType(othershape, ShpTyps.Point): * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 <= self.r**2 * if checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< * if not self.check_rects(othershape): * return False */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1421, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1421, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Line); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1421, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Line); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -47605,22 +49270,22 @@ static PyObject *__pyx_pf_10collisions_6Circle_8_collides(CYTHON_UNUSED PyObject __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1421, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1421, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1463, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":1422 + /* "collisions.py":1464 * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 <= self.r**2 * if checkShpType(othershape, ShpTyps.Line): * if not self.check_rects(othershape): # <<<<<<<<<<<<<< * return False * # Calculate the distance from point to the line segment */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_rects); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1422, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_rects); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -47640,16 +49305,16 @@ static PyObject *__pyx_pf_10collisions_6Circle_8_collides(CYTHON_UNUSED PyObject PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_othershape}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1422, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1422, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1464, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = (!__pyx_t_6); if (__pyx_t_7) { - /* "collisions.py":1423 + /* "collisions.py":1465 * if checkShpType(othershape, ShpTyps.Line): * if not self.check_rects(othershape): * return False # <<<<<<<<<<<<<< @@ -47661,7 +49326,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_8_collides(CYTHON_UNUSED PyObject __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":1422 + /* "collisions.py":1464 * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 <= self.r**2 * if checkShpType(othershape, ShpTyps.Line): * if not self.check_rects(othershape): # <<<<<<<<<<<<<< @@ -47670,65 +49335,65 @@ static PyObject *__pyx_pf_10collisions_6Circle_8_collides(CYTHON_UNUSED PyObject */ } - /* "collisions.py":1425 + /* "collisions.py":1467 * return False * # Calculate the distance from point to the line segment * line_mag = (othershape.p2[0] - othershape.p1[0]) ** 2 + (othershape.p2[1] - othershape.p1[1]) ** 2 # <<<<<<<<<<<<<< * if line_mag == 0: * return (self.x - othershape.p1[0]) ** 2 + (self.y - othershape.p1[1]) ** 2 <= self.r ** 2 */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1425, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1425, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1425, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1425, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1425, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1425, __pyx_L1_error) + __pyx_t_4 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1425, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1425, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1425, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1425, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1425, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1425, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1425, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_line_mag = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":1426 + /* "collisions.py":1468 * # Calculate the distance from point to the line segment * line_mag = (othershape.p2[0] - othershape.p1[0]) ** 2 + (othershape.p2[1] - othershape.p1[1]) ** 2 * if line_mag == 0: # <<<<<<<<<<<<<< * return (self.x - othershape.p1[0]) ** 2 + (self.y - othershape.p1[1]) ** 2 <= self.r ** 2 * */ - __pyx_t_7 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_line_mag, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1426, __pyx_L1_error) + __pyx_t_7 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_line_mag, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1468, __pyx_L1_error) if (__pyx_t_7) { - /* "collisions.py":1427 + /* "collisions.py":1469 * line_mag = (othershape.p2[0] - othershape.p1[0]) ** 2 + (othershape.p2[1] - othershape.p1[1]) ** 2 * if line_mag == 0: * return (self.x - othershape.p1[0]) ** 2 + (self.y - othershape.p1[1]) ** 2 <= self.r ** 2 # <<<<<<<<<<<<<< @@ -47736,51 +49401,51 @@ static PyObject *__pyx_pf_10collisions_6Circle_8_collides(CYTHON_UNUSED PyObject * u = ((self.x - othershape.p1[0]) * (othershape.p2[0] - othershape.p1[0]) + (self.y - othershape.p1[1]) * (othershape.p2[1] - othershape.p1[1])) / line_mag */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1427, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1427, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1427, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1427, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1427, __pyx_L1_error) + __pyx_t_4 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1427, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1427, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1427, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1427, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1427, __pyx_L1_error) + __pyx_t_2 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1427, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1427, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1427, __pyx_L1_error) + __pyx_t_4 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1469, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1427, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1469, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1426 + /* "collisions.py":1468 * # Calculate the distance from point to the line segment * line_mag = (othershape.p2[0] - othershape.p1[0]) ** 2 + (othershape.p2[1] - othershape.p1[1]) ** 2 * if line_mag == 0: # <<<<<<<<<<<<<< @@ -47789,82 +49454,82 @@ static PyObject *__pyx_pf_10collisions_6Circle_8_collides(CYTHON_UNUSED PyObject */ } - /* "collisions.py":1429 + /* "collisions.py":1471 * return (self.x - othershape.p1[0]) ** 2 + (self.y - othershape.p1[1]) ** 2 <= self.r ** 2 * * u = ((self.x - othershape.p1[0]) * (othershape.p2[0] - othershape.p1[0]) + (self.y - othershape.p1[1]) * (othershape.p2[1] - othershape.p1[1])) / line_mag # <<<<<<<<<<<<<< * u = max(min(u, 1), 0) * ix = othershape.p1[0] + u * (othershape.p2[0] - othershape.p1[0]) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Multiply(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_8 = PyNumber_Multiply(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_v_line_mag); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_v_line_mag); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_u = __pyx_t_8; __pyx_t_8 = 0; - /* "collisions.py":1430 + /* "collisions.py":1472 * * u = ((self.x - othershape.p1[0]) * (othershape.p2[0] - othershape.p1[0]) + (self.y - othershape.p1[1]) * (othershape.p2[1] - othershape.p1[1])) / line_mag * u = max(min(u, 1), 0) # <<<<<<<<<<<<<< @@ -47875,14 +49540,14 @@ static PyObject *__pyx_pf_10collisions_6Circle_8_collides(CYTHON_UNUSED PyObject __pyx_t_10 = 1; __Pyx_INCREF(__pyx_v_u); __pyx_t_8 = __pyx_v_u; - __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1430, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1430, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1472, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1430, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1472, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_7) { - __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1430, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = __pyx_t_4; __pyx_t_4 = 0; @@ -47894,14 +49559,14 @@ static PyObject *__pyx_pf_10collisions_6Circle_8_collides(CYTHON_UNUSED PyObject __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1430, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1430, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_8, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1472, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1430, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1472, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_7) { - __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1430, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = __pyx_t_3; __pyx_t_3 = 0; @@ -47916,79 +49581,79 @@ static PyObject *__pyx_pf_10collisions_6Circle_8_collides(CYTHON_UNUSED PyObject __Pyx_DECREF_SET(__pyx_v_u, __pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1431 + /* "collisions.py":1473 * u = ((self.x - othershape.p1[0]) * (othershape.p2[0] - othershape.p1[0]) + (self.y - othershape.p1[1]) * (othershape.p2[1] - othershape.p1[1])) / line_mag * u = max(min(u, 1), 0) * ix = othershape.p1[0] + u * (othershape.p2[0] - othershape.p1[0]) # <<<<<<<<<<<<<< * iy = othershape.p1[1] + u * (othershape.p2[1] - othershape.p1[1]) * return (self.x - ix) ** 2 + (self.y - iy) ** 2 <= self.r ** 2 */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1431, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1431, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1431, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1431, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1431, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1431, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1431, __pyx_L1_error) + __pyx_t_8 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Multiply(__pyx_v_u, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1431, __pyx_L1_error) + __pyx_t_4 = PyNumber_Multiply(__pyx_v_u, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1431, __pyx_L1_error) + __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_ix = __pyx_t_8; __pyx_t_8 = 0; - /* "collisions.py":1432 + /* "collisions.py":1474 * u = max(min(u, 1), 0) * ix = othershape.p1[0] + u * (othershape.p2[0] - othershape.p1[0]) * iy = othershape.p1[1] + u * (othershape.p2[1] - othershape.p1[1]) # <<<<<<<<<<<<<< * return (self.x - ix) ** 2 + (self.y - iy) ** 2 <= self.r ** 2 * if checkShpType(othershape, ShpTyps.Circle): */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1432, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1432, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1432, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1432, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1432, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1432, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_8, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1432, __pyx_L1_error) + __pyx_t_8 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Multiply(__pyx_v_u, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1432, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_v_u, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1432, __pyx_L1_error) + __pyx_t_8 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_iy = __pyx_t_8; __pyx_t_8 = 0; - /* "collisions.py":1433 + /* "collisions.py":1475 * ix = othershape.p1[0] + u * (othershape.p2[0] - othershape.p1[0]) * iy = othershape.p1[1] + u * (othershape.p2[1] - othershape.p1[1]) * return (self.x - ix) ** 2 + (self.y - iy) ** 2 <= self.r ** 2 # <<<<<<<<<<<<<< @@ -47996,39 +49661,39 @@ static PyObject *__pyx_pf_10collisions_6Circle_8_collides(CYTHON_UNUSED PyObject * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < (self.r + othershape.r)**2 */ __Pyx_XDECREF(__pyx_r); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1433, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_8, __pyx_v_ix); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1433, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_8, __pyx_v_ix); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1433, __pyx_L1_error) + __pyx_t_8 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1433, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_v_iy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1433, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_v_iy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1433, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1433, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1433, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1433, __pyx_L1_error) + __pyx_t_8 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_8, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1433, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_8, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1475, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":1421 + /* "collisions.py":1463 * if checkShpType(othershape, ShpTyps.Point): * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 <= self.r**2 * if checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< @@ -48037,18 +49702,18 @@ static PyObject *__pyx_pf_10collisions_6Circle_8_collides(CYTHON_UNUSED PyObject */ } - /* "collisions.py":1434 + /* "collisions.py":1476 * iy = othershape.p1[1] + u * (othershape.p2[1] - othershape.p1[1]) * return (self.x - ix) ** 2 + (self.y - iy) ** 2 <= self.r ** 2 * if checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < (self.r + othershape.r)**2 * return othershape._collides(self) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1434, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1434, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Circle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1434, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Circle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -48070,15 +49735,15 @@ static PyObject *__pyx_pf_10collisions_6Circle_8_collides(CYTHON_UNUSED PyObject __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1434, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1434, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 1476, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_7) { - /* "collisions.py":1435 + /* "collisions.py":1477 * return (self.x - ix) ** 2 + (self.y - iy) ** 2 <= self.r ** 2 * if checkShpType(othershape, ShpTyps.Circle): * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < (self.r + othershape.r)**2 # <<<<<<<<<<<<<< @@ -48086,51 +49751,51 @@ static PyObject *__pyx_pf_10collisions_6Circle_8_collides(CYTHON_UNUSED PyObject * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1435, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1435, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1435, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1435, __pyx_L1_error) + __pyx_t_8 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1435, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1435, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1435, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1435, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1435, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1435, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1435, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1435, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1435, __pyx_L1_error) + __pyx_t_8 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1435, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1477, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1434 + /* "collisions.py":1476 * iy = othershape.p1[1] + u * (othershape.p2[1] - othershape.p1[1]) * return (self.x - ix) ** 2 + (self.y - iy) ** 2 <= self.r ** 2 * if checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< @@ -48139,7 +49804,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_8_collides(CYTHON_UNUSED PyObject */ } - /* "collisions.py":1436 + /* "collisions.py":1478 * if checkShpType(othershape, ShpTyps.Circle): * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < (self.r + othershape.r)**2 * return othershape._collides(self) # <<<<<<<<<<<<<< @@ -48147,7 +49812,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_8_collides(CYTHON_UNUSED PyObject * def _where(self, othershape: Shape) -> Iterable[pointLike]: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1436, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -48162,83 +49827,201 @@ static PyObject *__pyx_pf_10collisions_6Circle_8_collides(CYTHON_UNUSED PyObject __pyx_t_5 = 1; } } - #endif + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_self}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1478, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "collisions.py":1460 + * return all(self._contains(Point(*p)) for p in othershape.toPoints()) + * + * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Point): + * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 <= self.r**2 + */ + + /* function exit code */ + __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_8); + __Pyx_AddTraceback("collisions.Circle._collides", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_line_mag); + __Pyx_XDECREF(__pyx_v_u); + __Pyx_XDECREF(__pyx_v_ix); + __Pyx_XDECREF(__pyx_v_iy); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":1480 + * return othershape._collides(self) + * + * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Point): + * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_6Circle_15_where(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_10collisions_6Circle_15_where = {"_where", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_15_where, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_6Circle_15_where(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_othershape = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[2] = {0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("_where (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_othershape,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1480, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_othershape)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1480, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, 1); __PYX_ERR(0, 1480, __pyx_L3_error) + } + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_where") < 0)) __PYX_ERR(0, 1480, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 2)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + } + __pyx_v_self = values[0]; + __pyx_v_othershape = values[1]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1480, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; { - PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_self}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1436, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } } - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "collisions.py":1418 - * return all(self._contains(Point(*p)) for p in othershape.toPoints()) - * - * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< - * if checkShpType(othershape, ShpTyps.Point): - * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 <= self.r**2 - */ + __Pyx_AddTraceback("collisions.Circle._where", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_6Circle_14_where(__pyx_self, __pyx_v_self, __pyx_v_othershape); /* function exit code */ - __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_8); - __Pyx_AddTraceback("collisions.Circle._collides", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_line_mag); - __Pyx_XDECREF(__pyx_v_u); - __Pyx_XDECREF(__pyx_v_ix); - __Pyx_XDECREF(__pyx_v_iy); - __Pyx_XGIVEREF(__pyx_r); + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* "collisions.py":1438 - * return othershape._collides(self) - * - * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * if checkShpType(othershape, ShpTyps.Point): - * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] +/* "collisions.py":1486 + * if not self.check_rects(othershape): + * return [] + * def sign(x): # <<<<<<<<<<<<<< + * return -1 if x < 0 else 1 + * x1 = othershape.p1[0] - self.x */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_11_where(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Circle_6_where_1sign(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_6Circle_11_where = {"_where", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_11_where, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Circle_11_where(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_6Circle_6_where_1sign = {"sign", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_6_where_1sign, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_6Circle_6_where_1sign(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_othershape = 0; + PyObject *__pyx_v_x = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[2] = {0,0}; + PyObject* values[1] = {0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; PyObject *__pyx_r = 0; __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("_where (wrapper)", 0); + __Pyx_RefNannySetupContext("sign (wrapper)", 0); #if !CYTHON_METH_FASTCALL #if CYTHON_ASSUME_SAFE_MACROS __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); @@ -48248,12 +50031,10 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_othershape,0}; + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); CYTHON_FALLTHROUGH; case 0: break; @@ -48262,39 +50043,27 @@ PyObject *__pyx_args, PyObject *__pyx_kwds kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); switch (__pyx_nargs) { case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1438, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1486, __pyx_L3_error) else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_othershape)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1438, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, 1); __PYX_ERR(0, 1438, __pyx_L3_error) - } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_where") < 0)) __PYX_ERR(0, 1438, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "sign") < 0)) __PYX_ERR(0, 1486, __pyx_L3_error) } - } else if (unlikely(__pyx_nargs != 2)) { + } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; } else { values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); } - __pyx_v_self = values[0]; - __pyx_v_othershape = values[1]; + __pyx_v_x = values[0]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1438, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("sign", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1486, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -48303,378 +50072,1168 @@ PyObject *__pyx_args, PyObject *__pyx_kwds for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } - } - __Pyx_AddTraceback("collisions.Circle._where", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Circle_10_where(__pyx_self, __pyx_v_self, __pyx_v_othershape); - - /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + __Pyx_AddTraceback("collisions.Circle._where.sign", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_6Circle_6_where_sign(__pyx_self, __pyx_v_x); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +static PyObject *__pyx_pf_10collisions_6Circle_6_where_sign(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + int __pyx_t_3; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("sign", 1); + + /* "collisions.py":1487 + * return [] + * def sign(x): + * return -1 if x < 0 else 1 # <<<<<<<<<<<<<< + * x1 = othershape.p1[0] - self.x + * y1 = othershape.p1[1] - self.y + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyObject_RichCompare(__pyx_v_x, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1487, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1487, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_3) { + __Pyx_INCREF(__pyx_int_neg_1); + __pyx_t_1 = __pyx_int_neg_1; + } else { + __Pyx_INCREF(__pyx_int_1); + __pyx_t_1 = __pyx_int_1; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "collisions.py":1486 + * if not self.check_rects(othershape): + * return [] + * def sign(x): # <<<<<<<<<<<<<< + * return -1 if x < 0 else 1 + * x1 = othershape.p1[0] - self.x + */ + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("collisions.Circle._where.sign", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":1480 + * return othershape._collides(self) + * + * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Point): + * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] + */ + +static PyObject *__pyx_pf_10collisions_6Circle_14_where(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { + PyObject *__pyx_v_sign = 0; + PyObject *__pyx_v_x1 = NULL; + PyObject *__pyx_v_y1 = NULL; + PyObject *__pyx_v_x2 = NULL; + PyObject *__pyx_v_y2 = NULL; + PyObject *__pyx_v_dx = NULL; + PyObject *__pyx_v_dy = NULL; + PyObject *__pyx_v_dr = NULL; + PyObject *__pyx_v_D = NULL; + PyObject *__pyx_v_discriminant = NULL; + PyObject *__pyx_v_xa = NULL; + PyObject *__pyx_v_ya = NULL; + PyObject *__pyx_v_ta = NULL; + PyObject *__pyx_v_discRoot = NULL; + PyObject *__pyx_v_xpt = NULL; + PyObject *__pyx_v_xb = NULL; + PyObject *__pyx_v_yb = NULL; + PyObject *__pyx_v_tb = NULL; + PyObject *__pyx_v_d = NULL; + PyObject *__pyx_v_r2 = NULL; + PyObject *__pyx_v_a = NULL; + PyObject *__pyx_v_h = NULL; + PyObject *__pyx_v_x3 = NULL; + PyObject *__pyx_v_y3 = NULL; + PyObject *__pyx_v_x4 = NULL; + PyObject *__pyx_v_y4 = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + unsigned int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + int __pyx_t_8; + PyObject *__pyx_t_9 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_where", 1); + + /* "collisions.py":1481 + * + * def _where(self, othershape: Shape) -> Iterable[pointLike]: + * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< + * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] + * if checkShpType(othershape, ShpTyps.Line): + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (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); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_othershape, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1481, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1481, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + + /* "collisions.py":1482 + * def _where(self, othershape: Shape) -> Iterable[pointLike]: + * if checkShpType(othershape, ShpTyps.Point): + * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Line): + * if not self.check_rects(othershape): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Power(__pyx_t_7, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1482, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1482, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_6) { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_2)) __PYX_ERR(0, 1482, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_4)) __PYX_ERR(0, 1482, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_t_4 = 0; + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_7)) __PYX_ERR(0, 1482, __pyx_L1_error); + __pyx_t_7 = 0; + __pyx_t_1 = __pyx_t_4; + __pyx_t_4 = 0; + } else { + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1482, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __pyx_t_4; + __pyx_t_4 = 0; + } + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "collisions.py":1481 + * + * def _where(self, othershape: Shape) -> Iterable[pointLike]: + * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< + * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] + * if checkShpType(othershape, ShpTyps.Line): + */ + } + + /* "collisions.py":1483 + * if checkShpType(othershape, ShpTyps.Point): + * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] + * if checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< + * if not self.check_rects(othershape): + * return [] + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1483, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1483, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1483, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_othershape, __pyx_t_2}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1483, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1483, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { + + /* "collisions.py":1484 + * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] + * if checkShpType(othershape, ShpTyps.Line): + * if not self.check_rects(othershape): # <<<<<<<<<<<<<< + * return [] + * def sign(x): + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_rects); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_othershape}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1484, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1484, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_8 = (!__pyx_t_6); + if (__pyx_t_8) { + + /* "collisions.py":1485 + * if checkShpType(othershape, ShpTyps.Line): + * if not self.check_rects(othershape): + * return [] # <<<<<<<<<<<<<< + * def sign(x): + * return -1 if x < 0 else 1 + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1485, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; + goto __pyx_L0; + + /* "collisions.py":1484 + * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] + * if checkShpType(othershape, ShpTyps.Line): + * if not self.check_rects(othershape): # <<<<<<<<<<<<<< + * return [] + * def sign(x): + */ + } + + /* "collisions.py":1486 + * if not self.check_rects(othershape): + * return [] + * def sign(x): # <<<<<<<<<<<<<< + * return -1 if x < 0 else 1 + * x1 = othershape.p1[0] - self.x + */ + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_6_where_1sign, 0, __pyx_n_s_Circle__where_locals_sign, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1486, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_sign = __pyx_t_1; + __pyx_t_1 = 0; + + /* "collisions.py":1488 + * def sign(x): + * return -1 if x < 0 else 1 + * x1 = othershape.p1[0] - self.x # <<<<<<<<<<<<<< + * y1 = othershape.p1[1] - self.y + * x2 = othershape.p2[0] - self.x + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1488, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1488, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1488, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1488, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_x1 = __pyx_t_2; + __pyx_t_2 = 0; + + /* "collisions.py":1489 + * return -1 if x < 0 else 1 + * x1 = othershape.p1[0] - self.x + * y1 = othershape.p1[1] - self.y # <<<<<<<<<<<<<< + * x2 = othershape.p2[0] - self.x + * y2 = othershape.p2[1] - self.y + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1489, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1489, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1489, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1489, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_y1 = __pyx_t_4; + __pyx_t_4 = 0; + + /* "collisions.py":1490 + * x1 = othershape.p1[0] - self.x + * y1 = othershape.p1[1] - self.y + * x2 = othershape.p2[0] - self.x # <<<<<<<<<<<<<< + * y2 = othershape.p2[1] - self.y + * dx = x2 - x1 + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1490, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1490, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1490, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1490, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_x2 = __pyx_t_1; + __pyx_t_1 = 0; + + /* "collisions.py":1491 + * y1 = othershape.p1[1] - self.y + * x2 = othershape.p2[0] - self.x + * y2 = othershape.p2[1] - self.y # <<<<<<<<<<<<<< + * dx = x2 - x1 + * dy = y2 - y1 + */ + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1491, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1491, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1491, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1491, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_y2 = __pyx_t_2; + __pyx_t_2 = 0; + + /* "collisions.py":1492 + * x2 = othershape.p2[0] - self.x + * y2 = othershape.p2[1] - self.y + * dx = x2 - x1 # <<<<<<<<<<<<<< + * dy = y2 - y1 + * dr = math.sqrt(dx*dx + dy*dy) + */ + __pyx_t_2 = PyNumber_Subtract(__pyx_v_x2, __pyx_v_x1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1492, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_dx = __pyx_t_2; + __pyx_t_2 = 0; + + /* "collisions.py":1493 + * y2 = othershape.p2[1] - self.y + * dx = x2 - x1 + * dy = y2 - y1 # <<<<<<<<<<<<<< + * dr = math.sqrt(dx*dx + dy*dy) + * if dr == 0: + */ + __pyx_t_2 = PyNumber_Subtract(__pyx_v_y2, __pyx_v_y1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1493, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_dy = __pyx_t_2; + __pyx_t_2 = 0; + + /* "collisions.py":1494 + * dx = x2 - x1 + * dy = y2 - y1 + * dr = math.sqrt(dx*dx + dy*dy) # <<<<<<<<<<<<<< + * if dr == 0: + * return self.whereCollides(Point(*othershape.p1)) + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1494, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1494, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Multiply(__pyx_v_dx, __pyx_v_dx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1494, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyNumber_Multiply(__pyx_v_dy, __pyx_v_dy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1494, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1494, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1494, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + __pyx_v_dr = __pyx_t_2; + __pyx_t_2 = 0; -/* "collisions.py":1444 - * if not self.check_rects(othershape): - * return [] - * def sign(x): # <<<<<<<<<<<<<< - * return -1 if x < 0 else 1 - * x1 = othershape.p1[0] - self.x + /* "collisions.py":1495 + * dy = y2 - y1 + * dr = math.sqrt(dx*dx + dy*dy) + * if dr == 0: # <<<<<<<<<<<<<< + * return self.whereCollides(Point(*othershape.p1)) + * D = x1 * y2 - x2 * y1 */ + __pyx_t_8 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_dr, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1495, __pyx_L1_error) + if (__pyx_t_8) { -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_6_where_1sign(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_6Circle_6_where_1sign = {"sign", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_6_where_1sign, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Circle_6_where_1sign(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_x = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("sign (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; + /* "collisions.py":1496 + * dr = math.sqrt(dx*dx + dy*dy) + * if dr == 0: + * return self.whereCollides(Point(*othershape.p1)) # <<<<<<<<<<<<<< + * D = x1 * y2 - x2 * y1 + * discriminant = self.r*self.r*dr*dr - D*D + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(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; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1444, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "sign") < 0)) __PYX_ERR(0, 1444, __pyx_L3_error) + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_7}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1496, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_x = values[0]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("sign", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1444, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("collisions.Circle._where.sign", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Circle_6_where_sign(__pyx_self, __pyx_v_x); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; - /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + /* "collisions.py":1495 + * dy = y2 - y1 + * dr = math.sqrt(dx*dx + dy*dy) + * if dr == 0: # <<<<<<<<<<<<<< + * return self.whereCollides(Point(*othershape.p1)) + * D = x1 * y2 - x2 * y1 + */ } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} -static PyObject *__pyx_pf_10collisions_6Circle_6_where_sign(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("sign", 1); + /* "collisions.py":1497 + * if dr == 0: + * return self.whereCollides(Point(*othershape.p1)) + * D = x1 * y2 - x2 * y1 # <<<<<<<<<<<<<< + * discriminant = self.r*self.r*dr*dr - D*D + * if discriminant < 0: + */ + __pyx_t_2 = PyNumber_Multiply(__pyx_v_x1, __pyx_v_y2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1497, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Multiply(__pyx_v_x2, __pyx_v_y1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1497, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyNumber_Subtract(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1497, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_D = __pyx_t_7; + __pyx_t_7 = 0; - /* "collisions.py":1445 + /* "collisions.py":1498 + * return self.whereCollides(Point(*othershape.p1)) + * D = x1 * y2 - x2 * y1 + * discriminant = self.r*self.r*dr*dr - D*D # <<<<<<<<<<<<<< + * if discriminant < 0: * return [] - * def sign(x): - * return -1 if x < 0 else 1 # <<<<<<<<<<<<<< - * x1 = othershape.p1[0] - self.x - * y1 = othershape.p1[1] - self.y */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_x, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1445, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 1445, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_3) { - __Pyx_INCREF(__pyx_int_neg_1); - __pyx_t_1 = __pyx_int_neg_1; - } else { - __Pyx_INCREF(__pyx_int_1); - __pyx_t_1 = __pyx_int_1; - } - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1498, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1498, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyNumber_Multiply(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1498, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_v_dr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1498, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_v_dr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1498, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Multiply(__pyx_v_D, __pyx_v_D); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1498, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyNumber_Subtract(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1498, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_discriminant = __pyx_t_7; + __pyx_t_7 = 0; - /* "collisions.py":1444 - * if not self.check_rects(othershape): + /* "collisions.py":1499 + * D = x1 * y2 - x2 * y1 + * discriminant = self.r*self.r*dr*dr - D*D + * if discriminant < 0: # <<<<<<<<<<<<<< * return [] - * def sign(x): # <<<<<<<<<<<<<< - * return -1 if x < 0 else 1 - * x1 = othershape.p1[0] - self.x + * if discriminant == 0: */ + __pyx_t_7 = PyObject_RichCompare(__pyx_v_discriminant, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1499, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1499, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_8) { - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("collisions.Circle._where.sign", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "collisions.py":1500 + * discriminant = self.r*self.r*dr*dr - D*D + * if discriminant < 0: + * return [] # <<<<<<<<<<<<<< + * if discriminant == 0: + * xa = (D * dy ) / (dr * dr) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1500, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; + goto __pyx_L0; -/* "collisions.py":1438 - * return othershape._collides(self) + /* "collisions.py":1499 + * D = x1 * y2 - x2 * y1 + * discriminant = self.r*self.r*dr*dr - D*D + * if discriminant < 0: # <<<<<<<<<<<<<< + * return [] + * if discriminant == 0: + */ + } + + /* "collisions.py":1501 + * if discriminant < 0: + * return [] + * if discriminant == 0: # <<<<<<<<<<<<<< + * xa = (D * dy ) / (dr * dr) + * ya = (-D * dx ) / (dr * dr) + */ + __pyx_t_8 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_discriminant, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1501, __pyx_L1_error) + if (__pyx_t_8) { + + /* "collisions.py":1502 + * return [] + * if discriminant == 0: + * xa = (D * dy ) / (dr * dr) # <<<<<<<<<<<<<< + * ya = (-D * dx ) / (dr * dr) + * ta = (xa-x1)*dx/dr + (ya-y1)*dy/dr + */ + __pyx_t_7 = PyNumber_Multiply(__pyx_v_D, __pyx_v_dy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1502, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = PyNumber_Multiply(__pyx_v_dr, __pyx_v_dr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1502, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1502, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_xa = __pyx_t_2; + __pyx_t_2 = 0; + + /* "collisions.py":1503 + * if discriminant == 0: + * xa = (D * dy ) / (dr * dr) + * ya = (-D * dx ) / (dr * dr) # <<<<<<<<<<<<<< + * ta = (xa-x1)*dx/dr + (ya-y1)*dy/dr + * return [(xa + self.x, ya + self.y)] if 0 < ta < dr else [] + */ + __pyx_t_2 = PyNumber_Negative(__pyx_v_D); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1503, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_v_dx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1503, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Multiply(__pyx_v_dr, __pyx_v_dr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1503, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1503, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_ya = __pyx_t_7; + __pyx_t_7 = 0; + + /* "collisions.py":1504 + * xa = (D * dy ) / (dr * dr) + * ya = (-D * dx ) / (dr * dr) + * ta = (xa-x1)*dx/dr + (ya-y1)*dy/dr # <<<<<<<<<<<<<< + * return [(xa + self.x, ya + self.y)] if 0 < ta < dr else [] * - * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * if checkShpType(othershape, ShpTyps.Point): - * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] */ + __pyx_t_7 = PyNumber_Subtract(__pyx_v_xa, __pyx_v_x1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = PyNumber_Multiply(__pyx_t_7, __pyx_v_dx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_v_dr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Subtract(__pyx_v_ya, __pyx_v_y1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_v_dy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_v_dr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1504, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_ta = __pyx_t_4; + __pyx_t_4 = 0; -static PyObject *__pyx_pf_10collisions_6Circle_10_where(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { - PyObject *__pyx_v_sign = 0; - PyObject *__pyx_v_x1 = NULL; - PyObject *__pyx_v_y1 = NULL; - PyObject *__pyx_v_x2 = NULL; - PyObject *__pyx_v_y2 = NULL; - PyObject *__pyx_v_dx = NULL; - PyObject *__pyx_v_dy = NULL; - PyObject *__pyx_v_dr = NULL; - PyObject *__pyx_v_D = NULL; - PyObject *__pyx_v_discriminant = NULL; - PyObject *__pyx_v_xa = NULL; - PyObject *__pyx_v_ya = NULL; - PyObject *__pyx_v_ta = NULL; - PyObject *__pyx_v_discRoot = NULL; - PyObject *__pyx_v_xpt = NULL; - PyObject *__pyx_v_xb = NULL; - PyObject *__pyx_v_yb = NULL; - PyObject *__pyx_v_tb = NULL; - PyObject *__pyx_v_d = NULL; - PyObject *__pyx_v_r2 = NULL; - PyObject *__pyx_v_a = NULL; - PyObject *__pyx_v_h = NULL; - PyObject *__pyx_v_x3 = NULL; - PyObject *__pyx_v_y3 = NULL; - PyObject *__pyx_v_x4 = NULL; - PyObject *__pyx_v_y4 = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - unsigned int __pyx_t_5; - int __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - int __pyx_t_8; - PyObject *__pyx_t_9 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("_where", 1); + /* "collisions.py":1505 + * ya = (-D * dx ) / (dr * dr) + * ta = (xa-x1)*dx/dr + (ya-y1)*dy/dr + * return [(xa + self.x, ya + self.y)] if 0 < ta < dr else [] # <<<<<<<<<<<<<< + * + * discRoot = math.sqrt(discriminant) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyObject_RichCompare(__pyx_int_0, __pyx_v_ta, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1505, __pyx_L1_error) + if (__Pyx_PyObject_IsTrue(__pyx_t_2)) { + __Pyx_DECREF(__pyx_t_2); + __pyx_t_2 = PyObject_RichCompare(__pyx_v_ta, __pyx_v_dr, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1505, __pyx_L1_error) + } + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1505, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_8) { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = PyNumber_Add(__pyx_v_xa, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyNumber_Add(__pyx_v_ya, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7)) __PYX_ERR(0, 1505, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1505, __pyx_L1_error); + __pyx_t_7 = 0; + __pyx_t_1 = 0; + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 1505, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_t_4 = __pyx_t_1; + __pyx_t_1 = 0; + } else { + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1505, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __pyx_t_1; + __pyx_t_1 = 0; + } + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "collisions.py":1501 + * if discriminant < 0: + * return [] + * if discriminant == 0: # <<<<<<<<<<<<<< + * xa = (D * dy ) / (dr * dr) + * ya = (-D * dx ) / (dr * dr) + */ + } - /* "collisions.py":1439 + /* "collisions.py":1507 + * return [(xa + self.x, ya + self.y)] if 0 < ta < dr else [] * - * def _where(self, othershape: Shape) -> Iterable[pointLike]: - * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< - * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] - * if checkShpType(othershape, ShpTyps.Line): + * discRoot = math.sqrt(discriminant) # <<<<<<<<<<<<<< + * + * xa = (D * dy + sign(dy) * dx * discRoot) / (dr * dr) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (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); - __pyx_t_5 = 1; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; + } } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_othershape, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1439, __pyx_L1_error) + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_discriminant}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1507, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_v_discRoot = __pyx_t_4; + __pyx_t_4 = 0; + + /* "collisions.py":1509 + * discRoot = math.sqrt(discriminant) + * + * xa = (D * dy + sign(dy) * dx * discRoot) / (dr * dr) # <<<<<<<<<<<<<< + * ya = (-D * dx + abs(dy) * discRoot) / (dr * dr) + * ta = (xa-x1)*dx/dr + (ya-y1)*dy/dr + */ + __pyx_t_4 = PyNumber_Multiply(__pyx_v_D, __pyx_v_dy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __pyx_pf_10collisions_6Circle_6_where_sign(__pyx_v_sign, __pyx_v_dy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_v_dx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1439, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_6) { + __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_discRoot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Multiply(__pyx_v_dr, __pyx_v_dr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_xa = __pyx_t_4; + __pyx_t_4 = 0; - /* "collisions.py":1440 - * def _where(self, othershape: Shape) -> Iterable[pointLike]: - * if checkShpType(othershape, ShpTyps.Point): - * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] # <<<<<<<<<<<<<< - * if checkShpType(othershape, ShpTyps.Line): - * if not self.check_rects(othershape): + /* "collisions.py":1510 + * + * xa = (D * dy + sign(dy) * dx * discRoot) / (dr * dr) + * ya = (-D * dx + abs(dy) * discRoot) / (dr * dr) # <<<<<<<<<<<<<< + * ta = (xa-x1)*dx/dr + (ya-y1)*dy/dr + * xpt = [(xa + self.x, ya + self.y)] if 0 < ta < dr else [] */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1440, __pyx_L1_error) + __pyx_t_4 = PyNumber_Negative(__pyx_v_D); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_v_dx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1440, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyNumber_Absolute(__pyx_v_dy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1440, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = PyNumber_Multiply(__pyx_t_4, __pyx_v_discRoot); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1440, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1440, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1440, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1440, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Power(__pyx_t_7, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1440, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Multiply(__pyx_v_dr, __pyx_v_dr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1440, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_ya = __pyx_t_2; + __pyx_t_2 = 0; + + /* "collisions.py":1511 + * xa = (D * dy + sign(dy) * dx * discRoot) / (dr * dr) + * ya = (-D * dx + abs(dy) * discRoot) / (dr * dr) + * ta = (xa-x1)*dx/dr + (ya-y1)*dy/dr # <<<<<<<<<<<<<< + * xpt = [(xa + self.x, ya + self.y)] if 0 < ta < dr else [] + * + */ + __pyx_t_2 = PyNumber_Subtract(__pyx_v_xa, __pyx_v_x1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1511, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_v_dx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1511, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1440, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_dr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1440, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_v_ya, __pyx_v_y1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1511, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_v_dy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1511, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1440, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_v_dr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1511, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1440, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1511, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_6) { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1440, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_ta = __pyx_t_4; + __pyx_t_4 = 0; + + /* "collisions.py":1512 + * ya = (-D * dx + abs(dy) * discRoot) / (dr * dr) + * ta = (xa-x1)*dx/dr + (ya-y1)*dy/dr + * xpt = [(xa + self.x, ya + self.y)] if 0 < ta < dr else [] # <<<<<<<<<<<<<< + * + * xb = (D * dy - sign(dy) * dx * discRoot) / (dr * dr) + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_ta, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1512, __pyx_L1_error) + if (__Pyx_PyObject_IsTrue(__pyx_t_1)) { + __Pyx_DECREF(__pyx_t_1); + __pyx_t_1 = PyObject_RichCompare(__pyx_v_ta, __pyx_v_dr, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1512, __pyx_L1_error) + } + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1512, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_8) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyNumber_Add(__pyx_v_xa, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1440, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1440, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyNumber_Add(__pyx_v_ya, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1512, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_2)) __PYX_ERR(0, 1440, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_4)) __PYX_ERR(0, 1440, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_t_4 = 0; - __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1440, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 1512, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_7)) __PYX_ERR(0, 1440, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7)) __PYX_ERR(0, 1512, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_t_7 = 0; + __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_1)) __PYX_ERR(0, 1512, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_4 = __pyx_t_7; __pyx_t_7 = 0; - __pyx_t_1 = __pyx_t_4; - __pyx_t_4 = 0; } else { - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1440, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1512, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __pyx_t_7; + __pyx_t_7 = 0; } - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; + __pyx_v_xpt = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; - /* "collisions.py":1439 + /* "collisions.py":1514 + * xpt = [(xa + self.x, ya + self.y)] if 0 < ta < dr else [] * - * def _where(self, othershape: Shape) -> Iterable[pointLike]: - * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< - * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] - * if checkShpType(othershape, ShpTyps.Line): + * xb = (D * dy - sign(dy) * dx * discRoot) / (dr * dr) # <<<<<<<<<<<<<< + * yb = (-D * dx - abs(dy) * discRoot) / (dr * dr) + * tb = (xb-x1)*dx/dr + (yb-y1)*dy/dr */ - } + __pyx_t_4 = PyNumber_Multiply(__pyx_v_D, __pyx_v_dy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1514, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __pyx_pf_10collisions_6Circle_6_where_sign(__pyx_v_sign, __pyx_v_dy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1514, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = PyNumber_Multiply(__pyx_t_7, __pyx_v_dx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1514, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyNumber_Multiply(__pyx_t_1, __pyx_v_discRoot); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1514, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1514, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyNumber_Multiply(__pyx_v_dr, __pyx_v_dr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1514, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1514, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_xb = __pyx_t_4; + __pyx_t_4 = 0; + + /* "collisions.py":1515 + * + * xb = (D * dy - sign(dy) * dx * discRoot) / (dr * dr) + * yb = (-D * dx - abs(dy) * discRoot) / (dr * dr) # <<<<<<<<<<<<<< + * tb = (xb-x1)*dx/dr + (yb-y1)*dy/dr + * xpt += [(xb + self.x, yb + self.y)] if 0 < tb < dr else [] + */ + __pyx_t_4 = PyNumber_Negative(__pyx_v_D); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = PyNumber_Multiply(__pyx_t_4, __pyx_v_dx); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyNumber_Absolute(__pyx_v_dy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = PyNumber_Multiply(__pyx_t_4, __pyx_v_discRoot); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Subtract(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Multiply(__pyx_v_dr, __pyx_v_dr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1515, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_yb = __pyx_t_7; + __pyx_t_7 = 0; + + /* "collisions.py":1516 + * xb = (D * dy - sign(dy) * dx * discRoot) / (dr * dr) + * yb = (-D * dx - abs(dy) * discRoot) / (dr * dr) + * tb = (xb-x1)*dx/dr + (yb-y1)*dy/dr # <<<<<<<<<<<<<< + * xpt += [(xb + self.x, yb + self.y)] if 0 < tb < dr else [] + * return xpt + */ + __pyx_t_7 = PyNumber_Subtract(__pyx_v_xb, __pyx_v_x1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1516, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = PyNumber_Multiply(__pyx_t_7, __pyx_v_dx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1516, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_dr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1516, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_v_yb, __pyx_v_y1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1516, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_v_dy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1516, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_v_dr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1516, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1516, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_tb = __pyx_t_4; + __pyx_t_4 = 0; + + /* "collisions.py":1517 + * yb = (-D * dx - abs(dy) * discRoot) / (dr * dr) + * tb = (xb-x1)*dx/dr + (yb-y1)*dy/dr + * xpt += [(xb + self.x, yb + self.y)] if 0 < tb < dr else [] # <<<<<<<<<<<<<< + * return xpt + * if checkShpType(othershape, ShpTyps.Circle): + */ + __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_tb, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1517, __pyx_L1_error) + if (__Pyx_PyObject_IsTrue(__pyx_t_1)) { + __Pyx_DECREF(__pyx_t_1); + __pyx_t_1 = PyObject_RichCompare(__pyx_v_tb, __pyx_v_dr, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1517, __pyx_L1_error) + } + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1517, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_8) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = PyNumber_Add(__pyx_v_xb, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyNumber_Add(__pyx_v_yb, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_7); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7)) __PYX_ERR(0, 1517, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 1517, __pyx_L1_error); + __pyx_t_7 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1517, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_4 = __pyx_t_2; + __pyx_t_2 = 0; + } else { + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __pyx_t_2; + __pyx_t_2 = 0; + } + __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_xpt, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1517, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF_SET(__pyx_v_xpt, ((PyObject*)__pyx_t_2)); + __pyx_t_2 = 0; + + /* "collisions.py":1518 + * tb = (xb-x1)*dx/dr + (yb-y1)*dy/dr + * xpt += [(xb + self.x, yb + self.y)] if 0 < tb < dr else [] + * return xpt # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Circle): + * if not self.check_rects(othershape): + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_xpt); + __pyx_r = __pyx_v_xpt; + goto __pyx_L0; - /* "collisions.py":1441 + /* "collisions.py":1483 * if checkShpType(othershape, ShpTyps.Point): * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] * if checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< * if not self.check_rects(othershape): * return [] */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1441, __pyx_L1_error) + } + + /* "collisions.py":1519 + * xpt += [(xb + self.x, yb + self.y)] if 0 < tb < dr else [] + * return xpt + * if checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< + * if not self.check_rects(othershape): + * return [] + */ + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1441, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Circle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1441, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = NULL; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_7)) { + __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_7); + __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; @@ -48682,35 +51241,35 @@ static PyObject *__pyx_pf_10collisions_6Circle_10_where(CYTHON_UNUSED PyObject * } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_othershape, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1441, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_othershape, __pyx_t_7}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1441, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_6) { + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1519, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_8) { - /* "collisions.py":1442 - * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] - * if checkShpType(othershape, ShpTyps.Line): + /* "collisions.py":1520 + * return xpt + * if checkShpType(othershape, ShpTyps.Circle): * if not self.check_rects(othershape): # <<<<<<<<<<<<<< * return [] - * def sign(x): + * # circle 1: (x0, y0), radius r0 */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_rects); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1442, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_rects); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = NULL; + __pyx_t_7 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_2)) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; @@ -48718,971 +51277,1256 @@ static PyObject *__pyx_pf_10collisions_6Circle_10_where(CYTHON_UNUSED PyObject * } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_othershape}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1442, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_othershape}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1520, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1442, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_8 = (!__pyx_t_6); - if (__pyx_t_8) { + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1520, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = (!__pyx_t_8); + if (__pyx_t_6) { - /* "collisions.py":1443 - * if checkShpType(othershape, ShpTyps.Line): + /* "collisions.py":1521 + * if checkShpType(othershape, ShpTyps.Circle): * if not self.check_rects(othershape): * return [] # <<<<<<<<<<<<<< - * def sign(x): - * return -1 if x < 0 else 1 + * # circle 1: (x0, y0), radius r0 + * # circle 2: (x1, y1), radius r1 */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1443, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1521, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1442 - * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] - * if checkShpType(othershape, ShpTyps.Line): + /* "collisions.py":1520 + * return xpt + * if checkShpType(othershape, ShpTyps.Circle): * if not self.check_rects(othershape): # <<<<<<<<<<<<<< * return [] - * def sign(x): + * # circle 1: (x0, y0), radius r0 */ } - /* "collisions.py":1444 - * if not self.check_rects(othershape): - * return [] - * def sign(x): # <<<<<<<<<<<<<< - * return -1 if x < 0 else 1 - * x1 = othershape.p1[0] - self.x - */ - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_6_where_1sign, 0, __pyx_n_s_Circle__where_locals_sign, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1444, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_sign = __pyx_t_1; - __pyx_t_1 = 0; - - /* "collisions.py":1446 - * def sign(x): - * return -1 if x < 0 else 1 - * x1 = othershape.p1[0] - self.x # <<<<<<<<<<<<<< - * y1 = othershape.p1[1] - self.y - * x2 = othershape.p2[0] - self.x - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1446, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1446, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1446, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1446, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_x1 = __pyx_t_2; - __pyx_t_2 = 0; - - /* "collisions.py":1447 - * return -1 if x < 0 else 1 - * x1 = othershape.p1[0] - self.x - * y1 = othershape.p1[1] - self.y # <<<<<<<<<<<<<< - * x2 = othershape.p2[0] - self.x - * y2 = othershape.p2[1] - self.y - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1447, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1447, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1447, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1447, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_y1 = __pyx_t_4; - __pyx_t_4 = 0; - - /* "collisions.py":1448 - * x1 = othershape.p1[0] - self.x - * y1 = othershape.p1[1] - self.y - * x2 = othershape.p2[0] - self.x # <<<<<<<<<<<<<< - * y2 = othershape.p2[1] - self.y - * dx = x2 - x1 + /* "collisions.py":1525 + * # circle 2: (x1, y1), radius r1 + * + * d=math.hypot(othershape.x-self.x, othershape.y-self.y) # <<<<<<<<<<<<<< + * + * # non intersecting */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1448, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1448, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_hypot); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1525, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_x2 = __pyx_t_1; - __pyx_t_1 = 0; - - /* "collisions.py":1449 - * y1 = othershape.p1[1] - self.y - * x2 = othershape.p2[0] - self.x - * y2 = othershape.p2[1] - self.y # <<<<<<<<<<<<<< - * dx = x2 - x1 - * dy = y2 - y1 - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1449, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1449, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1525, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_y2 = __pyx_t_2; - __pyx_t_2 = 0; - - /* "collisions.py":1450 - * x2 = othershape.p2[0] - self.x - * y2 = othershape.p2[1] - self.y - * dx = x2 - x1 # <<<<<<<<<<<<<< - * dy = y2 - y1 - * dr = math.sqrt(dx*dx + dy*dy) - */ - __pyx_t_2 = PyNumber_Subtract(__pyx_v_x2, __pyx_v_x1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1450, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_dx = __pyx_t_2; - __pyx_t_2 = 0; - - /* "collisions.py":1451 - * y2 = othershape.p2[1] - self.y - * dx = x2 - x1 - * dy = y2 - y1 # <<<<<<<<<<<<<< - * dr = math.sqrt(dx*dx + dy*dy) - * if dr == 0: - */ - __pyx_t_2 = PyNumber_Subtract(__pyx_v_y2, __pyx_v_y1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1451, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_dy = __pyx_t_2; - __pyx_t_2 = 0; - - /* "collisions.py":1452 - * dx = x2 - x1 - * dy = y2 - y1 - * dr = math.sqrt(dx*dx + dy*dy) # <<<<<<<<<<<<<< - * if dr == 0: - * return self.whereCollides(Point(*othershape.p1)) - */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1452, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1452, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); + __pyx_t_9 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1525, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Multiply(__pyx_v_dx, __pyx_v_dx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyNumber_Multiply(__pyx_v_dy, __pyx_v_dy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1452, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_7); + if (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_9}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1452, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_v_dr = __pyx_t_2; + __pyx_v_d = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":1453 - * dy = y2 - y1 - * dr = math.sqrt(dx*dx + dy*dy) - * if dr == 0: # <<<<<<<<<<<<<< - * return self.whereCollides(Point(*othershape.p1)) - * D = x1 * y2 - x2 * y1 + /* "collisions.py":1528 + * + * # non intersecting + * if d > self.r + othershape.r : # <<<<<<<<<<<<<< + * return [] + * # One circle within other */ - __pyx_t_8 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_dr, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1453, __pyx_L1_error) - if (__pyx_t_8) { + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1528, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1528, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = PyNumber_Add(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1528, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyObject_RichCompare(__pyx_v_d, __pyx_t_9, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1528, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1528, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__pyx_t_6) { - /* "collisions.py":1454 - * dr = math.sqrt(dx*dx + dy*dy) - * if dr == 0: - * return self.whereCollides(Point(*othershape.p1)) # <<<<<<<<<<<<<< - * D = x1 * y2 - x2 * y1 - * discriminant = self.r*self.r*dr*dr - D*D + /* "collisions.py":1529 + * # non intersecting + * if d > self.r + othershape.r : + * return [] # <<<<<<<<<<<<<< + * # One circle within other + * if d < abs(self.r-othershape.r): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1454, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1454, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1454, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1454, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1454, __pyx_L1_error) + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(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; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_7}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1454, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_r = __pyx_t_7; + __pyx_t_7 = 0; goto __pyx_L0; - /* "collisions.py":1453 - * dy = y2 - y1 - * dr = math.sqrt(dx*dx + dy*dy) - * if dr == 0: # <<<<<<<<<<<<<< - * return self.whereCollides(Point(*othershape.p1)) - * D = x1 * y2 - x2 * y1 + /* "collisions.py":1528 + * + * # non intersecting + * if d > self.r + othershape.r : # <<<<<<<<<<<<<< + * return [] + * # One circle within other */ } - /* "collisions.py":1455 - * if dr == 0: - * return self.whereCollides(Point(*othershape.p1)) - * D = x1 * y2 - x2 * y1 # <<<<<<<<<<<<<< - * discriminant = self.r*self.r*dr*dr - D*D - * if discriminant < 0: - */ - __pyx_t_2 = PyNumber_Multiply(__pyx_v_x1, __pyx_v_y2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Multiply(__pyx_v_x2, __pyx_v_y1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyNumber_Subtract(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1455, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_D = __pyx_t_7; - __pyx_t_7 = 0; - - /* "collisions.py":1456 - * return self.whereCollides(Point(*othershape.p1)) - * D = x1 * y2 - x2 * y1 - * discriminant = self.r*self.r*dr*dr - D*D # <<<<<<<<<<<<<< - * if discriminant < 0: + /* "collisions.py":1531 + * return [] + * # One circle within other + * if d < abs(self.r-othershape.r): # <<<<<<<<<<<<<< * return [] + * # coincident circles */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1456, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1456, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyNumber_Multiply(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1456, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1531, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = PyNumber_Subtract(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_v_dr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1456, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyNumber_Absolute(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1531, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_v_dr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1456, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Multiply(__pyx_v_D, __pyx_v_D); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1456, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyNumber_Subtract(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1456, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = PyObject_RichCompare(__pyx_v_d, __pyx_t_9, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1531, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_discriminant = __pyx_t_7; - __pyx_t_7 = 0; + if (__pyx_t_6) { - /* "collisions.py":1457 - * D = x1 * y2 - x2 * y1 - * discriminant = self.r*self.r*dr*dr - D*D - * if discriminant < 0: # <<<<<<<<<<<<<< + /* "collisions.py":1532 + * # One circle within other + * if d < abs(self.r-othershape.r): + * return [] # <<<<<<<<<<<<<< + * # coincident circles + * if d == 0 and self.r == othershape.r: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1532, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* "collisions.py":1531 * return [] - * if discriminant == 0: + * # One circle within other + * if d < abs(self.r-othershape.r): # <<<<<<<<<<<<<< + * return [] + * # coincident circles */ - __pyx_t_7 = PyObject_RichCompare(__pyx_v_discriminant, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1457, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1457, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + + /* "collisions.py":1534 + * return [] + * # coincident circles + * if d == 0 and self.r == othershape.r: # <<<<<<<<<<<<<< + * return [] + * else: + */ + __pyx_t_8 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_d, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1534, __pyx_L1_error) if (__pyx_t_8) { + } else { + __pyx_t_6 = __pyx_t_8; + goto __pyx_L14_bool_binop_done; + } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1534, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1534, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1534, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1534, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_6 = __pyx_t_8; + __pyx_L14_bool_binop_done:; + if (__pyx_t_6) { - /* "collisions.py":1458 - * discriminant = self.r*self.r*dr*dr - D*D - * if discriminant < 0: + /* "collisions.py":1535 + * # coincident circles + * if d == 0 and self.r == othershape.r: * return [] # <<<<<<<<<<<<<< - * if discriminant == 0: - * xa = (D * dy ) / (dr * dr) + * else: + * r2 = self.r**2 */ __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1458, __pyx_L1_error) + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; - /* "collisions.py":1457 - * D = x1 * y2 - x2 * y1 - * discriminant = self.r*self.r*dr*dr - D*D - * if discriminant < 0: # <<<<<<<<<<<<<< + /* "collisions.py":1534 * return [] - * if discriminant == 0: + * # coincident circles + * if d == 0 and self.r == othershape.r: # <<<<<<<<<<<<<< + * return [] + * else: */ } - /* "collisions.py":1459 - * if discriminant < 0: + /* "collisions.py":1537 * return [] - * if discriminant == 0: # <<<<<<<<<<<<<< - * xa = (D * dy ) / (dr * dr) - * ya = (-D * dx ) / (dr * dr) + * else: + * r2 = self.r**2 # <<<<<<<<<<<<<< + * a=(r2-othershape.r**2+d**2)/(2*d) + * h=math.sqrt(r2-a**2) */ - __pyx_t_8 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_discriminant, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1459, __pyx_L1_error) - if (__pyx_t_8) { + /*else*/ { + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = PyNumber_Power(__pyx_t_7, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1537, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_r2 = __pyx_t_9; + __pyx_t_9 = 0; - /* "collisions.py":1460 - * return [] - * if discriminant == 0: - * xa = (D * dy ) / (dr * dr) # <<<<<<<<<<<<<< - * ya = (-D * dx ) / (dr * dr) - * ta = (xa-x1)*dx/dr + (ya-y1)*dy/dr + /* "collisions.py":1538 + * else: + * r2 = self.r**2 + * a=(r2-othershape.r**2+d**2)/(2*d) # <<<<<<<<<<<<<< + * h=math.sqrt(r2-a**2) + * x2=self.x+a*(othershape.x-self.x)/d */ - __pyx_t_7 = PyNumber_Multiply(__pyx_v_D, __pyx_v_dy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1460, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1538, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_7 = PyNumber_Power(__pyx_t_9, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PyNumber_Multiply(__pyx_v_dr, __pyx_v_dr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1460, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1460, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_Subtract(__pyx_v_r2, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1538, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyNumber_Power(__pyx_v_d, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1538, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = PyNumber_Add(__pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_v_xa = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_7 = __Pyx_PyInt_MultiplyCObj(__pyx_int_2, __pyx_v_d, 2, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1538, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1538, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_a = __pyx_t_9; + __pyx_t_9 = 0; - /* "collisions.py":1461 - * if discriminant == 0: - * xa = (D * dy ) / (dr * dr) - * ya = (-D * dx ) / (dr * dr) # <<<<<<<<<<<<<< - * ta = (xa-x1)*dx/dr + (ya-y1)*dy/dr - * return [(xa + self.x, ya + self.y)] if 0 < ta < dr else [] + /* "collisions.py":1539 + * r2 = self.r**2 + * a=(r2-othershape.r**2+d**2)/(2*d) + * h=math.sqrt(r2-a**2) # <<<<<<<<<<<<<< + * x2=self.x+a*(othershape.x-self.x)/d + * y2=self.y+a*(othershape.y-self.y)/d */ - __pyx_t_2 = PyNumber_Negative(__pyx_v_D); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1461, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_math); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1539, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_v_dx); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1461, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Multiply(__pyx_v_dr, __pyx_v_dr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1461, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyNumber_Power(__pyx_v_a, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1539, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = PyNumber_Subtract(__pyx_v_r2, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1539, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3}; + __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1539, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_v_h = __pyx_t_9; + __pyx_t_9 = 0; + + /* "collisions.py":1540 + * a=(r2-othershape.r**2+d**2)/(2*d) + * h=math.sqrt(r2-a**2) + * x2=self.x+a*(othershape.x-self.x)/d # <<<<<<<<<<<<<< + * y2=self.y+a*(othershape.y-self.y)/d + * x3=x2+h*(othershape.y-self.y)/d + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1461, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_ya = __pyx_t_7; - __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Multiply(__pyx_v_a, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_v_x2 = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":1462 - * xa = (D * dy ) / (dr * dr) - * ya = (-D * dx ) / (dr * dr) - * ta = (xa-x1)*dx/dr + (ya-y1)*dy/dr # <<<<<<<<<<<<<< - * return [(xa + self.x, ya + self.y)] if 0 < ta < dr else [] - * + /* "collisions.py":1541 + * h=math.sqrt(r2-a**2) + * x2=self.x+a*(othershape.x-self.x)/d + * y2=self.y+a*(othershape.y-self.y)/d # <<<<<<<<<<<<<< + * x3=x2+h*(othershape.y-self.y)/d + * y3=y2-h*(othershape.x-self.x)/d */ - __pyx_t_7 = PyNumber_Subtract(__pyx_v_xa, __pyx_v_x1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1462, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1541, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = PyNumber_Multiply(__pyx_t_7, __pyx_v_dx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1462, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1541, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = PyNumber_Subtract(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_v_dr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1462, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_Multiply(__pyx_v_a, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1541, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Subtract(__pyx_v_ya, __pyx_v_y1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1462, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_9, __pyx_v_d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1541, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_v_dy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1462, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1541, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_v_dr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1462, __pyx_L1_error) + __pyx_v_y2 = __pyx_t_9; + __pyx_t_9 = 0; + + /* "collisions.py":1542 + * x2=self.x+a*(othershape.x-self.x)/d + * y2=self.y+a*(othershape.y-self.y)/d + * x3=x2+h*(othershape.y-self.y)/d # <<<<<<<<<<<<<< + * y3=y2-h*(othershape.x-self.x)/d + * + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1462, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_3 = PyNumber_Subtract(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_ta = __pyx_t_4; - __pyx_t_4 = 0; + __pyx_t_2 = PyNumber_Multiply(__pyx_v_h, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_v_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_v_x2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1542, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_x3 = __pyx_t_2; + __pyx_t_2 = 0; - /* "collisions.py":1463 - * ya = (-D * dx ) / (dr * dr) - * ta = (xa-x1)*dx/dr + (ya-y1)*dy/dr - * return [(xa + self.x, ya + self.y)] if 0 < ta < dr else [] # <<<<<<<<<<<<<< + /* "collisions.py":1543 + * y2=self.y+a*(othershape.y-self.y)/d + * x3=x2+h*(othershape.y-self.y)/d + * y3=y2-h*(othershape.x-self.x)/d # <<<<<<<<<<<<<< + * + * x4=x2-h*(othershape.y-self.y)/d + */ + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Multiply(__pyx_v_h, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_d); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Subtract(__pyx_v_y2, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1543, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_y3 = __pyx_t_3; + __pyx_t_3 = 0; + + /* "collisions.py":1545 + * y3=y2-h*(othershape.x-self.x)/d + * + * x4=x2-h*(othershape.y-self.y)/d # <<<<<<<<<<<<<< + * y4=y2+h*(othershape.x-self.x)/d + * + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_Multiply(__pyx_v_h, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_9, __pyx_v_d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_Subtract(__pyx_v_x2, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1545, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_x4 = __pyx_t_9; + __pyx_t_9 = 0; + + /* "collisions.py":1546 + * + * x4=x2-h*(othershape.y-self.y)/d + * y4=y2+h*(othershape.x-self.x)/d # <<<<<<<<<<<<<< + * + * return [[x3, y3], [x4, y4]] + */ + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1546, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1546, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Subtract(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1546, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Multiply(__pyx_v_h, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1546, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_v_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1546, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_v_y2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1546, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_y4 = __pyx_t_2; + __pyx_t_2 = 0; + + /* "collisions.py":1548 + * y4=y2+h*(othershape.x-self.x)/d + * + * return [[x3, y3], [x4, y4]] # <<<<<<<<<<<<<< + * return othershape._where(self) * - * discRoot = math.sqrt(discriminant) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyObject_RichCompare(__pyx_int_0, __pyx_v_ta, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1463, __pyx_L1_error) - if (__Pyx_PyObject_IsTrue(__pyx_t_2)) { - __Pyx_DECREF(__pyx_t_2); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_ta, __pyx_v_dr, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1463, __pyx_L1_error) + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1548, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_x3); + __Pyx_GIVEREF(__pyx_v_x3); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_x3)) __PYX_ERR(0, 1548, __pyx_L1_error); + __Pyx_INCREF(__pyx_v_y3); + __Pyx_GIVEREF(__pyx_v_y3); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_v_y3)) __PYX_ERR(0, 1548, __pyx_L1_error); + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1548, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_x4); + __Pyx_GIVEREF(__pyx_v_x4); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_x4)) __PYX_ERR(0, 1548, __pyx_L1_error); + __Pyx_INCREF(__pyx_v_y4); + __Pyx_GIVEREF(__pyx_v_y4); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_v_y4)) __PYX_ERR(0, 1548, __pyx_L1_error); + __pyx_t_9 = PyList_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1548, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_2)) __PYX_ERR(0, 1548, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_3)) __PYX_ERR(0, 1548, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L0; + } + + /* "collisions.py":1519 + * xpt += [(xb + self.x, yb + self.y)] if 0 < tb < dr else [] + * return xpt + * if checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< + * if not self.check_rects(othershape): + * return [] + */ + } + + /* "collisions.py":1549 + * + * return [[x3, y3], [x4, y4]] + * return othershape._where(self) # <<<<<<<<<<<<<< + * + * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike,Iterable[pointLike]]: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_where); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self}; + __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L0; + + /* "collisions.py":1480 + * return othershape._collides(self) + * + * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< + * if checkShpType(othershape, ShpTyps.Point): + * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] + */ + + /* function exit code */ + __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_7); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_AddTraceback("collisions.Circle._where", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_sign); + __Pyx_XDECREF(__pyx_v_x1); + __Pyx_XDECREF(__pyx_v_y1); + __Pyx_XDECREF(__pyx_v_x2); + __Pyx_XDECREF(__pyx_v_y2); + __Pyx_XDECREF(__pyx_v_dx); + __Pyx_XDECREF(__pyx_v_dy); + __Pyx_XDECREF(__pyx_v_dr); + __Pyx_XDECREF(__pyx_v_D); + __Pyx_XDECREF(__pyx_v_discriminant); + __Pyx_XDECREF(__pyx_v_xa); + __Pyx_XDECREF(__pyx_v_ya); + __Pyx_XDECREF(__pyx_v_ta); + __Pyx_XDECREF(__pyx_v_discRoot); + __Pyx_XDECREF(__pyx_v_xpt); + __Pyx_XDECREF(__pyx_v_xb); + __Pyx_XDECREF(__pyx_v_yb); + __Pyx_XDECREF(__pyx_v_tb); + __Pyx_XDECREF(__pyx_v_d); + __Pyx_XDECREF(__pyx_v_r2); + __Pyx_XDECREF(__pyx_v_a); + __Pyx_XDECREF(__pyx_v_h); + __Pyx_XDECREF(__pyx_v_x3); + __Pyx_XDECREF(__pyx_v_y3); + __Pyx_XDECREF(__pyx_v_x4); + __Pyx_XDECREF(__pyx_v_y4); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":1551 + * return othershape._where(self) + * + * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike,Iterable[pointLike]]: # <<<<<<<<<<<<<< + * """ + * Find the closest point ON this object TO another object. + */ + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_6Circle_17closestPointTo(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_10collisions_6Circle_16closestPointTo, "\n Find the closest point ON this object TO another object.\n\n Args:\n othershape (Shape): The other object to find the closest point to\n returnAll (bool, optional): Whether to return all the possible points in order of closeness or not. Defaults to False.\n\n Returns:\n pointLike / Iterable[pointLike]: The closest point(s, depending on returnAll) ON this object TO the othershape\n "); +static PyMethodDef __pyx_mdef_10collisions_6Circle_17closestPointTo = {"closestPointTo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_17closestPointTo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Circle_16closestPointTo}; +static PyObject *__pyx_pw_10collisions_6Circle_17closestPointTo(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_othershape = 0; + PyObject *__pyx_v_returnAll = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[3] = {0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("closestPointTo (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_othershape,&__pyx_n_s_returnAll,0}; + values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; } - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1463, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_8) { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1463, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyNumber_Add(__pyx_v_xa, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1463, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1463, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Add(__pyx_v_ya, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1463, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1463, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7)) __PYX_ERR(0, 1463, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1463, __pyx_L1_error); - __pyx_t_7 = 0; - __pyx_t_1 = 0; - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1463, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 1463, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_t_4 = __pyx_t_1; - __pyx_t_1 = 0; - } else { - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1463, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __pyx_t_1; - __pyx_t_1 = 0; + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1551, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_othershape)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1551, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, 1); __PYX_ERR(0, 1551, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_returnAll); + if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1551, __pyx_L3_error) + } } - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "collisions.py":1459 - * if discriminant < 0: - * return [] - * if discriminant == 0: # <<<<<<<<<<<<<< - * xa = (D * dy ) / (dr * dr) - * ya = (-D * dx ) / (dr * dr) - */ - } - - /* "collisions.py":1465 - * return [(xa + self.x, ya + self.y)] if 0 < ta < dr else [] - * - * discRoot = math.sqrt(discriminant) # <<<<<<<<<<<<<< - * - * xa = (D * dy + sign(dy) * dx * discRoot) / (dr * dr) - */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1465, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1465, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_5 = 1; + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "closestPointTo") < 0)) __PYX_ERR(0, 1551, __pyx_L3_error) + } + } else { + switch (__pyx_nargs) { + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; } } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_discriminant}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1465, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_self = values[0]; + __pyx_v_othershape = values[1]; + __pyx_v_returnAll = values[2]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1551, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } - __pyx_v_discRoot = __pyx_t_4; - __pyx_t_4 = 0; - - /* "collisions.py":1467 - * discRoot = math.sqrt(discriminant) - * - * xa = (D * dy + sign(dy) * dx * discRoot) / (dr * dr) # <<<<<<<<<<<<<< - * ya = (-D * dx + abs(dy) * discRoot) / (dr * dr) - * ta = (xa-x1)*dx/dr + (ya-y1)*dy/dr - */ - __pyx_t_4 = PyNumber_Multiply(__pyx_v_D, __pyx_v_dy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1467, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __pyx_pf_10collisions_6Circle_6_where_sign(__pyx_v_sign, __pyx_v_dy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1467, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_v_dx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1467, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_discRoot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1467, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1467, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Multiply(__pyx_v_dr, __pyx_v_dr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1467, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1467, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_xa = __pyx_t_4; - __pyx_t_4 = 0; + } + __Pyx_AddTraceback("collisions.Circle.closestPointTo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_6Circle_16closestPointTo(__pyx_self, __pyx_v_self, __pyx_v_othershape, __pyx_v_returnAll); - /* "collisions.py":1468 - * - * xa = (D * dy + sign(dy) * dx * discRoot) / (dr * dr) - * ya = (-D * dx + abs(dy) * discRoot) / (dr * dr) # <<<<<<<<<<<<<< - * ta = (xa-x1)*dx/dr + (ya-y1)*dy/dr - * xpt = [(xa + self.x, ya + self.y)] if 0 < ta < dr else [] - */ - __pyx_t_4 = PyNumber_Negative(__pyx_v_D); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1468, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_v_dx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1468, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyNumber_Absolute(__pyx_v_dy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1468, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_4, __pyx_v_discRoot); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1468, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1468, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Multiply(__pyx_v_dr, __pyx_v_dr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1468, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1468, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_ya = __pyx_t_2; - __pyx_t_2 = 0; + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "collisions.py":1469 - * xa = (D * dy + sign(dy) * dx * discRoot) / (dr * dr) - * ya = (-D * dx + abs(dy) * discRoot) / (dr * dr) - * ta = (xa-x1)*dx/dr + (ya-y1)*dy/dr # <<<<<<<<<<<<<< - * xpt = [(xa + self.x, ya + self.y)] if 0 < ta < dr else [] - * +/* "collisions.py":1582 + * return wheres[0] + * sort = sorted([othershape.p1, othershape.p2], + * key=lambda p: abs(self.r**2-((self.x-p[0])**2+(self.y-p[1])**2))) # <<<<<<<<<<<<<< + * if returnAll: + * return sort */ - __pyx_t_2 = PyNumber_Subtract(__pyx_v_xa, __pyx_v_x1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_v_dx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_dr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Subtract(__pyx_v_ya, __pyx_v_y1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_v_dy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_v_dr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_ta = __pyx_t_4; - __pyx_t_4 = 0; - /* "collisions.py":1470 - * ya = (-D * dx + abs(dy) * discRoot) / (dr * dr) - * ta = (xa-x1)*dx/dr + (ya-y1)*dy/dr - * xpt = [(xa + self.x, ya + self.y)] if 0 < ta < dr else [] # <<<<<<<<<<<<<< - * - * xb = (D * dy - sign(dy) * dx * discRoot) / (dr * dr) - */ - __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_ta, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1470, __pyx_L1_error) - if (__Pyx_PyObject_IsTrue(__pyx_t_1)) { - __Pyx_DECREF(__pyx_t_1); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_ta, __pyx_v_dr, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1470, __pyx_L1_error) - } - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1470, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_8) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1470, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Add(__pyx_v_xa, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1470, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1470, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyNumber_Add(__pyx_v_ya, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1470, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1470, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 1470, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_7)) __PYX_ERR(0, 1470, __pyx_L1_error); - __pyx_t_2 = 0; - __pyx_t_7 = 0; - __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1470, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_1)) __PYX_ERR(0, 1470, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_4 = __pyx_t_7; - __pyx_t_7 = 0; +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_6Circle_14closestPointTo_lambda14(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_10collisions_6Circle_14closestPointTo_lambda14 = {"lambda14", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_14closestPointTo_lambda14, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_6Circle_14closestPointTo_lambda14(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_p = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda14 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1582, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda14") < 0)) __PYX_ERR(0, 1582, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; } else { - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1470, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = __pyx_t_7; - __pyx_t_7 = 0; + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - __pyx_v_xpt = ((PyObject*)__pyx_t_4); - __pyx_t_4 = 0; + __pyx_v_p = values[0]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("lambda14", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1582, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("collisions.Circle.closestPointTo.lambda14", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_lambda_funcdef_lambda14(__pyx_self, __pyx_v_p); - /* "collisions.py":1472 - * xpt = [(xa + self.x, ya + self.y)] if 0 < ta < dr else [] - * - * xb = (D * dy - sign(dy) * dx * discRoot) / (dr * dr) # <<<<<<<<<<<<<< - * yb = (-D * dx - abs(dy) * discRoot) / (dr * dr) - * tb = (xb-x1)*dx/dr + (yb-y1)*dy/dr - */ - __pyx_t_4 = PyNumber_Multiply(__pyx_v_D, __pyx_v_dy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1472, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __pyx_pf_10collisions_6Circle_6_where_sign(__pyx_v_sign, __pyx_v_dy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1472, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_7, __pyx_v_dx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1472, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Multiply(__pyx_t_1, __pyx_v_discRoot); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1472, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Subtract(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1472, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Multiply(__pyx_v_dr, __pyx_v_dr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1472, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1472, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_v_xb = __pyx_t_4; - __pyx_t_4 = 0; + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "collisions.py":1473 - * - * xb = (D * dy - sign(dy) * dx * discRoot) / (dr * dr) - * yb = (-D * dx - abs(dy) * discRoot) / (dr * dr) # <<<<<<<<<<<<<< - * tb = (xb-x1)*dx/dr + (yb-y1)*dy/dr - * xpt += [(xb + self.x, yb + self.y)] if 0 < tb < dr else [] - */ - __pyx_t_4 = PyNumber_Negative(__pyx_v_D); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1473, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyNumber_Multiply(__pyx_t_4, __pyx_v_dx); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1473, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyNumber_Absolute(__pyx_v_dy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1473, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_4, __pyx_v_discRoot); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1473, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Subtract(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1473, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Multiply(__pyx_v_dr, __pyx_v_dr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1473, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1473, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_yb = __pyx_t_7; - __pyx_t_7 = 0; +static PyObject *__pyx_lambda_funcdef_lambda14(PyObject *__pyx_self, PyObject *__pyx_v_p) { + struct __pyx_obj_10collisions___pyx_scope_struct_12_closestPointTo *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_12_closestPointTo *__pyx_outer_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("lambda14", 1); + __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_12_closestPointTo *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + __Pyx_XDECREF(__pyx_r); + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1582, __pyx_L1_error) } + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1582, __pyx_L1_error) } + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1582, __pyx_L1_error) } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_5 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Power(__pyx_t_5, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_5; + __pyx_t_5 = 0; + goto __pyx_L0; - /* "collisions.py":1474 - * xb = (D * dy - sign(dy) * dx * discRoot) / (dr * dr) - * yb = (-D * dx - abs(dy) * discRoot) / (dr * dr) - * tb = (xb-x1)*dx/dr + (yb-y1)*dy/dr # <<<<<<<<<<<<<< - * xpt += [(xb + self.x, yb + self.y)] if 0 < tb < dr else [] - * return xpt - */ - __pyx_t_7 = PyNumber_Subtract(__pyx_v_xb, __pyx_v_x1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1474, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_7, __pyx_v_dx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1474, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_dr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1474, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Subtract(__pyx_v_yb, __pyx_v_y1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1474, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_v_dy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1474, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_v_dr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1474, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1474, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_tb = __pyx_t_4; - __pyx_t_4 = 0; + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_AddTraceback("collisions.Circle.closestPointTo.lambda14", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "collisions.py":1475 - * yb = (-D * dx - abs(dy) * discRoot) / (dr * dr) - * tb = (xb-x1)*dx/dr + (yb-y1)*dy/dr - * xpt += [(xb + self.x, yb + self.y)] if 0 < tb < dr else [] # <<<<<<<<<<<<<< - * return xpt - * if checkShpType(othershape, ShpTyps.Circle): +/* "collisions.py":1595 + * for ln in othershape.toLines(): + * ps.append(ln.closestPointTo(self)) + * ps.sort(key=lambda x: (x[0]-self.x)**2+(x[1]-self.y)**2) # <<<<<<<<<<<<<< + * if returnAll: + * return [self.closestPointTo(Point(*p)) for p in ps] */ - __pyx_t_1 = PyObject_RichCompare(__pyx_int_0, __pyx_v_tb, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1475, __pyx_L1_error) - if (__Pyx_PyObject_IsTrue(__pyx_t_1)) { - __Pyx_DECREF(__pyx_t_1); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_tb, __pyx_v_dr, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1475, __pyx_L1_error) - } - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1475, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_8) { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1475, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyNumber_Add(__pyx_v_xb, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1475, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1475, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Add(__pyx_v_yb, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1475, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1475, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_7)) __PYX_ERR(0, 1475, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 1475, __pyx_L1_error); - __pyx_t_7 = 0; - __pyx_t_2 = 0; - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1475, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1475, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_4 = __pyx_t_2; - __pyx_t_2 = 0; + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_6Circle_14closestPointTo_1lambda15(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_10collisions_6Circle_14closestPointTo_1lambda15 = {"lambda15", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_14closestPointTo_1lambda15, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_6Circle_14closestPointTo_1lambda15(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_x = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("lambda15 (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1595, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda15") < 0)) __PYX_ERR(0, 1595, __pyx_L3_error) + } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; } else { - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1475, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __pyx_t_2; - __pyx_t_2 = 0; + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + } + __pyx_v_x = values[0]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("lambda15", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1595, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("collisions.Circle.closestPointTo.lambda15", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_lambda_funcdef_lambda15(__pyx_self, __pyx_v_x); + + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } - __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_xpt, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1475, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF_SET(__pyx_v_xpt, ((PyObject*)__pyx_t_2)); - __pyx_t_2 = 0; + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "collisions.py":1476 - * tb = (xb-x1)*dx/dr + (yb-y1)*dy/dr - * xpt += [(xb + self.x, yb + self.y)] if 0 < tb < dr else [] - * return xpt # <<<<<<<<<<<<<< - * if checkShpType(othershape, ShpTyps.Circle): - * if not self.check_rects(othershape): - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_xpt); - __pyx_r = __pyx_v_xpt; - goto __pyx_L0; +static PyObject *__pyx_lambda_funcdef_lambda15(PyObject *__pyx_self, PyObject *__pyx_v_x) { + struct __pyx_obj_10collisions___pyx_scope_struct_12_closestPointTo *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_12_closestPointTo *__pyx_outer_scope; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("lambda15", 1); + __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_12_closestPointTo *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1595, __pyx_L1_error) } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1595, __pyx_L1_error) } + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; - /* "collisions.py":1441 - * if checkShpType(othershape, ShpTyps.Point): - * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] - * if checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< - * if not self.check_rects(othershape): - * return [] + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_XDECREF(__pyx_t_3); + __Pyx_XDECREF(__pyx_t_4); + __Pyx_AddTraceback("collisions.Circle.closestPointTo.lambda15", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* "collisions.py":1551 + * return othershape._where(self) + * + * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike,Iterable[pointLike]]: # <<<<<<<<<<<<<< + * """ + * Find the closest point ON this object TO another object. */ + +static PyObject *__pyx_pf_10collisions_6Circle_16closestPointTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape, PyObject *__pyx_v_returnAll) { + struct __pyx_obj_10collisions___pyx_scope_struct_12_closestPointTo *__pyx_cur_scope; + PyObject *__pyx_v_x = NULL; + PyObject *__pyx_v_y = NULL; + PyObject *__pyx_v_phi = NULL; + PyObject *__pyx_v_angle = NULL; + PyObject *__pyx_v_qx = NULL; + PyObject *__pyx_v_qy = NULL; + PyObject *__pyx_v_wheres = NULL; + PyObject *__pyx_v_sort = NULL; + PyObject *__pyx_v_ps = NULL; + PyObject *__pyx_v_ln = NULL; + PyObject *__pyx_9genexpr23__pyx_v_p = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + unsigned int __pyx_t_5; + int __pyx_t_6; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + PyObject *__pyx_t_10 = NULL; + PyObject *__pyx_t_11 = NULL; + PyObject *__pyx_t_12 = NULL; + Py_ssize_t __pyx_t_13; + PyObject *(*__pyx_t_14)(PyObject *); + int __pyx_t_15; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("closestPointTo", 0); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_12_closestPointTo *)__pyx_tp_new_10collisions___pyx_scope_struct_12_closestPointTo(__pyx_ptype_10collisions___pyx_scope_struct_12_closestPointTo, __pyx_empty_tuple, NULL); + if (unlikely(!__pyx_cur_scope)) { + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_12_closestPointTo *)Py_None); + __Pyx_INCREF(Py_None); + __PYX_ERR(0, 1551, __pyx_L1_error) + } else { + __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } + __pyx_cur_scope->__pyx_v_self = __pyx_v_self; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); - /* "collisions.py":1477 - * xpt += [(xb + self.x, yb + self.y)] if 0 < tb < dr else [] - * return xpt - * if checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< - * if not self.check_rects(othershape): - * return [] + /* "collisions.py":1562 + * pointLike / Iterable[pointLike]: The closest point(s, depending on returnAll) ON this object TO the othershape + * """ + * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< + * x, y = othershape.x - self.x, othershape.y - self.y + * #if abs(x)**2 + abs(y)**2 < self.r**2: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1477, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1477, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Circle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1477, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = NULL; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (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); + if (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_4, function); + __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_othershape, __pyx_t_7}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1477, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_othershape, __pyx_t_4}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1477, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_8) { + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1562, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_6) { - /* "collisions.py":1478 - * return xpt - * if checkShpType(othershape, ShpTyps.Circle): - * if not self.check_rects(othershape): # <<<<<<<<<<<<<< - * return [] - * # circle 1: (x0, y0), radius r0 + /* "collisions.py":1563 + * """ + * if checkShpType(othershape, ShpTyps.Point): + * x, y = othershape.x - self.x, othershape.y - self.y # <<<<<<<<<<<<<< + * #if abs(x)**2 + abs(y)**2 < self.r**2: + * # return othershape */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_rects); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1478, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_othershape}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1478, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1478, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = (!__pyx_t_8); - if (__pyx_t_6) { - - /* "collisions.py":1479 - * if checkShpType(othershape, ShpTyps.Circle): - * if not self.check_rects(othershape): - * return [] # <<<<<<<<<<<<<< - * # circle 1: (x0, y0), radius r0 - * # circle 2: (x1, y1), radius r1 - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1479, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "collisions.py":1478 - * return xpt - * if checkShpType(othershape, ShpTyps.Circle): - * if not self.check_rects(othershape): # <<<<<<<<<<<<<< - * return [] - * # circle 1: (x0, y0), radius r0 - */ - } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1563, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_x = __pyx_t_4; + __pyx_t_4 = 0; + __pyx_v_y = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":1483 - * # circle 2: (x1, y1), radius r1 - * - * d=math.hypot(othershape.x-self.x, othershape.y-self.y) # <<<<<<<<<<<<<< + /* "collisions.py":1566 + * #if abs(x)**2 + abs(y)**2 < self.r**2: + * # return othershape + * phi = (math.degrees(math.atan2(y, x)) - 90) % 360 # <<<<<<<<<<<<<< + * angle = math.radians(phi) * - * # non intersecting */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1483, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_hypot); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1483, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1483, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1483, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1483, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1483, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_degrees); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1483, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1483, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_atan2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_4)) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; @@ -49690,1178 +52534,714 @@ static PyObject *__pyx_pf_10collisions_6Circle_10_where(CYTHON_UNUSED PyObject * } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_9}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1483, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_y, __pyx_v_x}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_v_d = __pyx_t_2; - __pyx_t_2 = 0; - - /* "collisions.py":1486 - * - * # non intersecting - * if d > self.r + othershape.r : # <<<<<<<<<<<<<< - * return [] - * # One circle within other - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1486, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1486, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = PyNumber_Add(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1486, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_v_d, __pyx_t_9, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1486, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1486, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__pyx_t_6) { - - /* "collisions.py":1487 - * # non intersecting - * if d > self.r + othershape.r : - * return [] # <<<<<<<<<<<<<< - * # One circle within other - * if d < abs(self.r-othershape.r): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1487, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_r = __pyx_t_7; - __pyx_t_7 = 0; - goto __pyx_L0; - - /* "collisions.py":1486 - * - * # non intersecting - * if d > self.r + othershape.r : # <<<<<<<<<<<<<< - * return [] - * # One circle within other - */ - } - - /* "collisions.py":1489 - * return [] - * # One circle within other - * if d < abs(self.r-othershape.r): # <<<<<<<<<<<<<< - * return [] - * # coincident circles - */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1489, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1489, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1489, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyNumber_Absolute(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1489, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_v_d, __pyx_t_9, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1489, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1489, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_6) { - - /* "collisions.py":1490 - * # One circle within other - * if d < abs(self.r-othershape.r): - * return [] # <<<<<<<<<<<<<< - * # coincident circles - * if d == 0 and self.r == othershape.r: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1490, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* "collisions.py":1489 - * return [] - * # One circle within other - * if d < abs(self.r-othershape.r): # <<<<<<<<<<<<<< - * return [] - * # coincident circles - */ - } - - /* "collisions.py":1492 - * return [] - * # coincident circles - * if d == 0 and self.r == othershape.r: # <<<<<<<<<<<<<< - * return [] - * else: - */ - __pyx_t_8 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_d, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1492, __pyx_L1_error) - if (__pyx_t_8) { - } else { - __pyx_t_6 = __pyx_t_8; - goto __pyx_L14_bool_binop_done; - } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1492, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1492, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = PyObject_RichCompare(__pyx_t_2, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1492, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1492, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_6 = __pyx_t_8; - __pyx_L14_bool_binop_done:; - if (__pyx_t_6) { - - /* "collisions.py":1493 - * # coincident circles - * if d == 0 and self.r == othershape.r: - * return [] # <<<<<<<<<<<<<< - * else: - * r2 = self.r**2 - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1493, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_r = __pyx_t_7; - __pyx_t_7 = 0; - goto __pyx_L0; - - /* "collisions.py":1492 - * return [] - * # coincident circles - * if d == 0 and self.r == othershape.r: # <<<<<<<<<<<<<< - * return [] - * else: - */ - } - - /* "collisions.py":1495 - * return [] - * else: - * r2 = self.r**2 # <<<<<<<<<<<<<< - * a=(r2-othershape.r**2+d**2)/(2*d) - * h=math.sqrt(r2-a**2) - */ - /*else*/ { - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1495, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = PyNumber_Power(__pyx_t_7, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1495, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_v_r2 = __pyx_t_9; - __pyx_t_9 = 0; - - /* "collisions.py":1496 - * else: - * r2 = self.r**2 - * a=(r2-othershape.r**2+d**2)/(2*d) # <<<<<<<<<<<<<< - * h=math.sqrt(r2-a**2) - * x2=self.x+a*(othershape.x-self.x)/d - */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1496, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = PyNumber_Power(__pyx_t_9, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1496, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Subtract(__pyx_v_r2, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1496, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Power(__pyx_v_d, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1496, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = PyNumber_Add(__pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1496, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyInt_MultiplyCObj(__pyx_int_2, __pyx_v_d, 2, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1496, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1496, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_v_a = __pyx_t_9; - __pyx_t_9 = 0; - - /* "collisions.py":1497 - * r2 = self.r**2 - * a=(r2-othershape.r**2+d**2)/(2*d) - * h=math.sqrt(r2-a**2) # <<<<<<<<<<<<<< - * x2=self.x+a*(othershape.x-self.x)/d - * y2=self.y+a*(othershape.y-self.y)/d - */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_math); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1497, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1497, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Power(__pyx_v_a, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1497, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_r2, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1497, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_3}; - __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1497, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_v_h = __pyx_t_9; - __pyx_t_9 = 0; - - /* "collisions.py":1498 - * a=(r2-othershape.r**2+d**2)/(2*d) - * h=math.sqrt(r2-a**2) - * x2=self.x+a*(othershape.x-self.x)/d # <<<<<<<<<<<<<< - * y2=self.y+a*(othershape.y-self.y)/d - * x3=x2+h*(othershape.y-self.y)/d - */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1498, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1498, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1498, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1498, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Multiply(__pyx_v_a, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1498, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_d); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1498, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1498, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_v_x2 = __pyx_t_3; - __pyx_t_3 = 0; - - /* "collisions.py":1499 - * h=math.sqrt(r2-a**2) - * x2=self.x+a*(othershape.x-self.x)/d - * y2=self.y+a*(othershape.y-self.y)/d # <<<<<<<<<<<<<< - * x3=x2+h*(othershape.y-self.y)/d - * y3=y2-h*(othershape.x-self.x)/d - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Multiply(__pyx_v_a, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_9, __pyx_v_d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1499, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_y2 = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_t_7 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_7); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_3, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyInt_RemainderObjC(__pyx_t_1, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1566, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_phi = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":1500 - * x2=self.x+a*(othershape.x-self.x)/d - * y2=self.y+a*(othershape.y-self.y)/d - * x3=x2+h*(othershape.y-self.y)/d # <<<<<<<<<<<<<< - * y3=y2-h*(othershape.x-self.x)/d + /* "collisions.py":1567 + * # return othershape + * phi = (math.degrees(math.atan2(y, x)) - 90) % 360 + * angle = math.radians(phi) # <<<<<<<<<<<<<< * + * qx = self.x - math.sin(angle) * self.r */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1500, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1500, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1500, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Multiply(__pyx_v_h, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1500, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_v_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1500, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1567, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_radians); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1567, __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_UNPACK_METHODS + if (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; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_phi}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_v_x2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1500, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_x3 = __pyx_t_2; - __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_v_angle = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":1501 - * y2=self.y+a*(othershape.y-self.y)/d - * x3=x2+h*(othershape.y-self.y)/d - * y3=y2-h*(othershape.x-self.x)/d # <<<<<<<<<<<<<< + /* "collisions.py":1569 + * angle = math.radians(phi) * - * x4=x2-h*(othershape.y-self.y)/d + * qx = self.x - math.sin(angle) * self.r # <<<<<<<<<<<<<< + * qy = self.y + math.cos(angle) * self.r + * if returnAll: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Multiply(__pyx_v_h, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_d); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Subtract(__pyx_v_y2, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1501, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_v_y3 = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sin); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_angle}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = PyNumber_Multiply(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1569, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_qx = __pyx_t_7; + __pyx_t_7 = 0; - /* "collisions.py":1503 - * y3=y2-h*(othershape.x-self.x)/d - * - * x4=x2-h*(othershape.y-self.y)/d # <<<<<<<<<<<<<< - * y4=y2+h*(othershape.x-self.x)/d + /* "collisions.py":1570 * + * qx = self.x - math.sin(angle) * self.r + * qy = self.y + math.cos(angle) * self.r # <<<<<<<<<<<<<< + * if returnAll: + * return [[qx, qy]] */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Multiply(__pyx_v_h, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_9, __pyx_v_d); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Subtract(__pyx_v_x2, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1503, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_v_x4 = __pyx_t_9; - __pyx_t_9 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_cos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_angle}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = PyNumber_Add(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1570, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_qy = __pyx_t_4; + __pyx_t_4 = 0; - /* "collisions.py":1504 - * - * x4=x2-h*(othershape.y-self.y)/d - * y4=y2+h*(othershape.x-self.x)/d # <<<<<<<<<<<<<< - * - * return [[x3, y3], [x4, y4]] + /* "collisions.py":1571 + * qx = self.x - math.sin(angle) * self.r + * qy = self.y + math.cos(angle) * self.r + * if returnAll: # <<<<<<<<<<<<<< + * return [[qx, qy]] + * return qx, qy */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Multiply(__pyx_v_h, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_v_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_v_y2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1504, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_y4 = __pyx_t_2; - __pyx_t_2 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1571, __pyx_L1_error) + if (__pyx_t_6) { - /* "collisions.py":1506 - * y4=y2+h*(othershape.x-self.x)/d - * - * return [[x3, y3], [x4, y4]] # <<<<<<<<<<<<<< - * return othershape._where(self) - * + /* "collisions.py":1572 + * qy = self.y + math.cos(angle) * self.r + * if returnAll: + * return [[qx, qy]] # <<<<<<<<<<<<<< + * return qx, qy + * elif checkShpType(othershape, ShpTyps.Line): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1506, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_x3); - __Pyx_GIVEREF(__pyx_v_x3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_x3)) __PYX_ERR(0, 1506, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_y3); - __Pyx_GIVEREF(__pyx_v_y3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_v_y3)) __PYX_ERR(0, 1506, __pyx_L1_error); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1506, __pyx_L1_error) + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1572, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_INCREF(__pyx_v_qx); + __Pyx_GIVEREF(__pyx_v_qx); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_qx)) __PYX_ERR(0, 1572, __pyx_L1_error); + __Pyx_INCREF(__pyx_v_qy); + __Pyx_GIVEREF(__pyx_v_qy); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_v_qy)) __PYX_ERR(0, 1572, __pyx_L1_error); + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_x4); - __Pyx_GIVEREF(__pyx_v_x4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_x4)) __PYX_ERR(0, 1506, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_y4); - __Pyx_GIVEREF(__pyx_v_y4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_v_y4)) __PYX_ERR(0, 1506, __pyx_L1_error); - __pyx_t_9 = PyList_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1506, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_2)) __PYX_ERR(0, 1506, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_3)) __PYX_ERR(0, 1506, __pyx_L1_error); - __pyx_t_2 = 0; + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 1572, __pyx_L1_error); + __pyx_t_4 = 0; + __pyx_r = __pyx_t_3; __pyx_t_3 = 0; - __pyx_r = __pyx_t_9; - __pyx_t_9 = 0; goto __pyx_L0; + + /* "collisions.py":1571 + * qx = self.x - math.sin(angle) * self.r + * qy = self.y + math.cos(angle) * self.r + * if returnAll: # <<<<<<<<<<<<<< + * return [[qx, qy]] + * return qx, qy + */ } - /* "collisions.py":1477 - * xpt += [(xb + self.x, yb + self.y)] if 0 < tb < dr else [] - * return xpt - * if checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< - * if not self.check_rects(othershape): - * return [] + /* "collisions.py":1573 + * if returnAll: + * return [[qx, qy]] + * return qx, qy # <<<<<<<<<<<<<< + * elif checkShpType(othershape, ShpTyps.Line): + * if self._collides(othershape): + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1573, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_v_qx); + __Pyx_GIVEREF(__pyx_v_qx); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_qx)) __PYX_ERR(0, 1573, __pyx_L1_error); + __Pyx_INCREF(__pyx_v_qy); + __Pyx_GIVEREF(__pyx_v_qy); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_qy)) __PYX_ERR(0, 1573, __pyx_L1_error); + __pyx_r = __pyx_t_3; + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "collisions.py":1562 + * pointLike / Iterable[pointLike]: The closest point(s, depending on returnAll) ON this object TO the othershape + * """ + * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< + * x, y = othershape.x - self.x, othershape.y - self.y + * #if abs(x)**2 + abs(y)**2 < self.r**2: */ } - /* "collisions.py":1507 - * - * return [[x3, y3], [x4, y4]] - * return othershape._where(self) # <<<<<<<<<<<<<< - * - * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike,Iterable[pointLike]]: + /* "collisions.py":1574 + * return [[qx, qy]] + * return qx, qy + * elif checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< + * if self._collides(othershape): + * wheres = self._where(othershape) */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_where); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1507, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Line); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_2); + if (unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_self}; - __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1507, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_othershape, __pyx_t_1}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1574, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_r = __pyx_t_9; - __pyx_t_9 = 0; - goto __pyx_L0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1574, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { - /* "collisions.py":1438 - * return othershape._collides(self) - * - * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< - * if checkShpType(othershape, ShpTyps.Point): - * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] + /* "collisions.py":1575 + * return qx, qy + * elif checkShpType(othershape, ShpTyps.Line): + * if self._collides(othershape): # <<<<<<<<<<<<<< + * wheres = self._where(othershape) + * if wheres != []: */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(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; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_othershape}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1575, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1575, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_6) { - /* function exit code */ - __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_7); - __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("collisions.Circle._where", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_sign); - __Pyx_XDECREF(__pyx_v_x1); - __Pyx_XDECREF(__pyx_v_y1); - __Pyx_XDECREF(__pyx_v_x2); - __Pyx_XDECREF(__pyx_v_y2); - __Pyx_XDECREF(__pyx_v_dx); - __Pyx_XDECREF(__pyx_v_dy); - __Pyx_XDECREF(__pyx_v_dr); - __Pyx_XDECREF(__pyx_v_D); - __Pyx_XDECREF(__pyx_v_discriminant); - __Pyx_XDECREF(__pyx_v_xa); - __Pyx_XDECREF(__pyx_v_ya); - __Pyx_XDECREF(__pyx_v_ta); - __Pyx_XDECREF(__pyx_v_discRoot); - __Pyx_XDECREF(__pyx_v_xpt); - __Pyx_XDECREF(__pyx_v_xb); - __Pyx_XDECREF(__pyx_v_yb); - __Pyx_XDECREF(__pyx_v_tb); - __Pyx_XDECREF(__pyx_v_d); - __Pyx_XDECREF(__pyx_v_r2); - __Pyx_XDECREF(__pyx_v_a); - __Pyx_XDECREF(__pyx_v_h); - __Pyx_XDECREF(__pyx_v_x3); - __Pyx_XDECREF(__pyx_v_y3); - __Pyx_XDECREF(__pyx_v_x4); - __Pyx_XDECREF(__pyx_v_y4); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "collisions.py":1576 + * elif checkShpType(othershape, ShpTyps.Line): + * if self._collides(othershape): + * wheres = self._where(othershape) # <<<<<<<<<<<<<< + * if wheres != []: + * if returnAll: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_where); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1576, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(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; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_othershape}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1576, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_v_wheres = __pyx_t_3; + __pyx_t_3 = 0; -/* "collisions.py":1509 - * return othershape._where(self) - * - * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike,Iterable[pointLike]]: # <<<<<<<<<<<<<< - * """ - * Find the closest point ON this object TO another object. + /* "collisions.py":1577 + * if self._collides(othershape): + * wheres = self._where(othershape) + * if wheres != []: # <<<<<<<<<<<<<< + * if returnAll: + * return wheres */ + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1577, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = PyObject_RichCompare(__pyx_v_wheres, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1577, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1577, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_13closestPointTo(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_6Circle_12closestPointTo, "\n Find the closest point ON this object TO another object.\n\n Args:\n othershape (Shape): The other object to find the closest point to\n returnAll (bool, optional): Whether to return all the possible points in order of closeness or not. Defaults to False.\n\n Returns:\n pointLike / Iterable[pointLike]: The closest point(s, depending on returnAll) ON this object TO the othershape\n "); -static PyMethodDef __pyx_mdef_10collisions_6Circle_13closestPointTo = {"closestPointTo", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_13closestPointTo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Circle_12closestPointTo}; -static PyObject *__pyx_pw_10collisions_6Circle_13closestPointTo(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_othershape = 0; - PyObject *__pyx_v_returnAll = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[3] = {0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("closestPointTo (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_othershape,&__pyx_n_s_returnAll,0}; - values[2] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1509, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_othershape)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1509, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, 1); __PYX_ERR(0, 1509, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_returnAll); - if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1509, __pyx_L3_error) + /* "collisions.py":1578 + * wheres = self._where(othershape) + * if wheres != []: + * if returnAll: # <<<<<<<<<<<<<< + * return wheres + * return wheres[0] + */ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1578, __pyx_L1_error) + if (__pyx_t_6) { + + /* "collisions.py":1579 + * if wheres != []: + * if returnAll: + * return wheres # <<<<<<<<<<<<<< + * return wheres[0] + * sort = sorted([othershape.p1, othershape.p2], + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_wheres); + __pyx_r = __pyx_v_wheres; + goto __pyx_L0; + + /* "collisions.py":1578 + * wheres = self._where(othershape) + * if wheres != []: + * if returnAll: # <<<<<<<<<<<<<< + * return wheres + * return wheres[0] + */ } + + /* "collisions.py":1580 + * if returnAll: + * return wheres + * return wheres[0] # <<<<<<<<<<<<<< + * sort = sorted([othershape.p1, othershape.p2], + * key=lambda p: abs(self.r**2-((self.x-p[0])**2+(self.y-p[1])**2))) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_wheres, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; + + /* "collisions.py":1577 + * if self._collides(othershape): + * wheres = self._where(othershape) + * if wheres != []: # <<<<<<<<<<<<<< + * if returnAll: + * return wheres + */ } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "closestPointTo") < 0)) __PYX_ERR(0, 1509, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_self = values[0]; - __pyx_v_othershape = values[1]; - __pyx_v_returnAll = values[2]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1509, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("collisions.Circle.closestPointTo", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Circle_12closestPointTo(__pyx_self, __pyx_v_self, __pyx_v_othershape, __pyx_v_returnAll); - /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "collisions.py":1581 + * return wheres + * return wheres[0] + * sort = sorted([othershape.p1, othershape.p2], # <<<<<<<<<<<<<< + * key=lambda p: abs(self.r**2-((self.x-p[0])**2+(self.y-p[1])**2))) + * if returnAll: + */ + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1581, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1581, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1581, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_4); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_4)) __PYX_ERR(0, 1581, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 1581, __pyx_L1_error); + __pyx_t_4 = 0; + __pyx_t_3 = 0; + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1581, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 1581, __pyx_L1_error); + __pyx_t_1 = 0; -/* "collisions.py":1540 + /* "collisions.py":1582 * return wheres[0] * sort = sorted([othershape.p1, othershape.p2], * key=lambda p: abs(self.r**2-((self.x-p[0])**2+(self.y-p[1])**2))) # <<<<<<<<<<<<<< * if returnAll: * return sort */ + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_14closestPointTo_lambda14, 0, __pyx_n_s_Circle_closestPointTo_locals_lam, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1582, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_t_4) < 0) __PYX_ERR(0, 1582, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_14closestPointTo_lambda14(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_6Circle_14closestPointTo_lambda14 = {"lambda14", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_14closestPointTo_lambda14, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Circle_14closestPointTo_lambda14(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_p = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lambda14 (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_p,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1540, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda14") < 0)) __PYX_ERR(0, 1540, __pyx_L3_error) - } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - } - __pyx_v_p = values[0]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda14", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1540, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("collisions.Circle.closestPointTo.lambda14", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_lambda_funcdef_lambda14(__pyx_self, __pyx_v_p); + /* "collisions.py":1581 + * return wheres + * return wheres[0] + * sort = sorted([othershape.p1, othershape.p2], # <<<<<<<<<<<<<< + * key=lambda p: abs(self.r**2-((self.x-p[0])**2+(self.y-p[1])**2))) + * if returnAll: + */ + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1581, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_sort = __pyx_t_4; + __pyx_t_4 = 0; - /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "collisions.py":1583 + * sort = sorted([othershape.p1, othershape.p2], + * key=lambda p: abs(self.r**2-((self.x-p[0])**2+(self.y-p[1])**2))) + * if returnAll: # <<<<<<<<<<<<<< + * return sort + * return sort[0] + */ + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1583, __pyx_L1_error) + if (__pyx_t_6) { -static PyObject *__pyx_lambda_funcdef_lambda14(PyObject *__pyx_self, PyObject *__pyx_v_p) { - struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo *__pyx_cur_scope; - struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo *__pyx_outer_scope; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - PyObject *__pyx_t_5 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("lambda14", 1); - __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo *) __Pyx_CyFunction_GetClosure(__pyx_self); - __pyx_cur_scope = __pyx_outer_scope; - __Pyx_XDECREF(__pyx_r); - if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1540, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1540, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1540, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Power(__pyx_t_5, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyNumber_Absolute(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_5; - __pyx_t_5 = 0; - goto __pyx_L0; + /* "collisions.py":1584 + * key=lambda p: abs(self.r**2-((self.x-p[0])**2+(self.y-p[1])**2))) + * if returnAll: + * return sort # <<<<<<<<<<<<<< + * return sort[0] + * return self.closestPointTo(Point(*othershape.closestPointTo(Point(self.x, self.y))), returnAll) + */ + __Pyx_XDECREF(__pyx_r); + __Pyx_INCREF(__pyx_v_sort); + __pyx_r = __pyx_v_sort; + goto __pyx_L0; - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_XDECREF(__pyx_t_5); - __Pyx_AddTraceback("collisions.Circle.closestPointTo.lambda14", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + /* "collisions.py":1583 + * sort = sorted([othershape.p1, othershape.p2], + * key=lambda p: abs(self.r**2-((self.x-p[0])**2+(self.y-p[1])**2))) + * if returnAll: # <<<<<<<<<<<<<< + * return sort + * return sort[0] + */ + } -/* "collisions.py":1553 - * for ln in othershape.toLines(): - * ps.append(ln.closestPointTo(self)) - * ps.sort(key=lambda x: (x[0]-self.x)**2+(x[1]-self.y)**2) # <<<<<<<<<<<<<< - * if returnAll: - * return [self.closestPointTo(Point(*p)) for p in ps] + /* "collisions.py":1585 + * if returnAll: + * return sort + * return sort[0] # <<<<<<<<<<<<<< + * return self.closestPointTo(Point(*othershape.closestPointTo(Point(self.x, self.y))), returnAll) + * elif checkShpType(othershape, ShpTyps.Circle): */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_sort, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1585, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_14closestPointTo_1lambda15(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_6Circle_14closestPointTo_1lambda15 = {"lambda15", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_14closestPointTo_1lambda15, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Circle_14closestPointTo_1lambda15(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_x = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[1] = {0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("lambda15 (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,0}; - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_x)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1553, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; + /* "collisions.py":1575 + * return qx, qy + * elif checkShpType(othershape, ShpTyps.Line): + * if self._collides(othershape): # <<<<<<<<<<<<<< + * wheres = self._where(othershape) + * if wheres != []: + */ + } + + /* "collisions.py":1586 + * return sort + * return sort[0] + * return self.closestPointTo(Point(*othershape.closestPointTo(Point(self.x, self.y))), returnAll) # <<<<<<<<<<<<<< + * elif checkShpType(othershape, ShpTyps.Circle): + * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1586, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1586, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1586, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_Point); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1586, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1586, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1586, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_12 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + __pyx_t_5 = 1; } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda15") < 0)) __PYX_ERR(0, 1553, __pyx_L3_error) + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_10, __pyx_t_11}; + __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1586, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __pyx_t_9 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_5 = 1; } - } else if (unlikely(__pyx_nargs != 1)) { - goto __pyx_L5_argtuple_error; - } else { - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - __pyx_v_x = values[0]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda15", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1553, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_8}; + __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1586, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - } - __Pyx_AddTraceback("collisions.Circle.closestPointTo.lambda15", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_lambda_funcdef_lambda15(__pyx_self, __pyx_v_x); - - /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1586, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1586, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_5 = 1; + } } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyObject *__pyx_lambda_funcdef_lambda15(PyObject *__pyx_self, PyObject *__pyx_v_x) { - struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo *__pyx_cur_scope; - struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo *__pyx_outer_scope; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("lambda15", 1); - __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo *) __Pyx_CyFunction_GetClosure(__pyx_self); - __pyx_cur_scope = __pyx_outer_scope; - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1553, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1553, __pyx_L1_error) } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("collisions.Circle.closestPointTo.lambda15", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_7, __pyx_v_returnAll}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1586, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; -/* "collisions.py":1509 - * return othershape._where(self) - * - * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike,Iterable[pointLike]]: # <<<<<<<<<<<<<< - * """ - * Find the closest point ON this object TO another object. + /* "collisions.py":1574 + * return [[qx, qy]] + * return qx, qy + * elif checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< + * if self._collides(othershape): + * wheres = self._where(othershape) */ - -static PyObject *__pyx_pf_10collisions_6Circle_12closestPointTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape, PyObject *__pyx_v_returnAll) { - struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo *__pyx_cur_scope; - PyObject *__pyx_v_x = NULL; - PyObject *__pyx_v_y = NULL; - PyObject *__pyx_v_phi = NULL; - PyObject *__pyx_v_angle = NULL; - PyObject *__pyx_v_qx = NULL; - PyObject *__pyx_v_qy = NULL; - PyObject *__pyx_v_wheres = NULL; - PyObject *__pyx_v_sort = NULL; - PyObject *__pyx_v_ps = NULL; - PyObject *__pyx_v_ln = NULL; - PyObject *__pyx_9genexpr23__pyx_v_p = NULL; - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - unsigned int __pyx_t_5; - int __pyx_t_6; - PyObject *__pyx_t_7 = NULL; - PyObject *__pyx_t_8 = NULL; - PyObject *__pyx_t_9 = NULL; - PyObject *__pyx_t_10 = NULL; - PyObject *__pyx_t_11 = NULL; - PyObject *__pyx_t_12 = NULL; - Py_ssize_t __pyx_t_13; - PyObject *(*__pyx_t_14)(PyObject *); - int __pyx_t_15; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - __Pyx_RefNannySetupContext("closestPointTo", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo *)__pyx_tp_new_10collisions___pyx_scope_struct_11_closestPointTo(__pyx_ptype_10collisions___pyx_scope_struct_11_closestPointTo, __pyx_empty_tuple, NULL); - if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo *)Py_None); - __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1509, __pyx_L1_error) - } else { - __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - __pyx_cur_scope->__pyx_v_self = __pyx_v_self; - __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); - __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); - /* "collisions.py":1520 - * pointLike / Iterable[pointLike]: The closest point(s, depending on returnAll) ON this object TO the othershape - * """ - * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< - * x, y = othershape.x - self.x, othershape.y - self.y - * #if abs(x)**2 + abs(y)**2 < self.r**2: + /* "collisions.py":1587 + * return sort[0] + * return self.closestPointTo(Point(*othershape.closestPointTo(Point(self.x, self.y))), returnAll) + * elif checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< + * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) + * elif checkShpType(othershape, ShpTyps.Arc): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1520, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1587, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1587, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Circle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1520, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1520, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (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); + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); + __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_othershape, __pyx_t_4}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1520, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_othershape, __pyx_t_2}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1520, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_6) { - - /* "collisions.py":1521 - * """ - * if checkShpType(othershape, ShpTyps.Point): - * x, y = othershape.x - self.x, othershape.y - self.y # <<<<<<<<<<<<<< - * #if abs(x)**2 + abs(y)**2 < self.r**2: - * # return othershape - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1521, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1521, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1521, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1587, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1521, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1521, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1521, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_x = __pyx_t_4; - __pyx_t_4 = 0; - __pyx_v_y = __pyx_t_3; - __pyx_t_3 = 0; + } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1587, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { - /* "collisions.py":1524 - * #if abs(x)**2 + abs(y)**2 < self.r**2: - * # return othershape - * phi = (math.degrees(math.atan2(y, x)) - 90) % 360 # <<<<<<<<<<<<<< - * angle = math.radians(phi) - * + /* "collisions.py":1588 + * return self.closestPointTo(Point(*othershape.closestPointTo(Point(self.x, self.y))), returnAll) + * elif checkShpType(othershape, ShpTyps.Circle): + * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) # <<<<<<<<<<<<<< + * elif checkShpType(othershape, ShpTyps.Arc): + * return self.closestPointTo(Point(*othershape.closestPointTo(self)), returnAll) */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1524, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_degrees); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1524, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1524, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_atan2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1524, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1588, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1588, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_2)) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_9)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_5 = 1; @@ -50869,17 +53249,19 @@ static PyObject *__pyx_pf_10collisions_6Circle_12closestPointTo(CYTHON_UNUSED Py } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_y, __pyx_v_x}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1524, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_3, __pyx_t_8}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1588, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_t_7 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { + if (likely(PyMethod_Check(__pyx_t_1))) { __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_7)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); @@ -50891,1180 +53273,1604 @@ static PyObject *__pyx_pf_10collisions_6Circle_12closestPointTo(CYTHON_UNUSED Py } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_4}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_2, __pyx_v_returnAll}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1524, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1588, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_3, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1524, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_RemainderObjC(__pyx_t_1, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1524, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_phi = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; + goto __pyx_L0; - /* "collisions.py":1525 - * # return othershape - * phi = (math.degrees(math.atan2(y, x)) - 90) % 360 - * angle = math.radians(phi) # <<<<<<<<<<<<<< - * - * qx = self.x - math.sin(angle) * self.r + /* "collisions.py":1587 + * return sort[0] + * return self.closestPointTo(Point(*othershape.closestPointTo(Point(self.x, self.y))), returnAll) + * elif checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< + * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) + * elif checkShpType(othershape, ShpTyps.Arc): */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1525, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_radians); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1525, __pyx_L1_error) + } + + /* "collisions.py":1589 + * elif checkShpType(othershape, ShpTyps.Circle): + * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) + * elif checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< + * return self.closestPointTo(Point(*othershape.closestPointTo(self)), returnAll) + * else: + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Arc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1589, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_othershape, __pyx_t_7}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1589, __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_UNPACK_METHODS - if (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; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_phi}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1525, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_v_angle = __pyx_t_3; - __pyx_t_3 = 0; + } + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1589, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (__pyx_t_6) { - /* "collisions.py":1527 - * angle = math.radians(phi) - * - * qx = self.x - math.sin(angle) * self.r # <<<<<<<<<<<<<< - * qy = self.y + math.cos(angle) * self.r - * if returnAll: + /* "collisions.py":1590 + * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) + * elif checkShpType(othershape, ShpTyps.Arc): + * return self.closestPointTo(Point(*othershape.closestPointTo(self)), returnAll) # <<<<<<<<<<<<<< + * else: + * ps = [] */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1527, __pyx_L1_error) + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sin); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1527, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = NULL; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1590, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_3 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_1); + if (likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); + __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_angle}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_self}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1590, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1590, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1590, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1527, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_qx = __pyx_t_7; - __pyx_t_7 = 0; - - /* "collisions.py":1528 - * - * qx = self.x - math.sin(angle) * self.r - * qy = self.y + math.cos(angle) * self.r # <<<<<<<<<<<<<< - * if returnAll: - * return [[qx, qy]] - */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1528, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1528, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_cos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1528, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_3); + if (likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); + __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_angle}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1528, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1528, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1528, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1528, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_qy = __pyx_t_4; - __pyx_t_4 = 0; - - /* "collisions.py":1529 - * qx = self.x - math.sin(angle) * self.r - * qy = self.y + math.cos(angle) * self.r - * if returnAll: # <<<<<<<<<<<<<< - * return [[qx, qy]] - * return qx, qy - */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1529, __pyx_L1_error) - if (__pyx_t_6) { - - /* "collisions.py":1530 - * qy = self.y + math.cos(angle) * self.r - * if returnAll: - * return [[qx, qy]] # <<<<<<<<<<<<<< - * return qx, qy - * elif checkShpType(othershape, ShpTyps.Line): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1530, __pyx_L1_error) + PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_2, __pyx_v_returnAll}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_v_qx); - __Pyx_GIVEREF(__pyx_v_qx); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_qx)) __PYX_ERR(0, 1530, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_qy); - __Pyx_GIVEREF(__pyx_v_qy); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_v_qy)) __PYX_ERR(0, 1530, __pyx_L1_error); - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1530, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 1530, __pyx_L1_error); - __pyx_t_4 = 0; - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; - goto __pyx_L0; - - /* "collisions.py":1529 - * qx = self.x - math.sin(angle) * self.r - * qy = self.y + math.cos(angle) * self.r - * if returnAll: # <<<<<<<<<<<<<< - * return [[qx, qy]] - * return qx, qy - */ + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - - /* "collisions.py":1531 - * if returnAll: - * return [[qx, qy]] - * return qx, qy # <<<<<<<<<<<<<< - * elif checkShpType(othershape, ShpTyps.Line): - * if self._collides(othershape): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1531, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_INCREF(__pyx_v_qx); - __Pyx_GIVEREF(__pyx_v_qx); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_qx)) __PYX_ERR(0, 1531, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_qy); - __Pyx_GIVEREF(__pyx_v_qy); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_qy)) __PYX_ERR(0, 1531, __pyx_L1_error); - __pyx_r = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_r = __pyx_t_4; + __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":1520 - * pointLike / Iterable[pointLike]: The closest point(s, depending on returnAll) ON this object TO the othershape - * """ - * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< - * x, y = othershape.x - self.x, othershape.y - self.y - * #if abs(x)**2 + abs(y)**2 < self.r**2: + /* "collisions.py":1589 + * elif checkShpType(othershape, ShpTyps.Circle): + * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) + * elif checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< + * return self.closestPointTo(Point(*othershape.closestPointTo(self)), returnAll) + * else: */ } - /* "collisions.py":1532 - * return [[qx, qy]] - * return qx, qy - * elif checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< - * if self._collides(othershape): - * wheres = self._where(othershape) + /* "collisions.py":1592 + * return self.closestPointTo(Point(*othershape.closestPointTo(self)), returnAll) + * else: + * ps = [] # <<<<<<<<<<<<<< + * for ln in othershape.toLines(): + * ps.append(ln.closestPointTo(self)) */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1532, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1532, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Line); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1532, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_othershape, __pyx_t_1}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1532, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1532, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { + /*else*/ { + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1592, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_v_ps = ((PyObject*)__pyx_t_4); + __pyx_t_4 = 0; - /* "collisions.py":1533 - * return qx, qy - * elif checkShpType(othershape, ShpTyps.Line): - * if self._collides(othershape): # <<<<<<<<<<<<<< - * wheres = self._where(othershape) - * if wheres != []: + /* "collisions.py":1593 + * else: + * ps = [] + * for ln in othershape.toLines(): # <<<<<<<<<<<<<< + * ps.append(ln.closestPointTo(self)) + * ps.sort(key=lambda x: (x[0]-self.x)**2+(x[1]-self.y)**2) */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1533, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = NULL; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_toLines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (likely(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); + if (likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); + __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_5 = 1; } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_othershape}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1533, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1533, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { + __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); + __pyx_t_13 = 0; + __pyx_t_14 = NULL; + } else { + __pyx_t_13 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1593, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + for (;;) { + if (likely(!__pyx_t_14)) { + if (likely(PyList_CheckExact(__pyx_t_1))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1593, __pyx_L1_error) + #endif + if (__pyx_t_13 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_4); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 1593, __pyx_L1_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1593, __pyx_L1_error) + #endif + if (__pyx_t_13 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_4); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 1593, __pyx_L1_error) + #else + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + #endif + } + } else { + __pyx_t_4 = __pyx_t_14(__pyx_t_1); + if (unlikely(!__pyx_t_4)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 1593, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_4); + } + __Pyx_XDECREF_SET(__pyx_v_ln, __pyx_t_4); + __pyx_t_4 = 0; - /* "collisions.py":1534 - * elif checkShpType(othershape, ShpTyps.Line): - * if self._collides(othershape): - * wheres = self._where(othershape) # <<<<<<<<<<<<<< - * if wheres != []: - * if returnAll: + /* "collisions.py":1594 + * ps = [] + * for ln in othershape.toLines(): + * ps.append(ln.closestPointTo(self)) # <<<<<<<<<<<<<< + * ps.sort(key=lambda x: (x[0]-self.x)**2+(x[1]-self.y)**2) + * if returnAll: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_where); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1534, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = NULL; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = NULL; __pyx_t_5 = 0; #if CYTHON_UNPACK_METHODS - if (likely(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); + if (likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); + __Pyx_DECREF_SET(__pyx_t_2, function); __pyx_t_5 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_othershape}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1534, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_cur_scope->__pyx_v_self}; + __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1594, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_v_wheres = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_ps, __pyx_t_4); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 1594, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":1535 - * if self._collides(othershape): - * wheres = self._where(othershape) - * if wheres != []: # <<<<<<<<<<<<<< - * if returnAll: - * return wheres + /* "collisions.py":1593 + * else: + * ps = [] + * for ln in othershape.toLines(): # <<<<<<<<<<<<<< + * ps.append(ln.closestPointTo(self)) + * ps.sort(key=lambda x: (x[0]-self.x)**2+(x[1]-self.y)**2) */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1535, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_wheres, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1535, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1535, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { + } + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":1536 - * wheres = self._where(othershape) - * if wheres != []: - * if returnAll: # <<<<<<<<<<<<<< - * return wheres - * return wheres[0] + /* "collisions.py":1595 + * for ln in othershape.toLines(): + * ps.append(ln.closestPointTo(self)) + * ps.sort(key=lambda x: (x[0]-self.x)**2+(x[1]-self.y)**2) # <<<<<<<<<<<<<< + * if returnAll: + * return [self.closestPointTo(Point(*p)) for p in ps] */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1536, __pyx_L1_error) - if (__pyx_t_6) { + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ps, __pyx_n_s_sort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_14closestPointTo_1lambda15, 0, __pyx_n_s_Circle_closestPointTo_locals_lam, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_key, __pyx_t_2) < 0) __PYX_ERR(0, 1595, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":1537 - * if wheres != []: - * if returnAll: - * return wheres # <<<<<<<<<<<<<< - * return wheres[0] - * sort = sorted([othershape.p1, othershape.p2], + /* "collisions.py":1596 + * ps.append(ln.closestPointTo(self)) + * ps.sort(key=lambda x: (x[0]-self.x)**2+(x[1]-self.y)**2) + * if returnAll: # <<<<<<<<<<<<<< + * return [self.closestPointTo(Point(*p)) for p in ps] + * return self.closestPointTo(Point(*ps[0])) */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_wheres); - __pyx_r = __pyx_v_wheres; - goto __pyx_L0; + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1596, __pyx_L1_error) + if (__pyx_t_6) { - /* "collisions.py":1536 - * wheres = self._where(othershape) - * if wheres != []: - * if returnAll: # <<<<<<<<<<<<<< - * return wheres - * return wheres[0] + /* "collisions.py":1597 + * ps.sort(key=lambda x: (x[0]-self.x)**2+(x[1]-self.y)**2) + * if returnAll: + * return [self.closestPointTo(Point(*p)) for p in ps] # <<<<<<<<<<<<<< + * return self.closestPointTo(Point(*ps[0])) + * */ + __Pyx_XDECREF(__pyx_r); + { /* enter inner scope */ + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1597, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = __pyx_v_ps; __Pyx_INCREF(__pyx_t_4); + __pyx_t_13 = 0; + for (;;) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1597, __pyx_L15_error) + #endif + if (__pyx_t_13 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 1597, __pyx_L15_error) + #else + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1597, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_1); + #endif + __Pyx_XDECREF_SET(__pyx_9genexpr23__pyx_v_p, __pyx_t_1); + __pyx_t_1 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1597, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1597, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_9genexpr23__pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1597, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1597, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_5 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_9}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1597, __pyx_L15_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 1597, __pyx_L15_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_p); __pyx_9genexpr23__pyx_v_p = 0; + goto __pyx_L19_exit_scope; + __pyx_L15_error:; + __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_p); __pyx_9genexpr23__pyx_v_p = 0; + goto __pyx_L1_error; + __pyx_L19_exit_scope:; + } /* exit inner scope */ + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; - /* "collisions.py":1538 - * if returnAll: - * return wheres - * return wheres[0] # <<<<<<<<<<<<<< - * sort = sorted([othershape.p1, othershape.p2], - * key=lambda p: abs(self.r**2-((self.x-p[0])**2+(self.y-p[1])**2))) + /* "collisions.py":1596 + * ps.append(ln.closestPointTo(self)) + * ps.sort(key=lambda x: (x[0]-self.x)**2+(x[1]-self.y)**2) + * if returnAll: # <<<<<<<<<<<<<< + * return [self.closestPointTo(Point(*p)) for p in ps] + * return self.closestPointTo(Point(*ps[0])) */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_wheres, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1538, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; + } - /* "collisions.py":1535 - * if self._collides(othershape): - * wheres = self._where(othershape) - * if wheres != []: # <<<<<<<<<<<<<< - * if returnAll: - * return wheres + /* "collisions.py":1598 + * if returnAll: + * return [self.closestPointTo(Point(*p)) for p in ps] + * return self.closestPointTo(Point(*ps[0])) # <<<<<<<<<<<<<< + * + * def handleCollisionsPos(self, */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Point); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_ps, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __Pyx_PySequence_Tuple(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = NULL; + __pyx_t_5 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_4, function); + __pyx_t_5 = 1; } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_8}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1598, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + } - /* "collisions.py":1539 - * return wheres - * return wheres[0] - * sort = sorted([othershape.p1, othershape.p2], # <<<<<<<<<<<<<< - * key=lambda p: abs(self.r**2-((self.x-p[0])**2+(self.y-p[1])**2))) - * if returnAll: + /* "collisions.py":1551 + * return othershape._where(self) + * + * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike,Iterable[pointLike]]: # <<<<<<<<<<<<<< + * """ + * Find the closest point ON this object TO another object. */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1539, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1539, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1539, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_4)) __PYX_ERR(0, 1539, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 1539, __pyx_L1_error); - __pyx_t_4 = 0; - __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1539, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 1539, __pyx_L1_error); - __pyx_t_1 = 0; - /* "collisions.py":1540 - * return wheres[0] - * sort = sorted([othershape.p1, othershape.p2], - * key=lambda p: abs(self.r**2-((self.x-p[0])**2+(self.y-p[1])**2))) # <<<<<<<<<<<<<< - * if returnAll: - * return sort - */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_14closestPointTo_lambda14, 0, __pyx_n_s_Circle_closestPointTo_locals_lam, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1540, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_t_4) < 0) __PYX_ERR(0, 1540, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + /* function exit code */ + __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_7); + __Pyx_XDECREF(__pyx_t_8); + __Pyx_XDECREF(__pyx_t_9); + __Pyx_XDECREF(__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); + __Pyx_XDECREF(__pyx_t_12); + __Pyx_AddTraceback("collisions.Circle.closestPointTo", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_x); + __Pyx_XDECREF(__pyx_v_y); + __Pyx_XDECREF(__pyx_v_phi); + __Pyx_XDECREF(__pyx_v_angle); + __Pyx_XDECREF(__pyx_v_qx); + __Pyx_XDECREF(__pyx_v_qy); + __Pyx_XDECREF(__pyx_v_wheres); + __Pyx_XDECREF(__pyx_v_sort); + __Pyx_XDECREF(__pyx_v_ps); + __Pyx_XDECREF(__pyx_v_ln); + __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_p); + __Pyx_DECREF((PyObject *)__pyx_cur_scope); + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "collisions.py":1539 - * return wheres - * return wheres[0] - * sort = sorted([othershape.p1, othershape.p2], # <<<<<<<<<<<<<< - * key=lambda p: abs(self.r**2-((self.x-p[0])**2+(self.y-p[1])**2))) - * if returnAll: +/* "collisions.py":1600 + * return self.closestPointTo(Point(*ps[0])) + * + * def handleCollisionsPos(self, # <<<<<<<<<<<<<< + * oldCir: 'Circle', + * newCir: 'Circle', */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1539, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_sort = __pyx_t_4; - __pyx_t_4 = 0; - /* "collisions.py":1541 - * sort = sorted([othershape.p1, othershape.p2], - * key=lambda p: abs(self.r**2-((self.x-p[0])**2+(self.y-p[1])**2))) - * if returnAll: # <<<<<<<<<<<<<< - * return sort - * return sort[0] - */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1541, __pyx_L1_error) - if (__pyx_t_6) { +static PyObject *__pyx_pf_10collisions_46__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { + PyObject *__pyx_r = NULL; + __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("__defaults__", 1); + __Pyx_XDECREF(__pyx_r); - /* "collisions.py":1542 - * key=lambda p: abs(self.r**2-((self.x-p[0])**2+(self.y-p[1])**2))) - * if returnAll: - * return sort # <<<<<<<<<<<<<< - * return sort[0] - * return self.closestPointTo(Point(*othershape.closestPointTo(Point(self.x, self.y))), returnAll) + /* "collisions.py":1609 + * replaceSelf: bool = True, + * precision: Number = BASEPRECISION, + * verbose: bool = False # <<<<<<<<<<<<<< + * ) -> tuple[pointLike, pointLike, verboseOutput]: + * """ */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(__pyx_v_sort); - __pyx_r = __pyx_v_sort; - goto __pyx_L0; + __pyx_t_1 = PyTuple_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_self)->__pyx_arg_vel); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_self)->__pyx_arg_vel); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_self)->__pyx_arg_vel)) __PYX_ERR(0, 1600, __pyx_L1_error); + __Pyx_INCREF(((PyObject *)Py_True)); + __Pyx_GIVEREF(((PyObject *)Py_True)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_True))) __PYX_ERR(0, 1600, __pyx_L1_error); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_self)->__pyx_arg_maxTries); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_self)->__pyx_arg_maxTries); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_self)->__pyx_arg_maxTries)) __PYX_ERR(0, 1600, __pyx_L1_error); + __Pyx_INCREF(((PyObject *)Py_True)); + __Pyx_GIVEREF(((PyObject *)Py_True)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)Py_True))) __PYX_ERR(0, 1600, __pyx_L1_error); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_self)->__pyx_arg_precision); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_self)->__pyx_arg_precision); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 4, __Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 1600, __pyx_L1_error); + __Pyx_INCREF(((PyObject *)Py_False)); + __Pyx_GIVEREF(((PyObject *)Py_False)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 5, ((PyObject *)Py_False))) __PYX_ERR(0, 1600, __pyx_L1_error); - /* "collisions.py":1541 - * sort = sorted([othershape.p1, othershape.p2], - * key=lambda p: abs(self.r**2-((self.x-p[0])**2+(self.y-p[1])**2))) - * if returnAll: # <<<<<<<<<<<<<< - * return sort - * return sort[0] + /* "collisions.py":1600 + * return self.closestPointTo(Point(*ps[0])) + * + * def handleCollisionsPos(self, # <<<<<<<<<<<<<< + * oldCir: 'Circle', + * newCir: 'Circle', */ + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1600, __pyx_L1_error); + __Pyx_INCREF(Py_None); + __Pyx_GIVEREF(Py_None); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 1600, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; + goto __pyx_L0; + + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_1); + __Pyx_XDECREF(__pyx_t_2); + __Pyx_AddTraceback("collisions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; + __Pyx_XGIVEREF(__pyx_r); + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_6Circle_19handleCollisionsPos(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +PyDoc_STRVAR(__pyx_doc_10collisions_6Circle_18handleCollisionsPos, "\n Handles movement of this Circle and it bouncing off of other objects.\n It is recommended you use `.handleCollisionsVel` instead of this, as it handles velocity instead of raw movement and is easier to use.\n\n But if you are to use this, remember to still provide the vel param. It will sometimes provide weird results if you don't.\n It could even just be the difference in positions, it just needs to be something realistic.\n\n Args:\n oldCir (Circle): The old position of this object.\n newCir (Circle): The new position of this object.\n objs (Shapes / Iterable[Shape]): The objects this will bounce off.\n vel (pointLike, optional): The velocity that this object is going. Defaults to [0, 0].\n unstuckable (bool, optional): Whether being in an object but having enough speed to get out allows you to get out or not. Defaults to True. This makes it so if you occasionally get stuck in a wall, you can get out and not be stuck forever. But it also means that if you move too fast or have too thin a wall, you will be able to clip through it. //FIXME: Make you not need this. When circles rest in a v shape, they get stuck.\n maxTries (int, optional): The maximum amount of tries it will do to get the circle to stop colliding when it hits something. Defaults to 50.\n replaceSelf (bool, optional): Whether to replace self.x and self.y with the new position of the object after bouncing or not. Defaults to True.\n precision (Number, optional): The decimal places to round to to check (for things like corner checking). Defaults to 5.\n verbose (bool, optional): Whether to give verbose output or not. Defaults to False.\n\n Returns:\n tuple[pointLike, pointLike, veboseOutput?]: The new position and vel of this object respectively, and if verbose then the verboseOutput.\n \n VerboseOutput:""\n DidReflect (bool): Whether the line reflected off of something\n "); +static PyMethodDef __pyx_mdef_10collisions_6Circle_19handleCollisionsPos = {"handleCollisionsPos", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_19handleCollisionsPos, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Circle_18handleCollisionsPos}; +static PyObject *__pyx_pw_10collisions_6Circle_19handleCollisionsPos(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_self = 0; + PyObject *__pyx_v_oldCir = 0; + PyObject *__pyx_v_newCir = 0; + PyObject *__pyx_v_objs = 0; + PyObject *__pyx_v_vel = 0; + PyObject *__pyx_v_unstuckable = 0; + PyObject *__pyx_v_maxTries = 0; + PyObject *__pyx_v_replaceSelf = 0; + PyObject *__pyx_v_precision = 0; + PyObject *__pyx_v_verbose = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("handleCollisionsPos (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_oldCir,&__pyx_n_s_newCir,&__pyx_n_s_objs,&__pyx_n_s_vel,&__pyx_n_s_unstuckable,&__pyx_n_s_maxTries,&__pyx_n_s_replaceSelf,&__pyx_n_s_precision,&__pyx_n_s_verbose,0}; + __pyx_defaults14 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_self); + values[4] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_vel); + values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); + values[6] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_maxTries); + values[7] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); + values[8] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_precision); + values[9] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + CYTHON_FALLTHROUGH; + case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + CYTHON_FALLTHROUGH; + case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + CYTHON_FALLTHROUGH; + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1600, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; + CYTHON_FALLTHROUGH; + case 1: + if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_oldCir)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1600, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 10, 1); __PYX_ERR(0, 1600, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 2: + if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_newCir)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1600, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 10, 2); __PYX_ERR(0, 1600, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 3: + if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_objs)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1600, __pyx_L3_error) + else { + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 10, 3); __PYX_ERR(0, 1600, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 4: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vel); + if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1600, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 5: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unstuckable); + if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1600, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_maxTries); + if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1600, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_replaceSelf); + if (value) { values[7] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1600, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 8: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_precision); + if (value) { values[8] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1600, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 9: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_verbose); + if (value) { values[9] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1600, __pyx_L3_error) + } } + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "handleCollisionsPos") < 0)) __PYX_ERR(0, 1600, __pyx_L3_error) + } + } else { + switch (__pyx_nargs) { + case 10: values[9] = __Pyx_Arg_FASTCALL(__pyx_args, 9); + CYTHON_FALLTHROUGH; + case 9: values[8] = __Pyx_Arg_FASTCALL(__pyx_args, 8); + CYTHON_FALLTHROUGH; + case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + CYTHON_FALLTHROUGH; + case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); + CYTHON_FALLTHROUGH; + case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); + CYTHON_FALLTHROUGH; + case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); + values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); + values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + break; + default: goto __pyx_L5_argtuple_error; + } + } + __pyx_v_self = values[0]; + __pyx_v_oldCir = values[1]; + __pyx_v_newCir = values[2]; + __pyx_v_objs = values[3]; + __pyx_v_vel = values[4]; + __pyx_v_unstuckable = values[5]; + __pyx_v_maxTries = ((PyObject*)values[6]); + __pyx_v_replaceSelf = values[7]; + __pyx_v_precision = values[8]; + __pyx_v_verbose = values[9]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 10, __pyx_nargs); __PYX_ERR(0, 1600, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } + } + __Pyx_AddTraceback("collisions.Circle.handleCollisionsPos", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_maxTries), (&PyInt_Type), 0, "maxTries", 1))) __PYX_ERR(0, 1606, __pyx_L1_error) + __pyx_r = __pyx_pf_10collisions_6Circle_18handleCollisionsPos(__pyx_self, __pyx_v_self, __pyx_v_oldCir, __pyx_v_newCir, __pyx_v_objs, __pyx_v_vel, __pyx_v_unstuckable, __pyx_v_maxTries, __pyx_v_replaceSelf, __pyx_v_precision, __pyx_v_verbose); - /* "collisions.py":1543 - * if returnAll: - * return sort - * return sort[0] # <<<<<<<<<<<<<< - * return self.closestPointTo(Point(*othershape.closestPointTo(Point(self.x, self.y))), returnAll) - * elif checkShpType(othershape, ShpTyps.Circle): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_sort, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1543, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "collisions.py":1533 - * return qx, qy - * elif checkShpType(othershape, ShpTyps.Line): - * if self._collides(othershape): # <<<<<<<<<<<<<< - * wheres = self._where(othershape) - * if wheres != []: - */ + /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } + } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "collisions.py":1544 - * return sort - * return sort[0] - * return self.closestPointTo(Point(*othershape.closestPointTo(Point(self.x, self.y))), returnAll) # <<<<<<<<<<<<<< - * elif checkShpType(othershape, ShpTyps.Circle): - * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) +/* "collisions.py":1681 + * else: + * closestObj = points[0][1] + * def calculate(point): # <<<<<<<<<<<<<< + * cpoMvemnt = Line((oldCir.x + oldCir.r * math.cos(velphi-math.pi), oldCir.y + oldCir.r * math.sin(velphi-math.pi)), + * (newCir.x + newCir.r * math.cos(velphi), newCir.y + newCir.r * math.sin(velphi)) */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1544, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1544, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1544, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_Point); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1544, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1544, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1544, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_12); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - __pyx_t_5 = 1; + +/* Python wrapper */ +static PyObject *__pyx_pw_10collisions_6Circle_19handleCollisionsPos_1calculate(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +); /*proto*/ +static PyMethodDef __pyx_mdef_10collisions_6Circle_19handleCollisionsPos_1calculate = {"calculate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_19handleCollisionsPos_1calculate, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_6Circle_19handleCollisionsPos_1calculate(PyObject *__pyx_self, +#if CYTHON_METH_FASTCALL +PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds +#else +PyObject *__pyx_args, PyObject *__pyx_kwds +#endif +) { + PyObject *__pyx_v_point = 0; + #if !CYTHON_METH_FASTCALL + CYTHON_UNUSED Py_ssize_t __pyx_nargs; + #endif + CYTHON_UNUSED PyObject *const *__pyx_kwvalues; + PyObject* values[1] = {0}; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("calculate (wrapper)", 0); + #if !CYTHON_METH_FASTCALL + #if CYTHON_ASSUME_SAFE_MACROS + __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); + #else + __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; + #endif + #endif + __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); + { + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,0}; + if (__pyx_kwds) { + Py_ssize_t kw_args; + switch (__pyx_nargs) { + case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); + CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_10, __pyx_t_11}; - __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1544, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __pyx_t_9 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_5 = 1; + kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); + switch (__pyx_nargs) { + case 0: + if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_point)) != 0)) { + (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); + kw_args--; + } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1681, __pyx_L3_error) + else goto __pyx_L5_argtuple_error; } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_8}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1544, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1544, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1544, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_5 = 1; + if (unlikely(kw_args > 0)) { + const Py_ssize_t kwd_pos_args = __pyx_nargs; + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "calculate") < 0)) __PYX_ERR(0, 1681, __pyx_L3_error) } + } else if (unlikely(__pyx_nargs != 1)) { + goto __pyx_L5_argtuple_error; + } else { + values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_7, __pyx_v_returnAll}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1544, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_point = values[0]; + } + goto __pyx_L6_skip; + __pyx_L5_argtuple_error:; + __Pyx_RaiseArgtupleInvalid("calculate", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1681, __pyx_L3_error) + __pyx_L6_skip:; + goto __pyx_L4_argument_unpacking_done; + __pyx_L3_error:; + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; + } + __Pyx_AddTraceback("collisions.Circle.handleCollisionsPos.calculate", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return NULL; + __pyx_L4_argument_unpacking_done:; + __pyx_r = __pyx_pf_10collisions_6Circle_19handleCollisionsPos_calculate(__pyx_self, __pyx_v_point); - /* "collisions.py":1532 - * return [[qx, qy]] - * return qx, qy - * elif checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< - * if self._collides(othershape): - * wheres = self._where(othershape) - */ + /* function exit code */ + { + Py_ssize_t __pyx_temp; + for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { + __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); + } } + __Pyx_RefNannyFinishContext(); + return __pyx_r; +} - /* "collisions.py":1545 - * return sort[0] - * return self.closestPointTo(Point(*othershape.closestPointTo(Point(self.x, self.y))), returnAll) - * elif checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< - * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, ShpTyps.Arc): +static PyObject *__pyx_pf_10collisions_6Circle_19handleCollisionsPos_calculate(PyObject *__pyx_self, PyObject *__pyx_v_point) { + struct __pyx_obj_10collisions___pyx_scope_struct_13_handleCollisionsPos *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_13_handleCollisionsPos *__pyx_outer_scope; + PyObject *__pyx_v_cpoMvemnt = NULL; + PyObject *__pyx_v_dist_to = NULL; + PyObject *__pyx_v_dist_left = NULL; + PyObject *__pyx_v_ThisClosestP = NULL; + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; + PyObject *__pyx_t_9 = NULL; + unsigned int __pyx_t_10; + PyObject *__pyx_t_11 = NULL; + int __pyx_lineno = 0; + const char *__pyx_filename = NULL; + int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("calculate", 1); + __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_13_handleCollisionsPos *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_cur_scope = __pyx_outer_scope; + + /* "collisions.py":1682 + * closestObj = points[0][1] + * def calculate(point): + * cpoMvemnt = Line((oldCir.x + oldCir.r * math.cos(velphi-math.pi), oldCir.y + oldCir.r * math.sin(velphi-math.pi)), # <<<<<<<<<<<<<< + * (newCir.x + newCir.r * math.cos(velphi), newCir.y + newCir.r * math.sin(velphi)) + * ).closestPointTo(Point(*point)) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1545, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1545, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (unlikely(!__pyx_cur_scope->__pyx_v_oldCir)) { __Pyx_RaiseClosureNameError("oldCir"); __PYX_ERR(0, 1682, __pyx_L1_error) } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + if (unlikely(!__pyx_cur_scope->__pyx_v_oldCir)) { __Pyx_RaiseClosureNameError("oldCir"); __PYX_ERR(0, 1682, __pyx_L1_error) } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_r); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_math); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1682, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Circle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1545, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_cos); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = NULL; - __pyx_t_5 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_velphi)) { __Pyx_RaiseClosureNameError("velphi"); __PYX_ERR(0, 1682, __pyx_L1_error) } + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_math); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_pi); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_velphi, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = NULL; + __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_7); + if (unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_5 = 1; + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_10 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_v_othershape, __pyx_t_2}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1545, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_7}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1545, __pyx_L1_error) + __pyx_t_8 = PyNumber_Multiply(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_oldCir)) { __Pyx_RaiseClosureNameError("oldCir"); __PYX_ERR(0, 1682, __pyx_L1_error) } + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (unlikely(!__pyx_cur_scope->__pyx_v_oldCir)) { __Pyx_RaiseClosureNameError("oldCir"); __PYX_ERR(0, 1682, __pyx_L1_error) } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_math); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_sin); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_velphi)) { __Pyx_RaiseClosureNameError("velphi"); __PYX_ERR(0, 1682, __pyx_L1_error) } + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_math); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_pi); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_velphi, __pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = NULL; + __pyx_t_10 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + __pyx_t_10 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_7}; + __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __pyx_t_9 = PyNumber_Multiply(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = PyNumber_Add(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6)) __PYX_ERR(0, 1682, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_5); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_5)) __PYX_ERR(0, 1682, __pyx_L1_error); + __pyx_t_6 = 0; + __pyx_t_5 = 0; - /* "collisions.py":1546 - * return self.closestPointTo(Point(*othershape.closestPointTo(Point(self.x, self.y))), returnAll) - * elif checkShpType(othershape, ShpTyps.Circle): - * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) # <<<<<<<<<<<<<< - * elif checkShpType(othershape, ShpTyps.Arc): - * return self.closestPointTo(Point(*othershape.closestPointTo(self)), returnAll) + /* "collisions.py":1683 + * def calculate(point): + * cpoMvemnt = Line((oldCir.x + oldCir.r * math.cos(velphi-math.pi), oldCir.y + oldCir.r * math.sin(velphi-math.pi)), + * (newCir.x + newCir.r * math.cos(velphi), newCir.y + newCir.r * math.sin(velphi)) # <<<<<<<<<<<<<< + * ).closestPointTo(Point(*point)) + * dist_to = math.hypot(oldCir[0]-cpoMvemnt[0], oldCir[1]-cpoMvemnt[1]) - ( */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1546, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1546, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1546, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1546, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_3, __pyx_t_8}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1546, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - } - __pyx_t_7 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_5 = 1; - } + if (unlikely(!__pyx_cur_scope->__pyx_v_newCir)) { __Pyx_RaiseClosureNameError("newCir"); __PYX_ERR(0, 1683, __pyx_L1_error) } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_newCir, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + if (unlikely(!__pyx_cur_scope->__pyx_v_newCir)) { __Pyx_RaiseClosureNameError("newCir"); __PYX_ERR(0, 1683, __pyx_L1_error) } + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_newCir, __pyx_n_s_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_cos); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_velphi)) { __Pyx_RaiseClosureNameError("velphi"); __PYX_ERR(0, 1683, __pyx_L1_error) } + __pyx_t_4 = NULL; + __pyx_t_10 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_7, function); + __pyx_t_10 = 1; } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_2, __pyx_v_returnAll}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1546, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_velphi}; + __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + } + __pyx_t_7 = PyNumber_Multiply(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = PyNumber_Add(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_newCir)) { __Pyx_RaiseClosureNameError("newCir"); __PYX_ERR(0, 1683, __pyx_L1_error) } + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_newCir, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (unlikely(!__pyx_cur_scope->__pyx_v_newCir)) { __Pyx_RaiseClosureNameError("newCir"); __PYX_ERR(0, 1683, __pyx_L1_error) } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_newCir, __pyx_n_s_r); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sin); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_velphi)) { __Pyx_RaiseClosureNameError("velphi"); __PYX_ERR(0, 1683, __pyx_L1_error) } + __pyx_t_4 = NULL; + __pyx_t_10 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_11))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_11); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_11, function); + __pyx_t_10 = 1; } - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; - - /* "collisions.py":1545 - * return sort[0] - * return self.closestPointTo(Point(*othershape.closestPointTo(Point(self.x, self.y))), returnAll) - * elif checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< - * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, ShpTyps.Arc): - */ + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_velphi}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + } + __pyx_t_11 = PyNumber_Multiply(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_6 = PyNumber_Add(__pyx_t_7, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1683, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_GIVEREF(__pyx_t_8); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8)) __PYX_ERR(0, 1683, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_6); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_6)) __PYX_ERR(0, 1683, __pyx_L1_error); + __pyx_t_8 = 0; + __pyx_t_6 = 0; + __pyx_t_6 = NULL; + __pyx_t_10 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_6); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_10 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_9, __pyx_t_11}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1682, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - /* "collisions.py":1547 - * elif checkShpType(othershape, ShpTyps.Circle): - * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< - * return self.closestPointTo(Point(*othershape.closestPointTo(self)), returnAll) - * else: + /* "collisions.py":1684 + * cpoMvemnt = Line((oldCir.x + oldCir.r * math.cos(velphi-math.pi), oldCir.y + oldCir.r * math.sin(velphi-math.pi)), + * (newCir.x + newCir.r * math.cos(velphi), newCir.y + newCir.r * math.sin(velphi)) + * ).closestPointTo(Point(*point)) # <<<<<<<<<<<<<< + * dist_to = math.hypot(oldCir[0]-cpoMvemnt[0], oldCir[1]-cpoMvemnt[1]) - ( + * math.sqrt( */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1547, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Point); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1684, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Arc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_PySequence_Tuple(__pyx_v_point); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = NULL; + __pyx_t_10 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_2); + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_11); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_5 = 1; + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_10 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_othershape, __pyx_t_7}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1547, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_9}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1547, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { + __pyx_v_cpoMvemnt = __pyx_t_1; + __pyx_t_1 = 0; - /* "collisions.py":1548 - * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, ShpTyps.Arc): - * return self.closestPointTo(Point(*othershape.closestPointTo(self)), returnAll) # <<<<<<<<<<<<<< - * else: - * ps = [] + /* "collisions.py":1685 + * (newCir.x + newCir.r * math.cos(velphi), newCir.y + newCir.r * math.sin(velphi)) + * ).closestPointTo(Point(*point)) + * dist_to = math.hypot(oldCir[0]-cpoMvemnt[0], oldCir[1]-cpoMvemnt[1]) - ( # <<<<<<<<<<<<<< + * math.sqrt( + * newCir.r**2 - \ */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1548, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1548, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1548, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_self}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1548, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_hypot); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_oldCir)) { __Pyx_RaiseClosureNameError("oldCir"); __PYX_ERR(0, 1685, __pyx_L1_error) } + __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_oldCir, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_cpoMvemnt, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_oldCir)) { __Pyx_RaiseClosureNameError("oldCir"); __PYX_ERR(0, 1685, __pyx_L1_error) } + __pyx_t_11 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_oldCir, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_cpoMvemnt, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_6 = PyNumber_Subtract(__pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + __pyx_t_10 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + __pyx_t_10 = 1; } - __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1548, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_2, __pyx_t_6}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1548, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_2, __pyx_v_returnAll}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1548, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __pyx_r = __pyx_t_4; - __pyx_t_4 = 0; - goto __pyx_L0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } - /* "collisions.py":1547 - * elif checkShpType(othershape, ShpTyps.Circle): - * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) - * elif checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< - * return self.closestPointTo(Point(*othershape.closestPointTo(self)), returnAll) - * else: + /* "collisions.py":1686 + * ).closestPointTo(Point(*point)) + * dist_to = math.hypot(oldCir[0]-cpoMvemnt[0], oldCir[1]-cpoMvemnt[1]) - ( + * math.sqrt( # <<<<<<<<<<<<<< + * newCir.r**2 - \ + * math.hypot(cpoMvemnt[0]-point[0], cpoMvemnt[1]-point[1])**2 */ - } + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_math); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1686, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1686, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "collisions.py":1550 - * return self.closestPointTo(Point(*othershape.closestPointTo(self)), returnAll) - * else: - * ps = [] # <<<<<<<<<<<<<< - * for ln in othershape.toLines(): - * ps.append(ln.closestPointTo(self)) + /* "collisions.py":1687 + * dist_to = math.hypot(oldCir[0]-cpoMvemnt[0], oldCir[1]-cpoMvemnt[1]) - ( + * math.sqrt( + * newCir.r**2 - \ # <<<<<<<<<<<<<< + * math.hypot(cpoMvemnt[0]-point[0], cpoMvemnt[1]-point[1])**2 + * ) */ - /*else*/ { - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1550, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_v_ps = ((PyObject*)__pyx_t_4); - __pyx_t_4 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_newCir)) { __Pyx_RaiseClosureNameError("newCir"); __PYX_ERR(0, 1687, __pyx_L1_error) } + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_newCir, __pyx_n_s_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_3 = PyNumber_Power(__pyx_t_6, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "collisions.py":1551 - * else: - * ps = [] - * for ln in othershape.toLines(): # <<<<<<<<<<<<<< - * ps.append(ln.closestPointTo(self)) - * ps.sort(key=lambda x: (x[0]-self.x)**2+(x[1]-self.y)**2) + /* "collisions.py":1688 + * math.sqrt( + * newCir.r**2 - \ + * math.hypot(cpoMvemnt[0]-point[0], cpoMvemnt[1]-point[1])**2 # <<<<<<<<<<<<<< + * ) + * ) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_toLines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) { - __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); - __pyx_t_13 = 0; - __pyx_t_14 = NULL; - } else { - __pyx_t_13 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1551, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_math); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1688, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_hypot); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1688, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_cpoMvemnt, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1688, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1688, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = PyNumber_Subtract(__pyx_t_11, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1688, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_cpoMvemnt, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1688, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_point, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1688, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_4 = PyNumber_Subtract(__pyx_t_7, __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1688, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = NULL; + __pyx_t_10 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_11)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_11); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_10 = 1; } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_5, __pyx_t_4}; + __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - for (;;) { - if (likely(!__pyx_t_14)) { - if (likely(PyList_CheckExact(__pyx_t_1))) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1551, __pyx_L1_error) - #endif - if (__pyx_t_13 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_4); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 1551, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - { - Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1551, __pyx_L1_error) - #endif - if (__pyx_t_13 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_13); __Pyx_INCREF(__pyx_t_4); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 1551, __pyx_L1_error) - #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1551, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } - } else { - __pyx_t_4 = __pyx_t_14(__pyx_t_1); - if (unlikely(!__pyx_t_4)) { - PyObject* exc_type = PyErr_Occurred(); - if (exc_type) { - if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1551, __pyx_L1_error) - } - break; - } - __Pyx_GOTREF(__pyx_t_4); - } - __Pyx_XDECREF_SET(__pyx_v_ln, __pyx_t_4); - __pyx_t_4 = 0; - - /* "collisions.py":1552 - * ps = [] - * for ln in othershape.toLines(): - * ps.append(ln.closestPointTo(self)) # <<<<<<<<<<<<<< - * ps.sort(key=lambda x: (x[0]-self.x)**2+(x[1]-self.y)**2) - * if returnAll: - */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1552, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_8)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_8); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_cur_scope->__pyx_v_self}; - __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1552, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - } - __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_ps, __pyx_t_4); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 1552, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1688, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __pyx_t_8 = PyNumber_Power(__pyx_t_6, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1688, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "collisions.py":1551 - * else: - * ps = [] - * for ln in othershape.toLines(): # <<<<<<<<<<<<<< - * ps.append(ln.closestPointTo(self)) - * ps.sort(key=lambda x: (x[0]-self.x)**2+(x[1]-self.y)**2) + /* "collisions.py":1687 + * dist_to = math.hypot(oldCir[0]-cpoMvemnt[0], oldCir[1]-cpoMvemnt[1]) - ( + * math.sqrt( + * newCir.r**2 - \ # <<<<<<<<<<<<<< + * math.hypot(cpoMvemnt[0]-point[0], cpoMvemnt[1]-point[1])**2 + * ) */ + __pyx_t_6 = PyNumber_Subtract(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1687, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = NULL; + __pyx_t_10 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_8)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_8); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_10 = 1; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "collisions.py":1553 - * for ln in othershape.toLines(): - * ps.append(ln.closestPointTo(self)) - * ps.sort(key=lambda x: (x[0]-self.x)**2+(x[1]-self.y)**2) # <<<<<<<<<<<<<< - * if returnAll: - * return [self.closestPointTo(Point(*p)) for p in ps] - */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ps, __pyx_n_s_sort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_14closestPointTo_1lambda15, 0, __pyx_n_s_Circle_closestPointTo_locals_lam, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_key, __pyx_t_2) < 0) __PYX_ERR(0, 1553, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1553, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_6}; + __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1686, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } - /* "collisions.py":1554 - * ps.append(ln.closestPointTo(self)) - * ps.sort(key=lambda x: (x[0]-self.x)**2+(x[1]-self.y)**2) - * if returnAll: # <<<<<<<<<<<<<< - * return [self.closestPointTo(Point(*p)) for p in ps] - * return self.closestPointTo(Point(*ps[0])) - */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1554, __pyx_L1_error) - if (__pyx_t_6) { - - /* "collisions.py":1555 - * ps.sort(key=lambda x: (x[0]-self.x)**2+(x[1]-self.y)**2) - * if returnAll: - * return [self.closestPointTo(Point(*p)) for p in ps] # <<<<<<<<<<<<<< - * return self.closestPointTo(Point(*ps[0])) - * + /* "collisions.py":1685 + * (newCir.x + newCir.r * math.cos(velphi), newCir.y + newCir.r * math.sin(velphi)) + * ).closestPointTo(Point(*point)) + * dist_to = math.hypot(oldCir[0]-cpoMvemnt[0], oldCir[1]-cpoMvemnt[1]) - ( # <<<<<<<<<<<<<< + * math.sqrt( + * newCir.r**2 - \ */ - __Pyx_XDECREF(__pyx_r); - { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1555, __pyx_L15_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __pyx_v_ps; __Pyx_INCREF(__pyx_t_4); - __pyx_t_13 = 0; - for (;;) { - { - Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); - #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1555, __pyx_L15_error) - #endif - if (__pyx_t_13 >= __pyx_temp) break; - } - #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_1); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 1555, __pyx_L15_error) - #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1555, __pyx_L15_error) - __Pyx_GOTREF(__pyx_t_1); - #endif - __Pyx_XDECREF_SET(__pyx_9genexpr23__pyx_v_p, __pyx_t_1); - __pyx_t_1 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1555, __pyx_L15_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1555, __pyx_L15_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_9genexpr23__pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1555, __pyx_L15_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1555, __pyx_L15_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); - __pyx_t_5 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_9}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1555, __pyx_L15_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 1555, __pyx_L15_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_p); __pyx_9genexpr23__pyx_v_p = 0; - goto __pyx_L19_exit_scope; - __pyx_L15_error:; - __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_p); __pyx_9genexpr23__pyx_v_p = 0; - goto __pyx_L1_error; - __pyx_L19_exit_scope:; - } /* exit inner scope */ - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; + __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_v_dist_to = __pyx_t_2; + __pyx_t_2 = 0; - /* "collisions.py":1554 - * ps.append(ln.closestPointTo(self)) - * ps.sort(key=lambda x: (x[0]-self.x)**2+(x[1]-self.y)**2) - * if returnAll: # <<<<<<<<<<<<<< - * return [self.closestPointTo(Point(*p)) for p in ps] - * return self.closestPointTo(Point(*ps[0])) + /* "collisions.py":1691 + * ) + * ) + * dist_left = (math.hypot(oldCir[0]-newCir[0], oldCir[1]-newCir[1])-dist_to)*closestObj.bounciness # <<<<<<<<<<<<<< + * ThisClosestP = (oldCir.x + dist_to * math.cos(velphi), oldCir.y + dist_to * math.sin(velphi)) + * return ThisClosestP, dist_left */ + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_math); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_hypot); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_oldCir)) { __Pyx_RaiseClosureNameError("oldCir"); __PYX_ERR(0, 1691, __pyx_L1_error) } + __pyx_t_9 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_oldCir, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + if (unlikely(!__pyx_cur_scope->__pyx_v_newCir)) { __Pyx_RaiseClosureNameError("newCir"); __PYX_ERR(0, 1691, __pyx_L1_error) } + __pyx_t_6 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_newCir, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_8 = PyNumber_Subtract(__pyx_t_9, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_oldCir)) { __Pyx_RaiseClosureNameError("oldCir"); __PYX_ERR(0, 1691, __pyx_L1_error) } + __pyx_t_6 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_oldCir, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + if (unlikely(!__pyx_cur_scope->__pyx_v_newCir)) { __Pyx_RaiseClosureNameError("newCir"); __PYX_ERR(0, 1691, __pyx_L1_error) } + __pyx_t_9 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_newCir, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = PyNumber_Subtract(__pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = NULL; + __pyx_t_10 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_9); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_10 = 1; } - - /* "collisions.py":1556 - * if returnAll: - * return [self.closestPointTo(Point(*p)) for p in ps] - * return self.closestPointTo(Point(*ps[0])) # <<<<<<<<<<<<<< - * - * def handleCollisionsPos(self, - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Point); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_GetItemInt_List(__pyx_v_ps, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PySequence_Tuple(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_8, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 2+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = NULL; - __pyx_t_5 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_9); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_5 = 1; - } + } + __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_v_dist_to); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_closestObj)) { __Pyx_RaiseClosureNameError("closestObj"); __PYX_ERR(0, 1691, __pyx_L1_error) } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1691, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1691, __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_v_dist_left = __pyx_t_3; + __pyx_t_3 = 0; + + /* "collisions.py":1692 + * ) + * dist_left = (math.hypot(oldCir[0]-newCir[0], oldCir[1]-newCir[1])-dist_to)*closestObj.bounciness + * ThisClosestP = (oldCir.x + dist_to * math.cos(velphi), oldCir.y + dist_to * math.sin(velphi)) # <<<<<<<<<<<<<< + * return ThisClosestP, dist_left + * ThisClosestP, dist_left = calculate(closestP) + */ + if (unlikely(!__pyx_cur_scope->__pyx_v_oldCir)) { __Pyx_RaiseClosureNameError("oldCir"); __PYX_ERR(0, 1692, __pyx_L1_error) } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cos); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_velphi)) { __Pyx_RaiseClosureNameError("velphi"); __PYX_ERR(0, 1692, __pyx_L1_error) } + __pyx_t_1 = NULL; + __pyx_t_10 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_8, function); + __pyx_t_10 = 1; } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_8}; - __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1556, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_cur_scope->__pyx_v_velphi}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + } + __pyx_t_8 = PyNumber_Multiply(__pyx_v_dist_to, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_oldCir)) { __Pyx_RaiseClosureNameError("oldCir"); __PYX_ERR(0, 1692, __pyx_L1_error) } + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sin); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_cur_scope->__pyx_v_velphi)) { __Pyx_RaiseClosureNameError("velphi"); __PYX_ERR(0, 1692, __pyx_L1_error) } + __pyx_t_1 = NULL; + __pyx_t_10 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_9))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_9); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_9, function); + __pyx_t_10 = 1; } - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_cur_scope->__pyx_v_velphi}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + } + __pyx_t_9 = PyNumber_Multiply(__pyx_v_dist_to, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Add(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1692, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2)) __PYX_ERR(0, 1692, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3)) __PYX_ERR(0, 1692, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_t_3 = 0; + __pyx_v_ThisClosestP = ((PyObject*)__pyx_t_9); + __pyx_t_9 = 0; - /* "collisions.py":1509 - * return othershape._where(self) - * - * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike,Iterable[pointLike]]: # <<<<<<<<<<<<<< - * """ - * Find the closest point ON this object TO another object. + /* "collisions.py":1693 + * dist_left = (math.hypot(oldCir[0]-newCir[0], oldCir[1]-newCir[1])-dist_to)*closestObj.bounciness + * ThisClosestP = (oldCir.x + dist_to * math.cos(velphi), oldCir.y + dist_to * math.sin(velphi)) + * return ThisClosestP, dist_left # <<<<<<<<<<<<<< + * ThisClosestP, dist_left = calculate(closestP) + * tries = 0 + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1693, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __Pyx_INCREF(__pyx_v_ThisClosestP); + __Pyx_GIVEREF(__pyx_v_ThisClosestP); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_ThisClosestP)) __PYX_ERR(0, 1693, __pyx_L1_error); + __Pyx_INCREF(__pyx_v_dist_left); + __Pyx_GIVEREF(__pyx_v_dist_left); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_dist_left)) __PYX_ERR(0, 1693, __pyx_L1_error); + __pyx_r = __pyx_t_9; + __pyx_t_9 = 0; + goto __pyx_L0; + + /* "collisions.py":1681 + * else: + * closestObj = points[0][1] + * def calculate(point): # <<<<<<<<<<<<<< + * cpoMvemnt = Line((oldCir.x + oldCir.r * math.cos(velphi-math.pi), oldCir.y + oldCir.r * math.sin(velphi-math.pi)), + * (newCir.x + newCir.r * math.cos(velphi), newCir.y + newCir.r * math.sin(velphi)) */ /* function exit code */ @@ -52073,323 +54879,42 @@ static PyObject *__pyx_pf_10collisions_6Circle_12closestPointTo(CYTHON_UNUSED Py __Pyx_XDECREF(__pyx_t_2); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); + __Pyx_XDECREF(__pyx_t_5); + __Pyx_XDECREF(__pyx_t_6); __Pyx_XDECREF(__pyx_t_7); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); - __Pyx_XDECREF(__pyx_t_10); __Pyx_XDECREF(__pyx_t_11); - __Pyx_XDECREF(__pyx_t_12); - __Pyx_AddTraceback("collisions.Circle.closestPointTo", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_x); - __Pyx_XDECREF(__pyx_v_y); - __Pyx_XDECREF(__pyx_v_phi); - __Pyx_XDECREF(__pyx_v_angle); - __Pyx_XDECREF(__pyx_v_qx); - __Pyx_XDECREF(__pyx_v_qy); - __Pyx_XDECREF(__pyx_v_wheres); - __Pyx_XDECREF(__pyx_v_sort); - __Pyx_XDECREF(__pyx_v_ps); - __Pyx_XDECREF(__pyx_v_ln); - __Pyx_XDECREF(__pyx_9genexpr23__pyx_v_p); - __Pyx_DECREF((PyObject *)__pyx_cur_scope); - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "collisions.py":1558 - * return self.closestPointTo(Point(*ps[0])) - * - * def handleCollisionsPos(self, # <<<<<<<<<<<<<< - * oldCir: 'Circle', - * newCir: 'Circle', - */ - -static PyObject *__pyx_pf_10collisions_44__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { - PyObject *__pyx_r = NULL; - __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("__defaults__", 1); - __Pyx_XDECREF(__pyx_r); - - /* "collisions.py":1565 - * replaceSelf: bool = True, - * precision: Number = BASEPRECISION, - * verbose: bool = False # <<<<<<<<<<<<<< - * ) -> tuple[pointLike, pointLike, verboseOutput]: - * """ - */ - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1558, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_self)->__pyx_arg_vel); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_self)->__pyx_arg_vel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_self)->__pyx_arg_vel)) __PYX_ERR(0, 1558, __pyx_L1_error); - __Pyx_INCREF(((PyObject *)Py_True)); - __Pyx_GIVEREF(((PyObject *)Py_True)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_True))) __PYX_ERR(0, 1558, __pyx_L1_error); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_self)->__pyx_arg_precision); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_self)->__pyx_arg_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 1558, __pyx_L1_error); - __Pyx_INCREF(((PyObject *)Py_False)); - __Pyx_GIVEREF(((PyObject *)Py_False)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)Py_False))) __PYX_ERR(0, 1558, __pyx_L1_error); - - /* "collisions.py":1558 - * return self.closestPointTo(Point(*ps[0])) - * - * def handleCollisionsPos(self, # <<<<<<<<<<<<<< - * oldCir: 'Circle', - * newCir: 'Circle', - */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1558, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1558, __pyx_L1_error); - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 1558, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_r = __pyx_t_2; - __pyx_t_2 = 0; - goto __pyx_L0; - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_AddTraceback("collisions.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("collisions.Circle.handleCollisionsPos.calculate", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; + __Pyx_XDECREF(__pyx_v_cpoMvemnt); + __Pyx_XDECREF(__pyx_v_dist_to); + __Pyx_XDECREF(__pyx_v_dist_left); + __Pyx_XDECREF(__pyx_v_ThisClosestP); __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -/* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_15handleCollisionsPos(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_6Circle_14handleCollisionsPos, "\n Handles movement of this Circle and it bouncing off of other objects.\n It is recommended you use `.handleCollisionsVel` instead of this, as it handles velocity instead of raw movement and is easier to use.\n\n But if you are to use this, remember to still provide the vel param. It will sometimes provide weird results if you don't.\n It could even just be the difference in positions, it just needs to be something realistic.\n\n FIXME; This is currently broken plz do not use until I fix it\n\n Args:\n oldCir (Circle): The old position of this object.\n newCir (Circle): The new position of this object.\n objs (Shapes / Iterable[Shape]): The objects this will bounce off.\n vel (pointLike, optional): The velocity that this object is going. Defaults to [0, 0].\n replaceSelf (bool, optional): Whether to replace self.x and self.y with the new position of the object after bouncing or not. Defaults to True.\n precision (Number, optional): The decimal places to round to to check (for things like corner checking). Defaults to 5.\n verbose (bool, optional): Whether to give verbose output or not. Defaults to False.\n\n Returns:\n tuple[pointLike, pointLike, veboseOutput?]: The new position and vel of this object respectively, and if verbose then the verboseOutput.\n \n VerboseOutput:\n DidReflect (bool): Whether the line reflected off of something\n "); -static PyMethodDef __pyx_mdef_10collisions_6Circle_15handleCollisionsPos = {"handleCollisionsPos", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_15handleCollisionsPos, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Circle_14handleCollisionsPos}; -static PyObject *__pyx_pw_10collisions_6Circle_15handleCollisionsPos(PyObject *__pyx_self, -#if CYTHON_METH_FASTCALL -PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds -#else -PyObject *__pyx_args, PyObject *__pyx_kwds -#endif -) { - PyObject *__pyx_v_self = 0; - PyObject *__pyx_v_oldCir = 0; - PyObject *__pyx_v_newCir = 0; - PyObject *__pyx_v_objs = 0; - PyObject *__pyx_v_vel = 0; - PyObject *__pyx_v_replaceSelf = 0; - PyObject *__pyx_v_precision = 0; - PyObject *__pyx_v_verbose = 0; - #if !CYTHON_METH_FASTCALL - CYTHON_UNUSED Py_ssize_t __pyx_nargs; - #endif - CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[8] = {0,0,0,0,0,0,0,0}; - int __pyx_lineno = 0; - const char *__pyx_filename = NULL; - int __pyx_clineno = 0; - PyObject *__pyx_r = 0; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("handleCollisionsPos (wrapper)", 0); - #if !CYTHON_METH_FASTCALL - #if CYTHON_ASSUME_SAFE_MACROS - __pyx_nargs = PyTuple_GET_SIZE(__pyx_args); - #else - __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL; - #endif - #endif - __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); - { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_oldCir,&__pyx_n_s_newCir,&__pyx_n_s_objs,&__pyx_n_s_vel,&__pyx_n_s_replaceSelf,&__pyx_n_s_precision,&__pyx_n_s_verbose,0}; - __pyx_defaults13 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_self); - values[4] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_vel); - values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); - values[6] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_precision); - values[7] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); - if (__pyx_kwds) { - Py_ssize_t kw_args; - switch (__pyx_nargs) { - case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - CYTHON_FALLTHROUGH; - case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - CYTHON_FALLTHROUGH; - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - CYTHON_FALLTHROUGH; - case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - CYTHON_FALLTHROUGH; - case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - CYTHON_FALLTHROUGH; - case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - CYTHON_FALLTHROUGH; - case 0: break; - default: goto __pyx_L5_argtuple_error; - } - kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds); - switch (__pyx_nargs) { - case 0: - if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1558, __pyx_L3_error) - else goto __pyx_L5_argtuple_error; - CYTHON_FALLTHROUGH; - case 1: - if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_oldCir)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1558, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 1); __PYX_ERR(0, 1558, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 2: - if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_newCir)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1558, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 2); __PYX_ERR(0, 1558, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 3: - if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_objs)) != 0)) { - (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); - kw_args--; - } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1558, __pyx_L3_error) - else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 3); __PYX_ERR(0, 1558, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 4: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vel); - if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1558, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 5: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_replaceSelf); - if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1558, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 6: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_precision); - if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1558, __pyx_L3_error) - } - CYTHON_FALLTHROUGH; - case 7: - if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_verbose); - if (value) { values[7] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1558, __pyx_L3_error) - } - } - if (unlikely(kw_args > 0)) { - const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "handleCollisionsPos") < 0)) __PYX_ERR(0, 1558, __pyx_L3_error) - } - } else { - switch (__pyx_nargs) { - case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); - CYTHON_FALLTHROUGH; - case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); - CYTHON_FALLTHROUGH; - case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); - CYTHON_FALLTHROUGH; - case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); - CYTHON_FALLTHROUGH; - case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3); - values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2); - values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1); - values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0); - break; - default: goto __pyx_L5_argtuple_error; - } - } - __pyx_v_self = values[0]; - __pyx_v_oldCir = values[1]; - __pyx_v_newCir = values[2]; - __pyx_v_objs = values[3]; - __pyx_v_vel = values[4]; - __pyx_v_replaceSelf = values[5]; - __pyx_v_precision = values[6]; - __pyx_v_verbose = values[7]; - } - goto __pyx_L6_skip; - __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, __pyx_nargs); __PYX_ERR(0, 1558, __pyx_L3_error) - __pyx_L6_skip:; - goto __pyx_L4_argument_unpacking_done; - __pyx_L3_error:; - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_AddTraceback("collisions.Circle.handleCollisionsPos", __pyx_clineno, __pyx_lineno, __pyx_filename); - __Pyx_RefNannyFinishContext(); - return NULL; - __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Circle_14handleCollisionsPos(__pyx_self, __pyx_v_self, __pyx_v_oldCir, __pyx_v_newCir, __pyx_v_objs, __pyx_v_vel, __pyx_v_replaceSelf, __pyx_v_precision, __pyx_v_verbose); - - /* function exit code */ - { - Py_ssize_t __pyx_temp; - for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { - __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); - } - } - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "collisions.py":1615 +/* "collisions.py":1668 * cs.extend([i for j in [mvement[0], mvement[2]] for i in o.closestPointTo(j, True) if Point(*i).collides(mvement)]) * points.extend(list(zip(cs, [o for _ in range(len(cs))]))) * points.sort(key=lambda x: abs(x[0][0]-oldCir[0])**2+abs(x[0][1]-oldCir[1])**2) # <<<<<<<<<<<<<< * closestP = points[0][0] - * closestObj = points[0][1] + * if checkShpType(points[0][1], ShpGroups.SPLITTABLE): */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_19handleCollisionsPos_lambda16(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Circle_19handleCollisionsPos_2lambda16(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_6Circle_19handleCollisionsPos_lambda16 = {"lambda16", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_19handleCollisionsPos_lambda16, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Circle_19handleCollisionsPos_lambda16(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_6Circle_19handleCollisionsPos_2lambda16 = {"lambda16", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_19handleCollisionsPos_2lambda16, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_6Circle_19handleCollisionsPos_2lambda16(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -52433,12 +54958,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1615, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1668, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda16") < 0)) __PYX_ERR(0, 1615, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda16") < 0)) __PYX_ERR(0, 1668, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -52449,7 +54974,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda16", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1615, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda16", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1668, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -52477,8 +55002,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_lambda_funcdef_lambda16(PyObject *__pyx_self, PyObject *__pyx_v_x) { - struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos *__pyx_cur_scope; - struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos *__pyx_outer_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_13_handleCollisionsPos *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_13_handleCollisionsPos *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -52489,46 +55014,46 @@ static PyObject *__pyx_lambda_funcdef_lambda16(PyObject *__pyx_self, PyObject *_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda16", 1); - __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_13_handleCollisionsPos *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1615, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1615, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_v_oldCir)) { __Pyx_RaiseClosureNameError("oldCir"); __PYX_ERR(0, 1615, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_oldCir, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1615, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_oldCir)) { __Pyx_RaiseClosureNameError("oldCir"); __PYX_ERR(0, 1668, __pyx_L1_error) } + __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_oldCir, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1615, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1615, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1615, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1615, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1615, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_v_oldCir)) { __Pyx_RaiseClosureNameError("oldCir"); __PYX_ERR(0, 1615, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_oldCir, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1615, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_oldCir)) { __Pyx_RaiseClosureNameError("oldCir"); __PYX_ERR(0, 1668, __pyx_L1_error) } + __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_oldCir, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1615, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1615, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1615, __pyx_L1_error) + __pyx_t_4 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1615, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -52550,7 +55075,7 @@ static PyObject *__pyx_lambda_funcdef_lambda16(PyObject *__pyx_self, PyObject *_ return __pyx_r; } -/* "collisions.py":1558 +/* "collisions.py":1600 * return self.closestPointTo(Point(*ps[0])) * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< @@ -52558,27 +55083,33 @@ static PyObject *__pyx_lambda_funcdef_lambda16(PyObject *__pyx_self, PyObject *_ * newCir: 'Circle', */ -static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_oldCir, PyObject *__pyx_v_newCir, PyObject *__pyx_v_objs, PyObject *__pyx_v_vel, PyObject *__pyx_v_replaceSelf, PyObject *__pyx_v_precision, PyObject *__pyx_v_verbose) { - struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos *__pyx_cur_scope; - PyObject *__pyx_v_velphi = NULL; +static PyObject *__pyx_pf_10collisions_6Circle_18handleCollisionsPos(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_oldCir, PyObject *__pyx_v_newCir, PyObject *__pyx_v_objs, PyObject *__pyx_v_vel, PyObject *__pyx_v_unstuckable, PyObject *__pyx_v_maxTries, PyObject *__pyx_v_replaceSelf, PyObject *__pyx_v_precision, PyObject *__pyx_v_verbose) { + struct __pyx_obj_10collisions___pyx_scope_struct_13_handleCollisionsPos *__pyx_cur_scope; PyObject *__pyx_v_quart = NULL; PyObject *__pyx_v_mvement = NULL; PyObject *__pyx_v_points = NULL; PyObject *__pyx_v_o = NULL; PyObject *__pyx_v_cs = NULL; PyObject *__pyx_v_closestP = NULL; - PyObject *__pyx_v_closestObj = NULL; - PyObject *__pyx_v_t = NULL; - PyObject *__pyx_v_normal = NULL; - PyObject *__pyx_v_cpoMvemnt = NULL; - PyObject *__pyx_v_dist_left = NULL; - PyObject *__pyx_v_dist_to = NULL; + PyObject *__pyx_v_lns = NULL; + PyObject *__pyx_v_collP = NULL; + PyObject *__pyx_v_factor = NULL; + PyObject *__pyx_v_ln = NULL; + PyObject *__pyx_v_p = NULL; + PyObject *__pyx_v_calculate = 0; PyObject *__pyx_v_ThisClosestP = NULL; - PyObject *__pyx_v_x = NULL; - PyObject *__pyx_v_y = NULL; - PyObject *__pyx_v_phi = NULL; + PyObject *__pyx_v_dist_left = NULL; + PyObject *__pyx_v_tries = NULL; + PyObject *__pyx_v_ps = NULL; + PyObject *__pyx_v_xs = NULL; + PyObject *__pyx_v_ys = NULL; PyObject *__pyx_v_diff = NULL; + PyObject *__pyx_v_normal = NULL; + PyObject *__pyx_v_phi = NULL; PyObject *__pyx_v_pos = NULL; + PyObject *__pyx_v_angle = NULL; + PyObject *__pyx_v_qx = NULL; + PyObject *__pyx_v_qy = NULL; PyObject *__pyx_v_smallness = NULL; PyObject *__pyx_v_out = NULL; PyObject *__pyx_v_outvel = NULL; @@ -52604,46 +55135,50 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS PyObject *__pyx_t_15 = NULL; int __pyx_t_16; int __pyx_t_17; - Py_ssize_t __pyx_t_18; - PyObject *(*__pyx_t_19)(PyObject *); - Py_ssize_t __pyx_t_20; + int __pyx_t_18; + Py_ssize_t __pyx_t_19; + PyObject *(*__pyx_t_20)(PyObject *); Py_ssize_t __pyx_t_21; - PyObject *(*__pyx_t_22)(PyObject *); - Py_ssize_t __pyx_t_23; - int __pyx_t_24; - PyObject *(*__pyx_t_25)(PyObject *); + Py_ssize_t __pyx_t_22; + PyObject *(*__pyx_t_23)(PyObject *); + Py_ssize_t __pyx_t_24; + int __pyx_t_25; + PyObject *(*__pyx_t_26)(PyObject *); int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handleCollisionsPos", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos *)__pyx_tp_new_10collisions___pyx_scope_struct_12_handleCollisionsPos(__pyx_ptype_10collisions___pyx_scope_struct_12_handleCollisionsPos, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_13_handleCollisionsPos *)__pyx_tp_new_10collisions___pyx_scope_struct_13_handleCollisionsPos(__pyx_ptype_10collisions___pyx_scope_struct_13_handleCollisionsPos, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_13_handleCollisionsPos *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1558, __pyx_L1_error) + __PYX_ERR(0, 1600, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __pyx_cur_scope->__pyx_v_oldCir = __pyx_v_oldCir; __Pyx_INCREF(__pyx_cur_scope->__pyx_v_oldCir); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_oldCir); + __pyx_cur_scope->__pyx_v_newCir = __pyx_v_newCir; + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_newCir); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_newCir); __Pyx_INCREF(__pyx_v_vel); - /* "collisions.py":1591 + /* "collisions.py":1637 * DidReflect (bool): Whether the line reflected off of something * """ * velphi = math.atan2(vel[1], vel[0]) # <<<<<<<<<<<<<< * quart = math.pi/2 * mvement = Shapes(oldCir, Polygon( */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1591, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_atan2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1591, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_atan2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1591, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1591, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -52665,60 +55200,61 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1591, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_v_velphi = __pyx_t_1; + __Pyx_GIVEREF(__pyx_t_1); + __pyx_cur_scope->__pyx_v_velphi = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":1592 + /* "collisions.py":1638 * """ * velphi = math.atan2(vel[1], vel[0]) * quart = math.pi/2 # <<<<<<<<<<<<<< * mvement = Shapes(oldCir, Polygon( * (oldCir.x + oldCir.r * math.cos(velphi-quart), oldCir.y + oldCir.r * math.sin(velphi-quart)), */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1592, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1592, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_3, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1592, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_3, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_quart = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":1593 + /* "collisions.py":1639 * velphi = math.atan2(vel[1], vel[0]) * quart = math.pi/2 * mvement = Shapes(oldCir, Polygon( # <<<<<<<<<<<<<< * (oldCir.x + oldCir.r * math.cos(velphi-quart), oldCir.y + oldCir.r * math.sin(velphi-quart)), * (oldCir.x + oldCir.r * math.cos(velphi+quart), oldCir.y + oldCir.r * math.sin(velphi+quart)), */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1593, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1593, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "collisions.py":1594 + /* "collisions.py":1640 * quart = math.pi/2 * mvement = Shapes(oldCir, Polygon( * (oldCir.x + oldCir.r * math.cos(velphi-quart), oldCir.y + oldCir.r * math.sin(velphi-quart)), # <<<<<<<<<<<<<< * (oldCir.x + oldCir.r * math.cos(velphi+quart), oldCir.y + oldCir.r * math.sin(velphi+quart)), * (newCir.x + newCir.r * math.cos(velphi-quart), newCir.y + newCir.r * math.sin(velphi-quart)), */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1594, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1594, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_math); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1594, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_math); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_cos); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1594, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_cos); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Subtract(__pyx_v_velphi, __pyx_v_quart); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1594, __pyx_L1_error) + __pyx_t_9 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_velphi, __pyx_v_quart); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_11 = NULL; __pyx_t_6 = 0; @@ -52739,28 +55275,28 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1594, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } - __pyx_t_10 = PyNumber_Multiply(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1594, __pyx_L1_error) + __pyx_t_10 = PyNumber_Multiply(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Add(__pyx_t_5, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1594, __pyx_L1_error) + __pyx_t_8 = PyNumber_Add(__pyx_t_5, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_y); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1594, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_y); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_r); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1594, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_r); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_math); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1594, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_math); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_sin); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1594, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_sin); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Subtract(__pyx_v_velphi, __pyx_v_quart); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1594, __pyx_L1_error) + __pyx_t_9 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_velphi, __pyx_v_quart); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_12 = NULL; __pyx_t_6 = 0; @@ -52781,44 +55317,44 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1594, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } - __pyx_t_11 = PyNumber_Multiply(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1594, __pyx_L1_error) + __pyx_t_11 = PyNumber_Multiply(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Add(__pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1594, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1594, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8)) __PYX_ERR(0, 1594, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_8)) __PYX_ERR(0, 1640, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_7)) __PYX_ERR(0, 1594, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_7)) __PYX_ERR(0, 1640, __pyx_L1_error); __pyx_t_8 = 0; __pyx_t_7 = 0; - /* "collisions.py":1595 + /* "collisions.py":1641 * mvement = Shapes(oldCir, Polygon( * (oldCir.x + oldCir.r * math.cos(velphi-quart), oldCir.y + oldCir.r * math.sin(velphi-quart)), * (oldCir.x + oldCir.r * math.cos(velphi+quart), oldCir.y + oldCir.r * math.sin(velphi+quart)), # <<<<<<<<<<<<<< * (newCir.x + newCir.r * math.cos(velphi-quart), newCir.y + newCir.r * math.sin(velphi-quart)), * (newCir.x + newCir.r * math.cos(velphi+quart), newCir.y + newCir.r * math.sin(velphi+quart)), */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1595, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_r); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1595, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_r); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1595, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_cos); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1595, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_cos); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_v_velphi, __pyx_v_quart); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1595, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_cur_scope->__pyx_v_velphi, __pyx_v_quart); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_12 = NULL; __pyx_t_6 = 0; @@ -52839,28 +55375,28 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1595, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } - __pyx_t_9 = PyNumber_Multiply(__pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1595, __pyx_L1_error) + __pyx_t_9 = PyNumber_Multiply(__pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyNumber_Add(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1595, __pyx_L1_error) + __pyx_t_10 = PyNumber_Add(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_y); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1595, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_y); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1595, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1595, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sin); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1595, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sin); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_v_velphi, __pyx_v_quart); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1595, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_cur_scope->__pyx_v_velphi, __pyx_v_quart); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_13 = NULL; __pyx_t_6 = 0; @@ -52881,44 +55417,44 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1595, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } - __pyx_t_12 = PyNumber_Multiply(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1595, __pyx_L1_error) + __pyx_t_12 = PyNumber_Multiply(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Add(__pyx_t_9, __pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1595, __pyx_L1_error) + __pyx_t_8 = PyNumber_Add(__pyx_t_9, __pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1595, __pyx_L1_error) + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10)) __PYX_ERR(0, 1595, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10)) __PYX_ERR(0, 1641, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_8)) __PYX_ERR(0, 1595, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_8)) __PYX_ERR(0, 1641, __pyx_L1_error); __pyx_t_10 = 0; __pyx_t_8 = 0; - /* "collisions.py":1596 + /* "collisions.py":1642 * (oldCir.x + oldCir.r * math.cos(velphi-quart), oldCir.y + oldCir.r * math.sin(velphi-quart)), * (oldCir.x + oldCir.r * math.cos(velphi+quart), oldCir.y + oldCir.r * math.sin(velphi+quart)), * (newCir.x + newCir.r * math.cos(velphi-quart), newCir.y + newCir.r * math.sin(velphi-quart)), # <<<<<<<<<<<<<< * (newCir.x + newCir.r * math.cos(velphi+quart), newCir.y + newCir.r * math.sin(velphi+quart)), * ), newCir) */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_newCir, __pyx_n_s_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1596, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_newCir, __pyx_n_s_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_newCir, __pyx_n_s_r); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1596, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_newCir, __pyx_n_s_r); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_math); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1596, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_math); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_cos); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1596, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_cos); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Subtract(__pyx_v_velphi, __pyx_v_quart); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1596, __pyx_L1_error) + __pyx_t_7 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_velphi, __pyx_v_quart); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_13 = NULL; __pyx_t_6 = 0; @@ -52939,28 +55475,28 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1596, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_5 = PyNumber_Multiply(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1596, __pyx_L1_error) + __pyx_t_5 = PyNumber_Multiply(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1596, __pyx_L1_error) + __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_newCir, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1596, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_newCir, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_newCir, __pyx_n_s_r); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1596, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_newCir, __pyx_n_s_r); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_math); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1596, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_math); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_sin); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1596, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_sin); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Subtract(__pyx_v_velphi, __pyx_v_quart); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1596, __pyx_L1_error) + __pyx_t_7 = PyNumber_Subtract(__pyx_cur_scope->__pyx_v_velphi, __pyx_v_quart); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_14 = NULL; __pyx_t_6 = 0; @@ -52981,44 +55517,44 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1596, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } - __pyx_t_13 = PyNumber_Multiply(__pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1596, __pyx_L1_error) + __pyx_t_13 = PyNumber_Multiply(__pyx_t_8, __pyx_t_10); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyNumber_Add(__pyx_t_5, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1596, __pyx_L1_error) + __pyx_t_10 = PyNumber_Add(__pyx_t_5, __pyx_t_13); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1596, __pyx_L1_error) + __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1642, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_9)) __PYX_ERR(0, 1596, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_9)) __PYX_ERR(0, 1642, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_10)) __PYX_ERR(0, 1596, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_10)) __PYX_ERR(0, 1642, __pyx_L1_error); __pyx_t_9 = 0; __pyx_t_10 = 0; - /* "collisions.py":1597 + /* "collisions.py":1643 * (oldCir.x + oldCir.r * math.cos(velphi+quart), oldCir.y + oldCir.r * math.sin(velphi+quart)), * (newCir.x + newCir.r * math.cos(velphi-quart), newCir.y + newCir.r * math.sin(velphi-quart)), * (newCir.x + newCir.r * math.cos(velphi+quart), newCir.y + newCir.r * math.sin(velphi+quart)), # <<<<<<<<<<<<<< * ), newCir) * # Don't let you move when you're in a wall */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_newCir, __pyx_n_s_x); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1597, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_newCir, __pyx_n_s_x); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_newCir, __pyx_n_s_r); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1597, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_newCir, __pyx_n_s_r); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_math); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1597, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_math); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_cos); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1597, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_cos); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Add(__pyx_v_velphi, __pyx_v_quart); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1597, __pyx_L1_error) + __pyx_t_8 = PyNumber_Add(__pyx_cur_scope->__pyx_v_velphi, __pyx_v_quart); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_14 = NULL; __pyx_t_6 = 0; @@ -53039,28 +55575,28 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1597, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_7 = PyNumber_Multiply(__pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1597, __pyx_L1_error) + __pyx_t_7 = PyNumber_Multiply(__pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1597, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_newCir, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1597, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_newCir, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_newCir, __pyx_n_s_r); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1597, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_newCir, __pyx_n_s_r); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_math); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1597, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_math); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_sin); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1597, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_sin); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyNumber_Add(__pyx_v_velphi, __pyx_v_quart); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1597, __pyx_L1_error) + __pyx_t_8 = PyNumber_Add(__pyx_cur_scope->__pyx_v_velphi, __pyx_v_quart); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_15 = NULL; __pyx_t_6 = 0; @@ -53081,24 +55617,24 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1597, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } - __pyx_t_14 = PyNumber_Multiply(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1597, __pyx_L1_error) + __pyx_t_14 = PyNumber_Multiply(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Add(__pyx_t_7, __pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1597, __pyx_L1_error) + __pyx_t_9 = PyNumber_Add(__pyx_t_7, __pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1597, __pyx_L1_error) + __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1643, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_5)) __PYX_ERR(0, 1597, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_5)) __PYX_ERR(0, 1643, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_9)) __PYX_ERR(0, 1597, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_9)) __PYX_ERR(0, 1643, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -53123,12 +55659,12 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1593, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - /* "collisions.py":1598 + /* "collisions.py":1644 * (newCir.x + newCir.r * math.cos(velphi-quart), newCir.y + newCir.r * math.sin(velphi-quart)), * (newCir.x + newCir.r * math.cos(velphi+quart), newCir.y + newCir.r * math.sin(velphi+quart)), * ), newCir) # <<<<<<<<<<<<<< @@ -53150,25 +55686,25 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS } #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_oldCir, __pyx_t_4, __pyx_v_newCir}; + PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_oldCir, __pyx_t_4, __pyx_cur_scope->__pyx_v_newCir}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1593, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1639, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_mvement = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":1600 + /* "collisions.py":1646 * ), newCir) * # Don't let you move when you're in a wall * if oldCir.collides(objs): # <<<<<<<<<<<<<< - * if verbose: - * return oldCir, [0, 0], [True] + * if unstuckable and not newCir.collides(objs): + * if verbose: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1600, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_6 = 0; @@ -53188,70 +55724,190 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_objs}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1600, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1646, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 1600, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 1646, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_16) { - /* "collisions.py":1601 + /* "collisions.py":1647 + * # Don't let you move when you're in a wall + * if oldCir.collides(objs): + * if unstuckable and not newCir.collides(objs): # <<<<<<<<<<<<<< + * if verbose: + * return newCir, vel, [True] + */ + __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_unstuckable); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1647, __pyx_L1_error) + if (__pyx_t_17) { + } else { + __pyx_t_16 = __pyx_t_17; + goto __pyx_L5_bool_binop_done; + } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_newCir, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_objs}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1647, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1647, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_18 = (!__pyx_t_17); + __pyx_t_16 = __pyx_t_18; + __pyx_L5_bool_binop_done:; + if (__pyx_t_16) { + + /* "collisions.py":1648 + * if oldCir.collides(objs): + * if unstuckable and not newCir.collides(objs): + * if verbose: # <<<<<<<<<<<<<< + * return newCir, vel, [True] + * return newCir, vel + */ + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 1648, __pyx_L1_error) + if (__pyx_t_16) { + + /* "collisions.py":1649 + * if unstuckable and not newCir.collides(objs): + * if verbose: + * return newCir, vel, [True] # <<<<<<<<<<<<<< + * return newCir, vel + * if verbose: + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_INCREF(Py_True); + __Pyx_GIVEREF(Py_True); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, Py_True)) __PYX_ERR(0, 1649, __pyx_L1_error); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1649, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_newCir); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_newCir); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_newCir)) __PYX_ERR(0, 1649, __pyx_L1_error); + __Pyx_INCREF(__pyx_v_vel); + __Pyx_GIVEREF(__pyx_v_vel); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vel)) __PYX_ERR(0, 1649, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1)) __PYX_ERR(0, 1649, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_r = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "collisions.py":1648 + * if oldCir.collides(objs): + * if unstuckable and not newCir.collides(objs): + * if verbose: # <<<<<<<<<<<<<< + * return newCir, vel, [True] + * return newCir, vel + */ + } + + /* "collisions.py":1650 + * if verbose: + * return newCir, vel, [True] + * return newCir, vel # <<<<<<<<<<<<<< + * if verbose: + * return oldCir, [0, 0], [True] + */ + __Pyx_XDECREF(__pyx_r); + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1650, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_newCir); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_newCir); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_newCir)) __PYX_ERR(0, 1650, __pyx_L1_error); + __Pyx_INCREF(__pyx_v_vel); + __Pyx_GIVEREF(__pyx_v_vel); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vel)) __PYX_ERR(0, 1650, __pyx_L1_error); + __pyx_r = ((PyObject*)__pyx_t_3); + __pyx_t_3 = 0; + goto __pyx_L0; + + /* "collisions.py":1647 * # Don't let you move when you're in a wall * if oldCir.collides(objs): + * if unstuckable and not newCir.collides(objs): # <<<<<<<<<<<<<< + * if verbose: + * return newCir, vel, [True] + */ + } + + /* "collisions.py":1651 + * return newCir, vel, [True] + * return newCir, vel * if verbose: # <<<<<<<<<<<<<< * return oldCir, [0, 0], [True] * return oldCir, [0, 0] */ - __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 1601, __pyx_L1_error) + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 1651, __pyx_L1_error) if (__pyx_t_16) { - /* "collisions.py":1602 - * if oldCir.collides(objs): + /* "collisions.py":1652 + * return newCir, vel * if verbose: * return oldCir, [0, 0], [True] # <<<<<<<<<<<<<< * return oldCir, [0, 0] * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1652, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0)) __PYX_ERR(0, 1602, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_0)) __PYX_ERR(0, 1652, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_0)) __PYX_ERR(0, 1602, __pyx_L1_error); - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_0)) __PYX_ERR(0, 1652, __pyx_L1_error); + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1652, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, Py_True)) __PYX_ERR(0, 1602, __pyx_L1_error); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1602, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, Py_True)) __PYX_ERR(0, 1652, __pyx_L1_error); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1652, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_oldCir); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_oldCir); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_oldCir)) __PYX_ERR(0, 1602, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 1602, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_oldCir)) __PYX_ERR(0, 1652, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(0, 1602, __pyx_L1_error); - __pyx_t_1 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 1652, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1)) __PYX_ERR(0, 1652, __pyx_L1_error); __pyx_t_3 = 0; + __pyx_t_1 = 0; __pyx_r = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":1601 - * # Don't let you move when you're in a wall - * if oldCir.collides(objs): + /* "collisions.py":1651 + * return newCir, vel, [True] + * return newCir, vel * if verbose: # <<<<<<<<<<<<<< * return oldCir, [0, 0], [True] * return oldCir, [0, 0] */ } - /* "collisions.py":1603 + /* "collisions.py":1653 * if verbose: * return oldCir, [0, 0], [True] * return oldCir, [0, 0] # <<<<<<<<<<<<<< @@ -53259,52 +55915,52 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS * if not mvement.collides(objs): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1603, __pyx_L1_error) + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1653, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_int_0)) __PYX_ERR(0, 1603, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_int_0)) __PYX_ERR(0, 1653, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_int_0)) __PYX_ERR(0, 1603, __pyx_L1_error); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1603, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_int_0)) __PYX_ERR(0, 1653, __pyx_L1_error); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1653, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_oldCir); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_oldCir); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_oldCir)) __PYX_ERR(0, 1603, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_oldCir)) __PYX_ERR(0, 1653, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4)) __PYX_ERR(0, 1603, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4)) __PYX_ERR(0, 1653, __pyx_L1_error); __pyx_t_4 = 0; - __pyx_r = ((PyObject*)__pyx_t_3); - __pyx_t_3 = 0; + __pyx_r = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1600 + /* "collisions.py":1646 * ), newCir) * # Don't let you move when you're in a wall * if oldCir.collides(objs): # <<<<<<<<<<<<<< - * if verbose: - * return oldCir, [0, 0], [True] + * if unstuckable and not newCir.collides(objs): + * if verbose: */ } - /* "collisions.py":1605 + /* "collisions.py":1655 * return oldCir, [0, 0] * * if not mvement.collides(objs): # <<<<<<<<<<<<<< * if verbose: * return newCir, vel, [False] */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_mvement, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1605, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_mvement, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = NULL; + __pyx_t_3 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_1)) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_4, function); __pyx_t_6 = 1; @@ -53312,29 +55968,29 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_objs}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1605, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_objs}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1655, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 1605, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_17 = (!__pyx_t_16); - if (__pyx_t_17) { + __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_16 < 0))) __PYX_ERR(0, 1655, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_18 = (!__pyx_t_16); + if (__pyx_t_18) { - /* "collisions.py":1606 + /* "collisions.py":1656 * * if not mvement.collides(objs): * if verbose: # <<<<<<<<<<<<<< * return newCir, vel, [False] * return newCir, vel */ - __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1606, __pyx_L1_error) - if (__pyx_t_17) { + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1656, __pyx_L1_error) + if (__pyx_t_18) { - /* "collisions.py":1607 + /* "collisions.py":1657 * if not mvement.collides(objs): * if verbose: * return newCir, vel, [False] # <<<<<<<<<<<<<< @@ -53342,27 +55998,27 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS * points = [] */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1607, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_False); __Pyx_GIVEREF(Py_False); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, Py_False)) __PYX_ERR(0, 1607, __pyx_L1_error); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1607, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, Py_False)) __PYX_ERR(0, 1657, __pyx_L1_error); + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_v_newCir); - __Pyx_GIVEREF(__pyx_v_newCir); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_newCir)) __PYX_ERR(0, 1607, __pyx_L1_error); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_newCir); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_newCir); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_newCir)) __PYX_ERR(0, 1657, __pyx_L1_error); __Pyx_INCREF(__pyx_v_vel); __Pyx_GIVEREF(__pyx_v_vel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_vel)) __PYX_ERR(0, 1607, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(0, 1607, __pyx_L1_error); - __pyx_t_3 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_vel)) __PYX_ERR(0, 1657, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1)) __PYX_ERR(0, 1657, __pyx_L1_error); + __pyx_t_1 = 0; __pyx_r = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":1606 + /* "collisions.py":1656 * * if not mvement.collides(objs): * if verbose: # <<<<<<<<<<<<<< @@ -53371,7 +56027,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS */ } - /* "collisions.py":1608 + /* "collisions.py":1658 * if verbose: * return newCir, vel, [False] * return newCir, vel # <<<<<<<<<<<<<< @@ -53379,19 +56035,19 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS * for o in objs: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1608, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_INCREF(__pyx_v_newCir); - __Pyx_GIVEREF(__pyx_v_newCir); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_newCir)) __PYX_ERR(0, 1608, __pyx_L1_error); + __Pyx_INCREF(__pyx_cur_scope->__pyx_v_newCir); + __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_newCir); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_newCir)) __PYX_ERR(0, 1658, __pyx_L1_error); __Pyx_INCREF(__pyx_v_vel); __Pyx_GIVEREF(__pyx_v_vel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_vel)) __PYX_ERR(0, 1608, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_vel)) __PYX_ERR(0, 1658, __pyx_L1_error); __pyx_r = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":1605 + /* "collisions.py":1655 * return oldCir, [0, 0] * * if not mvement.collides(objs): # <<<<<<<<<<<<<< @@ -53400,167 +56056,249 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS */ } - /* "collisions.py":1609 + /* "collisions.py":1659 * return newCir, vel, [False] * return newCir, vel * points = [] # <<<<<<<<<<<<<< * for o in objs: - * cs = o.whereCollides(mvement) + * if mvement.isContaining(o): */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1609, __pyx_L1_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1659, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_points = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":1610 + /* "collisions.py":1660 * return newCir, vel * points = [] * for o in objs: # <<<<<<<<<<<<<< - * cs = o.whereCollides(mvement) - * if cs != []: + * if mvement.isContaining(o): + * cs = o.toPoints() */ if (likely(PyList_CheckExact(__pyx_v_objs)) || PyTuple_CheckExact(__pyx_v_objs)) { __pyx_t_4 = __pyx_v_objs; __Pyx_INCREF(__pyx_t_4); - __pyx_t_18 = 0; - __pyx_t_19 = NULL; + __pyx_t_19 = 0; + __pyx_t_20 = NULL; } else { - __pyx_t_18 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_objs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1610, __pyx_L1_error) + __pyx_t_19 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_objs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1660, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_19 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1610, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1660, __pyx_L1_error) } for (;;) { - if (likely(!__pyx_t_19)) { + if (likely(!__pyx_t_20)) { if (likely(PyList_CheckExact(__pyx_t_4))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1610, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1660, __pyx_L1_error) #endif - if (__pyx_t_18 >= __pyx_temp) break; + if (__pyx_t_19 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_18); __Pyx_INCREF(__pyx_t_3); __pyx_t_18++; if (unlikely((0 < 0))) __PYX_ERR(0, 1610, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_19); __Pyx_INCREF(__pyx_t_1); __pyx_t_19++; if (unlikely((0 < 0))) __PYX_ERR(0, 1660, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1610, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1660, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1610, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1660, __pyx_L1_error) #endif - if (__pyx_t_18 >= __pyx_temp) break; + if (__pyx_t_19 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_18); __Pyx_INCREF(__pyx_t_3); __pyx_t_18++; if (unlikely((0 < 0))) __PYX_ERR(0, 1610, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_19); __Pyx_INCREF(__pyx_t_1); __pyx_t_19++; if (unlikely((0 < 0))) __PYX_ERR(0, 1660, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1610, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1660, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); #endif } } else { - __pyx_t_3 = __pyx_t_19(__pyx_t_4); - if (unlikely(!__pyx_t_3)) { + __pyx_t_1 = __pyx_t_20(__pyx_t_4); + if (unlikely(!__pyx_t_1)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1610, __pyx_L1_error) + else __PYX_ERR(0, 1660, __pyx_L1_error) } break; } - __Pyx_GOTREF(__pyx_t_3); + __Pyx_GOTREF(__pyx_t_1); } - __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_3); - __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_1); + __pyx_t_1 = 0; - /* "collisions.py":1611 + /* "collisions.py":1661 * points = [] * for o in objs: - * cs = o.whereCollides(mvement) # <<<<<<<<<<<<<< - * if cs != []: - * cs.extend([i for j in [mvement[0], mvement[2]] for i in o.closestPointTo(j, True) if Point(*i).collides(mvement)]) + * if mvement.isContaining(o): # <<<<<<<<<<<<<< + * cs = o.toPoints() + * else: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1611, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_mvement, __pyx_n_s_isContaining); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); + __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_mvement}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_o}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1611, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1661, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __Pyx_XDECREF_SET(__pyx_v_cs, __pyx_t_3); - __pyx_t_3 = 0; + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1661, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_18) { - /* "collisions.py":1612 + /* "collisions.py":1662 * for o in objs: - * cs = o.whereCollides(mvement) + * if mvement.isContaining(o): + * cs = o.toPoints() # <<<<<<<<<<<<<< + * else: + * cs = o.whereCollides(mvement) + */ + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1662, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_cs, __pyx_t_1); + __pyx_t_1 = 0; + + /* "collisions.py":1661 + * points = [] + * for o in objs: + * if mvement.isContaining(o): # <<<<<<<<<<<<<< + * cs = o.toPoints() + * else: + */ + goto __pyx_L13; + } + + /* "collisions.py":1664 + * cs = o.toPoints() + * else: + * cs = o.whereCollides(mvement) # <<<<<<<<<<<<<< + * if cs != []: + * cs.extend([i for j in [mvement[0], mvement[2]] for i in o.closestPointTo(j, True) if Point(*i).collides(mvement)]) + */ + /*else*/ { + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1664, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_3, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_mvement}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1664, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_cs, __pyx_t_1); + __pyx_t_1 = 0; + } + __pyx_L13:; + + /* "collisions.py":1665 + * else: + * cs = o.whereCollides(mvement) * if cs != []: # <<<<<<<<<<<<<< * cs.extend([i for j in [mvement[0], mvement[2]] for i in o.closestPointTo(j, True) if Point(*i).collides(mvement)]) * points.extend(list(zip(cs, [o for _ in range(len(cs))]))) */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1612, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_cs, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1612, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1612, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1665, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = PyObject_RichCompare(__pyx_v_cs, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1665, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__pyx_t_17) { + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1665, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (__pyx_t_18) { - /* "collisions.py":1613 - * cs = o.whereCollides(mvement) + /* "collisions.py":1666 + * cs = o.whereCollides(mvement) * if cs != []: * cs.extend([i for j in [mvement[0], mvement[2]] for i in o.closestPointTo(j, True) if Point(*i).collides(mvement)]) # <<<<<<<<<<<<<< * points.extend(list(zip(cs, [o for _ in range(len(cs))]))) * points.sort(key=lambda x: abs(x[0][0]-oldCir[0])**2+abs(x[0][1]-oldCir[1])**2) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cs, __pyx_n_s_extend); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1613, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cs, __pyx_n_s_extend); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1666, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1613, __pyx_L12_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1666, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_mvement, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1613, __pyx_L12_error) + __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_mvement, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1666, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_mvement, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1613, __pyx_L12_error) + __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_mvement, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1666, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1613, __pyx_L12_error) + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1666, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_14); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_14)) __PYX_ERR(0, 1613, __pyx_L12_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_14)) __PYX_ERR(0, 1666, __pyx_L17_error); __Pyx_GIVEREF(__pyx_t_13); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_13)) __PYX_ERR(0, 1613, __pyx_L12_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_13)) __PYX_ERR(0, 1666, __pyx_L17_error); __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_13 = __pyx_t_12; __Pyx_INCREF(__pyx_t_13); - __pyx_t_20 = 0; + __pyx_t_21 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; for (;;) { - if (__pyx_t_20 >= 2) break; + if (__pyx_t_21 >= 2) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_20); __Pyx_INCREF(__pyx_t_12); __pyx_t_20++; if (unlikely((0 < 0))) __PYX_ERR(0, 1613, __pyx_L12_error) + __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_21); __Pyx_INCREF(__pyx_t_12); __pyx_t_21++; if (unlikely((0 < 0))) __PYX_ERR(0, 1666, __pyx_L17_error) #else - __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_13, __pyx_t_20); __pyx_t_20++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1613, __pyx_L12_error) + __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_13, __pyx_t_21); __pyx_t_21++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1666, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_12); #endif __Pyx_XDECREF_SET(__pyx_9genexpr24__pyx_v_j, __pyx_t_12); __pyx_t_12 = 0; - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1613, __pyx_L12_error) + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1666, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_14); __pyx_t_11 = NULL; __pyx_t_6 = 0; @@ -53580,58 +56318,58 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_9genexpr24__pyx_v_j, Py_True}; __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1613, __pyx_L12_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1666, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } if (likely(PyList_CheckExact(__pyx_t_12)) || PyTuple_CheckExact(__pyx_t_12)) { __pyx_t_14 = __pyx_t_12; __Pyx_INCREF(__pyx_t_14); - __pyx_t_21 = 0; - __pyx_t_22 = NULL; + __pyx_t_22 = 0; + __pyx_t_23 = NULL; } else { - __pyx_t_21 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1613, __pyx_L12_error) + __pyx_t_22 = -1; __pyx_t_14 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1666, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_14); - __pyx_t_22 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1613, __pyx_L12_error) + __pyx_t_23 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1666, __pyx_L17_error) } __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; for (;;) { - if (likely(!__pyx_t_22)) { + if (likely(!__pyx_t_23)) { if (likely(PyList_CheckExact(__pyx_t_14))) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_14); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1613, __pyx_L12_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1666, __pyx_L17_error) #endif - if (__pyx_t_21 >= __pyx_temp) break; + if (__pyx_t_22 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_12 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_21); __Pyx_INCREF(__pyx_t_12); __pyx_t_21++; if (unlikely((0 < 0))) __PYX_ERR(0, 1613, __pyx_L12_error) + __pyx_t_12 = PyList_GET_ITEM(__pyx_t_14, __pyx_t_22); __Pyx_INCREF(__pyx_t_12); __pyx_t_22++; if (unlikely((0 < 0))) __PYX_ERR(0, 1666, __pyx_L17_error) #else - __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_14, __pyx_t_21); __pyx_t_21++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1613, __pyx_L12_error) + __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_14, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1666, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_12); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_14); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1613, __pyx_L12_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1666, __pyx_L17_error) #endif - if (__pyx_t_21 >= __pyx_temp) break; + if (__pyx_t_22 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_21); __Pyx_INCREF(__pyx_t_12); __pyx_t_21++; if (unlikely((0 < 0))) __PYX_ERR(0, 1613, __pyx_L12_error) + __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_14, __pyx_t_22); __Pyx_INCREF(__pyx_t_12); __pyx_t_22++; if (unlikely((0 < 0))) __PYX_ERR(0, 1666, __pyx_L17_error) #else - __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_14, __pyx_t_21); __pyx_t_21++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1613, __pyx_L12_error) + __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_14, __pyx_t_22); __pyx_t_22++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1666, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_12); #endif } } else { - __pyx_t_12 = __pyx_t_22(__pyx_t_14); + __pyx_t_12 = __pyx_t_23(__pyx_t_14); if (unlikely(!__pyx_t_12)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1613, __pyx_L12_error) + else __PYX_ERR(0, 1666, __pyx_L17_error) } break; } @@ -53639,15 +56377,15 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS } __Pyx_XDECREF_SET(__pyx_9genexpr24__pyx_v_i, __pyx_t_12); __pyx_t_12 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_Point); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1613, __pyx_L12_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_Point); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1666, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_9 = __Pyx_PySequence_Tuple(__pyx_9genexpr24__pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1613, __pyx_L12_error) + __pyx_t_9 = __Pyx_PySequence_Tuple(__pyx_9genexpr24__pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1666, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1613, __pyx_L12_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1666, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1613, __pyx_L12_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1666, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -53668,14 +56406,14 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_mvement}; __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1613, __pyx_L12_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1666, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } - __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1613, __pyx_L12_error) + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1666, __pyx_L17_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__pyx_t_17) { - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr24__pyx_v_i))) __PYX_ERR(0, 1613, __pyx_L12_error) + if (__pyx_t_18) { + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr24__pyx_v_i))) __PYX_ERR(0, 1666, __pyx_L17_error) } } __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; @@ -53683,39 +56421,39 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_i); __pyx_9genexpr24__pyx_v_i = 0; __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_j); __pyx_9genexpr24__pyx_v_j = 0; - goto __pyx_L20_exit_scope; - __pyx_L12_error:; + goto __pyx_L25_exit_scope; + __pyx_L17_error:; __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_i); __pyx_9genexpr24__pyx_v_i = 0; __Pyx_XDECREF(__pyx_9genexpr24__pyx_v_j); __pyx_9genexpr24__pyx_v_j = 0; goto __pyx_L1_error; - __pyx_L20_exit_scope:; + __pyx_L25_exit_scope:; } /* exit inner scope */ __pyx_t_13 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_1); if (likely(__pyx_t_13)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); + __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_2}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1613, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1666, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1614 + /* "collisions.py":1667 * if cs != []: * cs.extend([i for j in [mvement[0], mvement[2]] for i in o.closestPointTo(j, True) if Point(*i).collides(mvement)]) * points.extend(list(zip(cs, [o for _ in range(len(cs))]))) # <<<<<<<<<<<<<< @@ -53723,115 +56461,110 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS * closestP = points[0][0] */ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1614, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_20 = PyObject_Length(__pyx_v_cs); if (unlikely(__pyx_t_20 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1614, __pyx_L1_error) - __pyx_t_21 = __pyx_t_20; - for (__pyx_t_23 = 0; __pyx_t_23 < __pyx_t_21; __pyx_t_23+=1) { - __pyx_9genexpr25__pyx_v__ = __pyx_t_23; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_v_o))) __PYX_ERR(0, 1614, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1667, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_21 = PyObject_Length(__pyx_v_cs); if (unlikely(__pyx_t_21 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1667, __pyx_L1_error) + __pyx_t_22 = __pyx_t_21; + for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_22; __pyx_t_24+=1) { + __pyx_9genexpr25__pyx_v__ = __pyx_t_24; + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_v_o))) __PYX_ERR(0, 1667, __pyx_L1_error) } } /* exit inner scope */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1614, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1667, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_cs); __Pyx_GIVEREF(__pyx_v_cs); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_cs)) __PYX_ERR(0, 1614, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 1614, __pyx_L1_error); - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1614, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PySequence_ListKeepNew(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1614, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cs)) __PYX_ERR(0, 1667, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 1667, __pyx_L1_error); + __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1667, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_24 = __Pyx_PyList_Extend(__pyx_v_points, __pyx_t_3); if (unlikely(__pyx_t_24 == ((int)-1))) __PYX_ERR(0, 1614, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ListKeepNew(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1667, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_25 = __Pyx_PyList_Extend(__pyx_v_points, __pyx_t_1); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 1667, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":1612 - * for o in objs: - * cs = o.whereCollides(mvement) + /* "collisions.py":1665 + * else: + * cs = o.whereCollides(mvement) * if cs != []: # <<<<<<<<<<<<<< * cs.extend([i for j in [mvement[0], mvement[2]] for i in o.closestPointTo(j, True) if Point(*i).collides(mvement)]) * points.extend(list(zip(cs, [o for _ in range(len(cs))]))) */ } - /* "collisions.py":1610 + /* "collisions.py":1660 * return newCir, vel * points = [] * for o in objs: # <<<<<<<<<<<<<< - * cs = o.whereCollides(mvement) - * if cs != []: + * if mvement.isContaining(o): + * cs = o.toPoints() */ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":1615 + /* "collisions.py":1668 * cs.extend([i for j in [mvement[0], mvement[2]] for i in o.closestPointTo(j, True) if Point(*i).collides(mvement)]) * points.extend(list(zip(cs, [o for _ in range(len(cs))]))) * points.sort(key=lambda x: abs(x[0][0]-oldCir[0])**2+abs(x[0][1]-oldCir[1])**2) # <<<<<<<<<<<<<< * closestP = points[0][0] - * closestObj = points[0][1] + * if checkShpType(points[0][1], ShpGroups.SPLITTABLE): */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_points, __pyx_n_s_sort); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1615, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_points, __pyx_n_s_sort); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_19handleCollisionsPos_lambda16, 0, __pyx_n_s_Circle_handleCollisionsPos_local, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1615, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_key, __pyx_t_1) < 0) __PYX_ERR(0, 1615, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1615, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_19handleCollisionsPos_2lambda16, 0, __pyx_n_s_Circle_handleCollisionsPos_local, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_t_3) < 0) __PYX_ERR(0, 1668, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1668, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1616 + /* "collisions.py":1669 * points.extend(list(zip(cs, [o for _ in range(len(cs))]))) * points.sort(key=lambda x: abs(x[0][0]-oldCir[0])**2+abs(x[0][1]-oldCir[1])**2) * closestP = points[0][0] # <<<<<<<<<<<<<< - * closestObj = points[0][1] - * t = closestObj.tangent(closestP, vel) - */ - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_points, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1616, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1616, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_closestP = __pyx_t_3; - __pyx_t_3 = 0; - - /* "collisions.py":1617 - * points.sort(key=lambda x: abs(x[0][0]-oldCir[0])**2+abs(x[0][1]-oldCir[1])**2) - * closestP = points[0][0] - * closestObj = points[0][1] # <<<<<<<<<<<<<< - * t = closestObj.tangent(closestP, vel) - * normal = t-90 + * if checkShpType(points[0][1], ShpGroups.SPLITTABLE): + * lns = [] */ - __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_points, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1617, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_points, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1617, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_closestObj = __pyx_t_1; + __pyx_v_closestP = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":1618 + /* "collisions.py":1670 + * points.sort(key=lambda x: abs(x[0][0]-oldCir[0])**2+abs(x[0][1]-oldCir[1])**2) * closestP = points[0][0] - * closestObj = points[0][1] - * t = closestObj.tangent(closestP, vel) # <<<<<<<<<<<<<< - * normal = t-90 - * cpoMvemnt = Line((oldCir.x + oldCir.r * math.cos(velphi-math.pi), oldCir.y + oldCir.r * math.sin(velphi-math.pi)), + * if checkShpType(points[0][1], ShpGroups.SPLITTABLE): # <<<<<<<<<<<<<< + * lns = [] + * collP = Point(*closestP) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_tangent); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1618, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_points, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1670, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1670, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1670, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_SPLITTABLE); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1670, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_3))) { + if (unlikely(PyMethod_Check(__pyx_t_3))) { __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); if (likely(__pyx_t_4)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); @@ -53843,804 +56576,1002 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_closestP, __pyx_v_vel}; + PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_2, __pyx_t_13}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1618, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1670, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_v_t = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1670, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__pyx_t_18) { - /* "collisions.py":1619 - * closestObj = points[0][1] - * t = closestObj.tangent(closestP, vel) - * normal = t-90 # <<<<<<<<<<<<<< - * cpoMvemnt = Line((oldCir.x + oldCir.r * math.cos(velphi-math.pi), oldCir.y + oldCir.r * math.sin(velphi-math.pi)), - * (newCir.x + newCir.r * math.cos(velphi), newCir.y + newCir.r * math.sin(velphi)) + /* "collisions.py":1671 + * closestP = points[0][0] + * if checkShpType(points[0][1], ShpGroups.SPLITTABLE): + * lns = [] # <<<<<<<<<<<<<< + * collP = Point(*closestP) + * factor = 1/(10**precision) */ - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_t, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1619, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_v_normal = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1671, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_lns = ((PyObject*)__pyx_t_1); + __pyx_t_1 = 0; - /* "collisions.py":1620 - * t = closestObj.tangent(closestP, vel) - * normal = t-90 - * cpoMvemnt = Line((oldCir.x + oldCir.r * math.cos(velphi-math.pi), oldCir.y + oldCir.r * math.sin(velphi-math.pi)), # <<<<<<<<<<<<<< - * (newCir.x + newCir.r * math.cos(velphi), newCir.y + newCir.r * math.sin(velphi)) - * ).closestPointTo(Point(*closestP)) + /* "collisions.py":1672 + * if checkShpType(points[0][1], ShpGroups.SPLITTABLE): + * lns = [] + * collP = Point(*closestP) # <<<<<<<<<<<<<< + * factor = 1/(10**precision) + * for ln in points[0][1].toLines(): */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Line); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_r); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_math); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_cos); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_math); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_pi); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyNumber_Subtract(__pyx_v_velphi, __pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - __pyx_t_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_12}; - __pyx_t_14 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __pyx_t_9 = PyNumber_Multiply(__pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyNumber_Add(__pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_y); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_math); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_sin); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_math); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_pi); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyNumber_Subtract(__pyx_v_velphi, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_12}; - __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1620, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Point); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1672, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_v_closestP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1672, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - } - __pyx_t_5 = PyNumber_Multiply(__pyx_t_2, __pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = PyNumber_Add(__pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GIVEREF(__pyx_t_14); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_14)) __PYX_ERR(0, 1620, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_13); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_13)) __PYX_ERR(0, 1620, __pyx_L1_error); - __pyx_t_14 = 0; - __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_collP = __pyx_t_13; + __pyx_t_13 = 0; - /* "collisions.py":1621 - * normal = t-90 - * cpoMvemnt = Line((oldCir.x + oldCir.r * math.cos(velphi-math.pi), oldCir.y + oldCir.r * math.sin(velphi-math.pi)), - * (newCir.x + newCir.r * math.cos(velphi), newCir.y + newCir.r * math.sin(velphi)) # <<<<<<<<<<<<<< - * ).closestPointTo(Point(*closestP)) - * dist_left = ( + /* "collisions.py":1673 + * lns = [] + * collP = Point(*closestP) + * factor = 1/(10**precision) # <<<<<<<<<<<<<< + * for ln in points[0][1].toLines(): + * p = ln.closestPointTo(collP) */ - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_newCir, __pyx_n_s_x); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1621, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_newCir, __pyx_n_s_r); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1621, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1621, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_cos); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1621, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_12); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_12, function); - __pyx_t_6 = 1; + __pyx_t_13 = PyNumber_Power(__pyx_int_10, __pyx_v_precision, Py_None); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1673, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_int_1, __pyx_t_13); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1673, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_v_factor = __pyx_t_3; + __pyx_t_3 = 0; + + /* "collisions.py":1674 + * collP = Point(*closestP) + * factor = 1/(10**precision) + * for ln in points[0][1].toLines(): # <<<<<<<<<<<<<< + * p = ln.closestPointTo(collP) + * if math.hypot(p[0]-closestP[0], p[1]-closestP[1]) < factor: + */ + __pyx_t_13 = __Pyx_GetItemInt_List(__pyx_v_points, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_13, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_toLines); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_13); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_13, function); + __pyx_t_6 = 1; + } } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_velphi}; - __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1621, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - } - __pyx_t_12 = PyNumber_Multiply(__pyx_t_14, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1621, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Add(__pyx_t_13, __pyx_t_12); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1621, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_newCir, __pyx_n_s_y); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1621, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_newCir, __pyx_n_s_r); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1621, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1621, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sin); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1621, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_11))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_11); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_11, function); - __pyx_t_6 = 1; + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_velphi}; - __pyx_t_14 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1621, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - } - __pyx_t_11 = PyNumber_Multiply(__pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1621, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyNumber_Add(__pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1621, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1621, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9)) __PYX_ERR(0, 1621, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_14); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_14)) __PYX_ERR(0, 1621, __pyx_L1_error); - __pyx_t_9 = 0; - __pyx_t_14 = 0; - __pyx_t_14 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_14); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; + if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { + __pyx_t_13 = __pyx_t_3; __Pyx_INCREF(__pyx_t_13); + __pyx_t_19 = 0; + __pyx_t_20 = NULL; + } else { + __pyx_t_19 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_20 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_13); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1674, __pyx_L1_error) } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_t_5, __pyx_t_11}; - __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1620, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + for (;;) { + if (likely(!__pyx_t_20)) { + if (likely(PyList_CheckExact(__pyx_t_13))) { + { + Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_13); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1674, __pyx_L1_error) + #endif + if (__pyx_t_19 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_19); __Pyx_INCREF(__pyx_t_3); __pyx_t_19++; if (unlikely((0 < 0))) __PYX_ERR(0, 1674, __pyx_L1_error) + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_13, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } else { + { + Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_13); + #if !CYTHON_ASSUME_SAFE_MACROS + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1674, __pyx_L1_error) + #endif + if (__pyx_t_19 >= __pyx_temp) break; + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_19); __Pyx_INCREF(__pyx_t_3); __pyx_t_19++; if (unlikely((0 < 0))) __PYX_ERR(0, 1674, __pyx_L1_error) + #else + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_13, __pyx_t_19); __pyx_t_19++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + } + } else { + __pyx_t_3 = __pyx_t_20(__pyx_t_13); + if (unlikely(!__pyx_t_3)) { + PyObject* exc_type = PyErr_Occurred(); + if (exc_type) { + if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); + else __PYX_ERR(0, 1674, __pyx_L1_error) + } + break; + } + __Pyx_GOTREF(__pyx_t_3); + } + __Pyx_XDECREF_SET(__pyx_v_ln, __pyx_t_3); + __pyx_t_3 = 0; - /* "collisions.py":1622 - * cpoMvemnt = Line((oldCir.x + oldCir.r * math.cos(velphi-math.pi), oldCir.y + oldCir.r * math.sin(velphi-math.pi)), - * (newCir.x + newCir.r * math.cos(velphi), newCir.y + newCir.r * math.sin(velphi)) - * ).closestPointTo(Point(*closestP)) # <<<<<<<<<<<<<< - * dist_left = ( - * math.hypot(oldCir[0]-cpoMvemnt[0], oldCir[1]-cpoMvemnt[1]) - \ + /* "collisions.py":1675 + * factor = 1/(10**precision) + * for ln in points[0][1].toLines(): + * p = ln.closestPointTo(collP) # <<<<<<<<<<<<<< + * if math.hypot(p[0]-closestP[0], p[1]-closestP[1]) < factor: + * lns.append(ln) */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1622, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1622, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PySequence_Tuple(__pyx_v_closestP); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1622, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1622, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - __pyx_t_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_t_5}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1622, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - } - __pyx_v_cpoMvemnt = __pyx_t_1; - __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_collP}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_3); + __pyx_t_3 = 0; - /* "collisions.py":1624 - * ).closestPointTo(Point(*closestP)) - * dist_left = ( - * math.hypot(oldCir[0]-cpoMvemnt[0], oldCir[1]-cpoMvemnt[1]) - \ # <<<<<<<<<<<<<< - * math.sqrt(round(newCir.r**2, precision)-( # math.sqrt(max(0, newCir.r**2 - ((cpoMvemnt[0] - closestP[0])**2 + (cpoMvemnt[1] - closestP[1])**2)))???? - * round(math.hypot(cpoMvemnt[0]-closestP[0], cpoMvemnt[1]-closestP[1]), precision) + /* "collisions.py":1676 + * for ln in points[0][1].toLines(): + * p = ln.closestPointTo(collP) + * if math.hypot(p[0]-closestP[0], p[1]-closestP[1]) < factor: # <<<<<<<<<<<<<< + * lns.append(ln) + * closestObj = Shapes(*lns) + */ + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1676, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_hypot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1676, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1676, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1676, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_14 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1676, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1676, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1676, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_12 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1676, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_14, __pyx_t_12}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1676, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_v_factor, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1676, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1676, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_18) { + + /* "collisions.py":1677 + * p = ln.closestPointTo(collP) + * if math.hypot(p[0]-closestP[0], p[1]-closestP[1]) < factor: + * lns.append(ln) # <<<<<<<<<<<<<< + * closestObj = Shapes(*lns) + * else: + */ + __pyx_t_25 = __Pyx_PyList_Append(__pyx_v_lns, __pyx_v_ln); if (unlikely(__pyx_t_25 == ((int)-1))) __PYX_ERR(0, 1677, __pyx_L1_error) + + /* "collisions.py":1676 + * for ln in points[0][1].toLines(): + * p = ln.closestPointTo(collP) + * if math.hypot(p[0]-closestP[0], p[1]-closestP[1]) < factor: # <<<<<<<<<<<<<< + * lns.append(ln) + * closestObj = Shapes(*lns) + */ + } + + /* "collisions.py":1674 + * collP = Point(*closestP) + * factor = 1/(10**precision) + * for ln in points[0][1].toLines(): # <<<<<<<<<<<<<< + * p = ln.closestPointTo(collP) + * if math.hypot(p[0]-closestP[0], p[1]-closestP[1]) < factor: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1624, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_hypot); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1624, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_oldCir, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1624, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_cpoMvemnt, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1624, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1624, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_oldCir, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1624, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_cpoMvemnt, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1624, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_14 = PyNumber_Subtract(__pyx_t_11, __pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1624, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); - __pyx_t_6 = 1; } + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + + /* "collisions.py":1678 + * if math.hypot(p[0]-closestP[0], p[1]-closestP[1]) < factor: + * lns.append(ln) + * closestObj = Shapes(*lns) # <<<<<<<<<<<<<< + * else: + * closestObj = points[0][1] + */ + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1678, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_2 = PySequence_Tuple(__pyx_v_lns); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1678, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1678, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_GIVEREF(__pyx_t_3); + __pyx_cur_scope->__pyx_v_closestObj = __pyx_t_3; + __pyx_t_3 = 0; + + /* "collisions.py":1670 + * points.sort(key=lambda x: abs(x[0][0]-oldCir[0])**2+abs(x[0][1]-oldCir[1])**2) + * closestP = points[0][0] + * if checkShpType(points[0][1], ShpGroups.SPLITTABLE): # <<<<<<<<<<<<<< + * lns = [] + * collP = Point(*closestP) + */ + goto __pyx_L29; } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_3, __pyx_t_14}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + + /* "collisions.py":1680 + * closestObj = Shapes(*lns) + * else: + * closestObj = points[0][1] # <<<<<<<<<<<<<< + * def calculate(point): + * cpoMvemnt = Line((oldCir.x + oldCir.r * math.cos(velphi-math.pi), oldCir.y + oldCir.r * math.sin(velphi-math.pi)), + */ + /*else*/ { + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_points, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1680, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1624, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_2); + __pyx_cur_scope->__pyx_v_closestObj = __pyx_t_2; + __pyx_t_2 = 0; } + __pyx_L29:; - /* "collisions.py":1625 - * dist_left = ( - * math.hypot(oldCir[0]-cpoMvemnt[0], oldCir[1]-cpoMvemnt[1]) - \ - * math.sqrt(round(newCir.r**2, precision)-( # math.sqrt(max(0, newCir.r**2 - ((cpoMvemnt[0] - closestP[0])**2 + (cpoMvemnt[1] - closestP[1])**2)))???? # <<<<<<<<<<<<<< - * round(math.hypot(cpoMvemnt[0]-closestP[0], cpoMvemnt[1]-closestP[1]), precision) - * ) + /* "collisions.py":1681 + * else: + * closestObj = points[0][1] + * def calculate(point): # <<<<<<<<<<<<<< + * cpoMvemnt = Line((oldCir.x + oldCir.r * math.cos(velphi-math.pi), oldCir.y + oldCir.r * math.sin(velphi-math.pi)), + * (newCir.x + newCir.r * math.cos(velphi), newCir.y + newCir.r * math.sin(velphi)) */ - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_math); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1625, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1625, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_newCir, __pyx_n_s_r); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1625, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_4 = PyNumber_Power(__pyx_t_14, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1625, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1625, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_4)) __PYX_ERR(0, 1625, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_precision); - __Pyx_GIVEREF(__pyx_v_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_v_precision)) __PYX_ERR(0, 1625, __pyx_L1_error); - __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_14, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1625, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_19handleCollisionsPos_1calculate, 0, __pyx_n_s_Circle_handleCollisionsPos_local_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1681, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_calculate = __pyx_t_2; + __pyx_t_2 = 0; - /* "collisions.py":1626 - * math.hypot(oldCir[0]-cpoMvemnt[0], oldCir[1]-cpoMvemnt[1]) - \ - * math.sqrt(round(newCir.r**2, precision)-( # math.sqrt(max(0, newCir.r**2 - ((cpoMvemnt[0] - closestP[0])**2 + (cpoMvemnt[1] - closestP[1])**2)))???? - * round(math.hypot(cpoMvemnt[0]-closestP[0], cpoMvemnt[1]-closestP[1]), precision) # <<<<<<<<<<<<<< - * ) - * ) + /* "collisions.py":1694 + * ThisClosestP = (oldCir.x + dist_to * math.cos(velphi), oldCir.y + dist_to * math.sin(velphi)) + * return ThisClosestP, dist_left + * ThisClosestP, dist_left = calculate(closestP) # <<<<<<<<<<<<<< + * tries = 0 + * while tries < maxTries: */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_math); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_hypot); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_cpoMvemnt, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_13 = PyNumber_Subtract(__pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_cpoMvemnt, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1626, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_10collisions_6Circle_19handleCollisionsPos_calculate(__pyx_v_calculate, __pyx_v_closestP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1694, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_9))) { - __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_9); - if (likely(__pyx_t_11)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9); - __Pyx_INCREF(__pyx_t_11); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_9, function); - __pyx_t_6 = 1; + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 1694, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_13 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_3 = PyList_GET_ITEM(sequence, 0); + __pyx_t_13 = PyList_GET_ITEM(sequence, 1); } + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(__pyx_t_13); + #else + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1694, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_13 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1694, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1694, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_26 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); + index = 0; __pyx_t_3 = __pyx_t_26(__pyx_t_12); if (unlikely(!__pyx_t_3)) goto __pyx_L34_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + index = 1; __pyx_t_13 = __pyx_t_26(__pyx_t_12); if (unlikely(!__pyx_t_13)) goto __pyx_L34_unpacking_failed; + __Pyx_GOTREF(__pyx_t_13); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_26(__pyx_t_12), 2) < 0) __PYX_ERR(0, 1694, __pyx_L1_error) + __pyx_t_26 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L35_unpacking_done; + __pyx_L34_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_26 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 1694, __pyx_L1_error) + __pyx_L35_unpacking_done:; } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_13, __pyx_t_2}; - __pyx_t_14 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_v_ThisClosestP = __pyx_t_3; + __pyx_t_3 = 0; + __pyx_v_dist_left = __pyx_t_13; + __pyx_t_13 = 0; + + /* "collisions.py":1695 + * return ThisClosestP, dist_left + * ThisClosestP, dist_left = calculate(closestP) + * tries = 0 # <<<<<<<<<<<<<< + * while tries < maxTries: + * closestP = closestObj.closestPointTo(Point(ThisClosestP[0], ThisClosestP[1])) + */ + __Pyx_INCREF(__pyx_int_0); + __pyx_v_tries = __pyx_int_0; + + /* "collisions.py":1696 + * ThisClosestP, dist_left = calculate(closestP) + * tries = 0 + * while tries < maxTries: # <<<<<<<<<<<<<< + * closestP = closestObj.closestPointTo(Point(ThisClosestP[0], ThisClosestP[1])) + * ThisClosestP, dist_left = calculate(closestP) + */ + while (1) { + __pyx_t_2 = PyObject_RichCompare(__pyx_v_tries, __pyx_v_maxTries, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1696, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1696, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1626, __pyx_L1_error) + if (!__pyx_t_18) break; + + /* "collisions.py":1697 + * tries = 0 + * while tries < maxTries: + * closestP = closestObj.closestPointTo(Point(ThisClosestP[0], ThisClosestP[1])) # <<<<<<<<<<<<<< + * ThisClosestP, dist_left = calculate(closestP) + * ps = Circle(ThisClosestP[0], ThisClosestP[1], newCir.r).whereCollides(closestObj) + */ + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_closestObj, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1697, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_Point); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1697, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_ThisClosestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1697, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - } - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_14); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_14)) __PYX_ERR(0, 1626, __pyx_L1_error); - __Pyx_INCREF(__pyx_v_precision); - __Pyx_GIVEREF(__pyx_v_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_precision)) __PYX_ERR(0, 1626, __pyx_L1_error); - __pyx_t_14 = 0; - __pyx_t_14 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_9, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ThisClosestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1697, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_12); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_12, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_t_14, __pyx_t_1}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1697, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + __pyx_t_12 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_13); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_13, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1697, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } + __Pyx_DECREF_SET(__pyx_v_closestP, __pyx_t_2); + __pyx_t_2 = 0; - /* "collisions.py":1625 - * dist_left = ( - * math.hypot(oldCir[0]-cpoMvemnt[0], oldCir[1]-cpoMvemnt[1]) - \ - * math.sqrt(round(newCir.r**2, precision)-( # math.sqrt(max(0, newCir.r**2 - ((cpoMvemnt[0] - closestP[0])**2 + (cpoMvemnt[1] - closestP[1])**2)))???? # <<<<<<<<<<<<<< - * round(math.hypot(cpoMvemnt[0]-closestP[0], cpoMvemnt[1]-closestP[1]), precision) - * ) + /* "collisions.py":1698 + * while tries < maxTries: + * closestP = closestObj.closestPointTo(Point(ThisClosestP[0], ThisClosestP[1])) + * ThisClosestP, dist_left = calculate(closestP) # <<<<<<<<<<<<<< + * ps = Circle(ThisClosestP[0], ThisClosestP[1], newCir.r).whereCollides(closestObj) + * if len(ps) < 2: */ - __pyx_t_9 = PyNumber_Subtract(__pyx_t_4, __pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1625, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_14); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_6 = 1; + __pyx_t_2 = __pyx_pf_10collisions_6Circle_19handleCollisionsPos_calculate(__pyx_v_calculate, __pyx_v_closestP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { + PyObject* sequence = __pyx_t_2; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 1698, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_13 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_13 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_13); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_13 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_12 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1698, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_26 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); + index = 0; __pyx_t_13 = __pyx_t_26(__pyx_t_12); if (unlikely(!__pyx_t_13)) goto __pyx_L38_unpacking_failed; + __Pyx_GOTREF(__pyx_t_13); + index = 1; __pyx_t_3 = __pyx_t_26(__pyx_t_12); if (unlikely(!__pyx_t_3)) goto __pyx_L38_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_26(__pyx_t_12), 2) < 0) __PYX_ERR(0, 1698, __pyx_L1_error) + __pyx_t_26 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + goto __pyx_L39_unpacking_done; + __pyx_L38_unpacking_failed:; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_26 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 1698, __pyx_L1_error) + __pyx_L39_unpacking_done:; } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_14, __pyx_t_9}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1625, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF_SET(__pyx_v_ThisClosestP, __pyx_t_13); + __pyx_t_13 = 0; + __Pyx_DECREF_SET(__pyx_v_dist_left, __pyx_t_3); + __pyx_t_3 = 0; + + /* "collisions.py":1699 + * closestP = closestObj.closestPointTo(Point(ThisClosestP[0], ThisClosestP[1])) + * ThisClosestP, dist_left = calculate(closestP) + * ps = Circle(ThisClosestP[0], ThisClosestP[1], newCir.r).whereCollides(closestObj) # <<<<<<<<<<<<<< + * if len(ps) < 2: + * break + */ + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_Circle); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1699, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_ThisClosestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1699, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ThisClosestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1699, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_newCir, __pyx_n_s_r); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1699, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_4 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_4); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_13, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[4] = {__pyx_t_4, __pyx_t_12, __pyx_t_1, __pyx_t_14}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1699, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1699, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - } + __pyx_t_3 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (likely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_13); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_3); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_13, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_closestObj}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1699, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_ps, __pyx_t_2); + __pyx_t_2 = 0; - /* "collisions.py":1624 - * ).closestPointTo(Point(*closestP)) - * dist_left = ( - * math.hypot(oldCir[0]-cpoMvemnt[0], oldCir[1]-cpoMvemnt[1]) - \ # <<<<<<<<<<<<<< - * math.sqrt(round(newCir.r**2, precision)-( # math.sqrt(max(0, newCir.r**2 - ((cpoMvemnt[0] - closestP[0])**2 + (cpoMvemnt[1] - closestP[1])**2)))???? - * round(math.hypot(cpoMvemnt[0]-closestP[0], cpoMvemnt[1]-closestP[1]), precision) + /* "collisions.py":1700 + * ThisClosestP, dist_left = calculate(closestP) + * ps = Circle(ThisClosestP[0], ThisClosestP[1], newCir.r).whereCollides(closestObj) + * if len(ps) < 2: # <<<<<<<<<<<<<< + * break + * xs, ys = zip(*ps) */ - __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1624, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_19 = PyObject_Length(__pyx_v_ps); if (unlikely(__pyx_t_19 == ((Py_ssize_t)-1))) __PYX_ERR(0, 1700, __pyx_L1_error) + __pyx_t_18 = (__pyx_t_19 < 2); + if (__pyx_t_18) { - /* "collisions.py":1629 - * ) - * ) - * ) * closestObj.bounciness # <<<<<<<<<<<<<< - * dist_to = math.hypot(vel[0], vel[1])-dist_left - * if dist_left == 0: + /* "collisions.py":1701 + * ps = Circle(ThisClosestP[0], ThisClosestP[1], newCir.r).whereCollides(closestObj) + * if len(ps) < 2: + * break # <<<<<<<<<<<<<< + * xs, ys = zip(*ps) + * diff = math.hypot(max(xs)-min(xs),(max(ys)-min(ys))**2) */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1629, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1629, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_dist_left = __pyx_t_1; - __pyx_t_1 = 0; + goto __pyx_L37_break; - /* "collisions.py":1630 - * ) - * ) * closestObj.bounciness - * dist_to = math.hypot(vel[0], vel[1])-dist_left # <<<<<<<<<<<<<< - * if dist_left == 0: - * if verbose: + /* "collisions.py":1700 + * ThisClosestP, dist_left = calculate(closestP) + * ps = Circle(ThisClosestP[0], ThisClosestP[1], newCir.r).whereCollides(closestObj) + * if len(ps) < 2: # <<<<<<<<<<<<<< + * break + * xs, ys = zip(*ps) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1630, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_hypot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1630, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1630, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1630, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_14 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_14); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_3, function); - __pyx_t_6 = 1; } - } - #endif - { - PyObject *__pyx_callargs[3] = {__pyx_t_14, __pyx_t_5, __pyx_t_9}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1630, __pyx_L1_error) + + /* "collisions.py":1702 + * if len(ps) < 2: + * break + * xs, ys = zip(*ps) # <<<<<<<<<<<<<< + * diff = math.hypot(max(xs)-min(xs),(max(ys)-min(ys))**2) + * if diff < AVERYSMALLNUMBER/2: # It needs to be able to get back out + */ + __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_ps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1702, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_13 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_2, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1702, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if ((likely(PyTuple_CheckExact(__pyx_t_13))) || (PyList_CheckExact(__pyx_t_13))) { + PyObject* sequence = __pyx_t_13; + Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); + if (unlikely(size != 2)) { + if (size > 2) __Pyx_RaiseTooManyValuesError(2); + else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); + __PYX_ERR(0, 1702, __pyx_L1_error) + } + #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + if (likely(PyTuple_CheckExact(sequence))) { + __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); + } else { + __pyx_t_2 = PyList_GET_ITEM(sequence, 0); + __pyx_t_3 = PyList_GET_ITEM(sequence, 1); + } + __Pyx_INCREF(__pyx_t_2); + __Pyx_INCREF(__pyx_t_3); + #else + __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1702, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1702, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + #endif + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + } else { + Py_ssize_t index = -1; + __pyx_t_14 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1702, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_26 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_14); + index = 0; __pyx_t_2 = __pyx_t_26(__pyx_t_14); if (unlikely(!__pyx_t_2)) goto __pyx_L41_unpacking_failed; + __Pyx_GOTREF(__pyx_t_2); + index = 1; __pyx_t_3 = __pyx_t_26(__pyx_t_14); if (unlikely(!__pyx_t_3)) goto __pyx_L41_unpacking_failed; + __Pyx_GOTREF(__pyx_t_3); + if (__Pyx_IternextUnpackEndCheck(__pyx_t_26(__pyx_t_14), 2) < 0) __PYX_ERR(0, 1702, __pyx_L1_error) + __pyx_t_26 = NULL; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + goto __pyx_L42_unpacking_done; + __pyx_L41_unpacking_failed:; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_26 = NULL; + if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); + __PYX_ERR(0, 1702, __pyx_L1_error) + __pyx_L42_unpacking_done:; + } + __Pyx_XDECREF_SET(__pyx_v_xs, __pyx_t_2); + __pyx_t_2 = 0; + __Pyx_XDECREF_SET(__pyx_v_ys, __pyx_t_3); + __pyx_t_3 = 0; + + /* "collisions.py":1703 + * break + * xs, ys = zip(*ps) + * diff = math.hypot(max(xs)-min(xs),(max(ys)-min(ys))**2) # <<<<<<<<<<<<<< + * if diff < AVERYSMALLNUMBER/2: # It needs to be able to get back out + * break + */ + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_hypot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_v_xs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_v_xs); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1703, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_v_ys); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_v_ys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_12 = PyNumber_Subtract(__pyx_t_14, __pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PyNumber_Power(__pyx_t_12, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_12); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_2, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_1, __pyx_t_3}; + __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + } + __Pyx_XDECREF_SET(__pyx_v_diff, __pyx_t_13); + __pyx_t_13 = 0; + + /* "collisions.py":1704 + * xs, ys = zip(*ps) + * diff = math.hypot(max(xs)-min(xs),(max(ys)-min(ys))**2) + * if diff < AVERYSMALLNUMBER/2: # It needs to be able to get back out # <<<<<<<<<<<<<< + * break + * tries += 1 + */ + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_AVERYSMALLNUMBER); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1704, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_2 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_13, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1704, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyObject_RichCompare(__pyx_v_diff, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1704, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1704, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__pyx_t_18) { + + /* "collisions.py":1705 + * diff = math.hypot(max(xs)-min(xs),(max(ys)-min(ys))**2) + * if diff < AVERYSMALLNUMBER/2: # It needs to be able to get back out + * break # <<<<<<<<<<<<<< + * tries += 1 + * if dist_left <= 0: + */ + goto __pyx_L37_break; + + /* "collisions.py":1704 + * xs, ys = zip(*ps) + * diff = math.hypot(max(xs)-min(xs),(max(ys)-min(ys))**2) + * if diff < AVERYSMALLNUMBER/2: # It needs to be able to get back out # <<<<<<<<<<<<<< + * break + * tries += 1 + */ + } + + /* "collisions.py":1706 + * if diff < AVERYSMALLNUMBER/2: # It needs to be able to get back out + * break + * tries += 1 # <<<<<<<<<<<<<< + * if dist_left <= 0: + * if verbose: + */ + __pyx_t_13 = __Pyx_PyInt_AddObjC(__pyx_v_tries, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1706, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF_SET(__pyx_v_tries, __pyx_t_13); + __pyx_t_13 = 0; } - __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_v_dist_left); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1630, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_v_dist_to = __pyx_t_3; - __pyx_t_3 = 0; + __pyx_L37_break:; - /* "collisions.py":1631 - * ) * closestObj.bounciness - * dist_to = math.hypot(vel[0], vel[1])-dist_left - * if dist_left == 0: # <<<<<<<<<<<<<< + /* "collisions.py":1707 + * break + * tries += 1 + * if dist_left <= 0: # <<<<<<<<<<<<<< * if verbose: * return oldCir, [0, 0], [True] */ - __pyx_t_17 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_dist_left, __pyx_int_0, 0, 0)); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1631, __pyx_L1_error) - if (__pyx_t_17) { + __pyx_t_13 = PyObject_RichCompare(__pyx_v_dist_left, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1707, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1707, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__pyx_t_18) { - /* "collisions.py":1632 - * dist_to = math.hypot(vel[0], vel[1])-dist_left - * if dist_left == 0: + /* "collisions.py":1708 + * tries += 1 + * if dist_left <= 0: * if verbose: # <<<<<<<<<<<<<< * return oldCir, [0, 0], [True] * return oldCir, [0, 0] */ - __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1632, __pyx_L1_error) - if (__pyx_t_17) { + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1708, __pyx_L1_error) + if (__pyx_t_18) { - /* "collisions.py":1633 - * if dist_left == 0: + /* "collisions.py":1709 + * if dist_left <= 0: * if verbose: * return oldCir, [0, 0], [True] # <<<<<<<<<<<<<< * return oldCir, [0, 0] - * ThisClosestP = (oldCir.x + dist_to * math.cos(velphi), oldCir.y + dist_to * math.sin(velphi)) + * normal = math.degrees(direction(ThisClosestP, closestP))-90 */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1633, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); + __pyx_t_13 = PyList_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1709, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_0)) __PYX_ERR(0, 1633, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_13, 0, __pyx_int_0)) __PYX_ERR(0, 1709, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_0)) __PYX_ERR(0, 1633, __pyx_L1_error); - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1633, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_13, 1, __pyx_int_0)) __PYX_ERR(0, 1709, __pyx_L1_error); + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1709, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, Py_True)) __PYX_ERR(0, 1633, __pyx_L1_error); - __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1633, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, Py_True)) __PYX_ERR(0, 1709, __pyx_L1_error); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1709, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_oldCir); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_oldCir); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_cur_scope->__pyx_v_oldCir)) __PYX_ERR(0, 1633, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_3)) __PYX_ERR(0, 1633, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_1)) __PYX_ERR(0, 1633, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_oldCir)) __PYX_ERR(0, 1709, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_13); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_13)) __PYX_ERR(0, 1709, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(0, 1709, __pyx_L1_error); + __pyx_t_13 = 0; + __pyx_t_2 = 0; + __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = 0; - __pyx_r = ((PyObject*)__pyx_t_9); - __pyx_t_9 = 0; goto __pyx_L0; - /* "collisions.py":1632 - * dist_to = math.hypot(vel[0], vel[1])-dist_left - * if dist_left == 0: + /* "collisions.py":1708 + * tries += 1 + * if dist_left <= 0: * if verbose: # <<<<<<<<<<<<<< * return oldCir, [0, 0], [True] * return oldCir, [0, 0] */ } - /* "collisions.py":1634 + /* "collisions.py":1710 * if verbose: * return oldCir, [0, 0], [True] * return oldCir, [0, 0] # <<<<<<<<<<<<<< - * ThisClosestP = (oldCir.x + dist_to * math.cos(velphi), oldCir.y + dist_to * math.sin(velphi)) - * x, y = oldCir[0] - ThisClosestP[0], oldCir[1] - ThisClosestP[1] + * normal = math.degrees(direction(ThisClosestP, closestP))-90 + * phi = math.degrees(velphi)+90 */ __Pyx_XDECREF(__pyx_r); - __pyx_t_9 = PyList_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1634, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1710, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 0, __pyx_int_0)) __PYX_ERR(0, 1634, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_0)) __PYX_ERR(0, 1710, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 1, __pyx_int_0)) __PYX_ERR(0, 1634, __pyx_L1_error); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1634, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_0)) __PYX_ERR(0, 1710, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1710, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_oldCir); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_oldCir); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_oldCir)) __PYX_ERR(0, 1634, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_9)) __PYX_ERR(0, 1634, __pyx_L1_error); - __pyx_t_9 = 0; - __pyx_r = ((PyObject*)__pyx_t_1); - __pyx_t_1 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_oldCir)) __PYX_ERR(0, 1710, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_3); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3)) __PYX_ERR(0, 1710, __pyx_L1_error); + __pyx_t_3 = 0; + __pyx_r = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1631 - * ) * closestObj.bounciness - * dist_to = math.hypot(vel[0], vel[1])-dist_left - * if dist_left == 0: # <<<<<<<<<<<<<< + /* "collisions.py":1707 + * break + * tries += 1 + * if dist_left <= 0: # <<<<<<<<<<<<<< * if verbose: * return oldCir, [0, 0], [True] */ } - /* "collisions.py":1635 + /* "collisions.py":1711 * return oldCir, [0, 0], [True] * return oldCir, [0, 0] - * ThisClosestP = (oldCir.x + dist_to * math.cos(velphi), oldCir.y + dist_to * math.sin(velphi)) # <<<<<<<<<<<<<< - * x, y = oldCir[0] - ThisClosestP[0], oldCir[1] - ThisClosestP[1] - * phi = math.degrees(math.atan2(y, x))+90 + * normal = math.degrees(direction(ThisClosestP, closestP))-90 # <<<<<<<<<<<<<< + * phi = math.degrees(velphi)+90 + * diff = (phi-normal) % 360 */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1635, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_cos); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_degrees); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_direction); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_12 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_3); + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); + __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_velphi}; - __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_v_ThisClosestP, __pyx_v_closestP}; + __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_5 = PyNumber_Multiply(__pyx_v_dist_to, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyNumber_Add(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sin); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = NULL; + __pyx_t_1 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_14))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_14); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); - __Pyx_INCREF(__pyx_t_3); + if (unlikely(PyMethod_Check(__pyx_t_13))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_13); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13); + __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_14, function); + __Pyx_DECREF_SET(__pyx_t_13, function); __pyx_t_6 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_velphi}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_3}; + __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; } - __pyx_t_14 = PyNumber_Multiply(__pyx_v_dist_to, __pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_5, __pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1635, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_9)) __PYX_ERR(0, 1635, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_1)) __PYX_ERR(0, 1635, __pyx_L1_error); - __pyx_t_9 = 0; - __pyx_t_1 = 0; - __pyx_v_ThisClosestP = ((PyObject*)__pyx_t_14); - __pyx_t_14 = 0; + __pyx_t_13 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1711, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_normal = __pyx_t_13; + __pyx_t_13 = 0; - /* "collisions.py":1636 + /* "collisions.py":1712 * return oldCir, [0, 0] - * ThisClosestP = (oldCir.x + dist_to * math.cos(velphi), oldCir.y + dist_to * math.sin(velphi)) - * x, y = oldCir[0] - ThisClosestP[0], oldCir[1] - ThisClosestP[1] # <<<<<<<<<<<<<< - * phi = math.degrees(math.atan2(y, x))+90 - * diff = (phi-normal) % 360 - */ - __pyx_t_14 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_oldCir, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1636, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v_ThisClosestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1636, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = PyNumber_Subtract(__pyx_t_14, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1636, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_oldCir, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1636, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_14 = __Pyx_GetItemInt_Tuple(__pyx_v_ThisClosestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1636, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_5 = PyNumber_Subtract(__pyx_t_1, __pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1636, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_v_x = __pyx_t_9; - __pyx_t_9 = 0; - __pyx_v_y = __pyx_t_5; - __pyx_t_5 = 0; - - /* "collisions.py":1637 - * ThisClosestP = (oldCir.x + dist_to * math.cos(velphi), oldCir.y + dist_to * math.sin(velphi)) - * x, y = oldCir[0] - ThisClosestP[0], oldCir[1] - ThisClosestP[1] - * phi = math.degrees(math.atan2(y, x))+90 # <<<<<<<<<<<<<< + * normal = math.degrees(direction(ThisClosestP, closestP))-90 + * phi = math.degrees(velphi)+90 # <<<<<<<<<<<<<< * diff = (phi-normal) % 360 * if diff > 180: */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_math); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1637, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_degrees); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1637, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1637, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_atan2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1637, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_degrees); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = NULL; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS if (unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_1)) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; @@ -54648,533 +57579,585 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_y, __pyx_v_x}; - __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1637, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); + PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_velphi}; + __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_3 = NULL; - __pyx_t_6 = 0; - #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_14))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_14); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_14, function); - __pyx_t_6 = 1; - } - } - #endif - { - PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_9}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1637, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - } - __pyx_t_14 = __Pyx_PyInt_AddObjC(__pyx_t_5, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1637, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_v_phi = __pyx_t_14; - __pyx_t_14 = 0; + __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_13, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1712, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_v_phi = __pyx_t_3; + __pyx_t_3 = 0; - /* "collisions.py":1638 - * x, y = oldCir[0] - ThisClosestP[0], oldCir[1] - ThisClosestP[1] - * phi = math.degrees(math.atan2(y, x))+90 + /* "collisions.py":1713 + * normal = math.degrees(direction(ThisClosestP, closestP))-90 + * phi = math.degrees(velphi)+90 * diff = (phi-normal) % 360 # <<<<<<<<<<<<<< * if diff > 180: * diff = diff - 360 */ - __pyx_t_14 = PyNumber_Subtract(__pyx_v_phi, __pyx_v_normal); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1638, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_5 = __Pyx_PyInt_RemainderObjC(__pyx_t_14, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1638, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_v_diff = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_t_3 = PyNumber_Subtract(__pyx_v_phi, __pyx_v_normal); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1713, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_13 = __Pyx_PyInt_RemainderObjC(__pyx_t_3, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1713, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_diff, __pyx_t_13); + __pyx_t_13 = 0; - /* "collisions.py":1639 - * phi = math.degrees(math.atan2(y, x))+90 + /* "collisions.py":1714 + * phi = math.degrees(velphi)+90 * diff = (phi-normal) % 360 * if diff > 180: # <<<<<<<<<<<<<< * diff = diff - 360 - * pos = rotate(ThisClosestP, [ThisClosestP[0], ThisClosestP[1]+dist_left], phi-180-diff*2) + * pos = rotate(ThisClosestP, [ThisClosestP[0], ThisClosestP[1]+dist_left], normal-diff) */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_diff, __pyx_int_180, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1639, __pyx_L1_error) - __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1639, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__pyx_t_17) { + __pyx_t_13 = PyObject_RichCompare(__pyx_v_diff, __pyx_int_180, Py_GT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1714, __pyx_L1_error) + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1714, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + if (__pyx_t_18) { - /* "collisions.py":1640 + /* "collisions.py":1715 * diff = (phi-normal) % 360 * if diff > 180: * diff = diff - 360 # <<<<<<<<<<<<<< - * pos = rotate(ThisClosestP, [ThisClosestP[0], ThisClosestP[1]+dist_left], phi-180-diff*2) - * vel = list(rotateBy0(vel, 180-diff*2)) + * pos = rotate(ThisClosestP, [ThisClosestP[0], ThisClosestP[1]+dist_left], normal-diff) + * vel = rotateBy0(vel, 180-diff*2) */ - __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_diff, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1640, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF_SET(__pyx_v_diff, __pyx_t_5); - __pyx_t_5 = 0; + __pyx_t_13 = __Pyx_PyInt_SubtractObjC(__pyx_v_diff, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1715, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF_SET(__pyx_v_diff, __pyx_t_13); + __pyx_t_13 = 0; - /* "collisions.py":1639 - * phi = math.degrees(math.atan2(y, x))+90 + /* "collisions.py":1714 + * phi = math.degrees(velphi)+90 * diff = (phi-normal) % 360 * if diff > 180: # <<<<<<<<<<<<<< * diff = diff - 360 - * pos = rotate(ThisClosestP, [ThisClosestP[0], ThisClosestP[1]+dist_left], phi-180-diff*2) + * pos = rotate(ThisClosestP, [ThisClosestP[0], ThisClosestP[1]+dist_left], normal-diff) */ } - /* "collisions.py":1641 + /* "collisions.py":1716 * if diff > 180: * diff = diff - 360 - * pos = rotate(ThisClosestP, [ThisClosestP[0], ThisClosestP[1]+dist_left], phi-180-diff*2) # <<<<<<<<<<<<<< - * vel = list(rotateBy0(vel, 180-diff*2)) + * pos = rotate(ThisClosestP, [ThisClosestP[0], ThisClosestP[1]+dist_left], normal-diff) # <<<<<<<<<<<<<< + * vel = rotateBy0(vel, 180-diff*2) * vel = [vel[0]*closestObj.bounciness, vel[1]*closestObj.bounciness] */ - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_rotate); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1641, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_9 = __Pyx_GetItemInt_Tuple(__pyx_v_ThisClosestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1641, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_ThisClosestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1641, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_rotate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_v_dist_left); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1641, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1641, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_9)) __PYX_ERR(0, 1641, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 1641, __pyx_L1_error); - __pyx_t_9 = 0; - __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_phi, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1641, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ThisClosestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ThisClosestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1716, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1641, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1641, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); + __pyx_t_12 = PyNumber_Add(__pyx_t_1, __pyx_v_dist_left); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = NULL; + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GIVEREF(__pyx_t_2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 1716, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_12); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_12)) __PYX_ERR(0, 1716, __pyx_L1_error); + __pyx_t_2 = 0; + __pyx_t_12 = 0; + __pyx_t_12 = PyNumber_Subtract(__pyx_v_normal, __pyx_v_diff); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_2 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_14))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_14); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); - __Pyx_INCREF(__pyx_t_9); + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_14, function); + __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_9, __pyx_v_ThisClosestP, __pyx_t_3, __pyx_t_4}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + PyObject *__pyx_callargs[4] = {__pyx_t_2, __pyx_v_ThisClosestP, __pyx_t_1, __pyx_t_12}; + __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1716, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1641, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } - __pyx_v_pos = __pyx_t_5; - __pyx_t_5 = 0; + __pyx_v_pos = __pyx_t_13; + __pyx_t_13 = 0; - /* "collisions.py":1642 + /* "collisions.py":1717 * diff = diff - 360 - * pos = rotate(ThisClosestP, [ThisClosestP[0], ThisClosestP[1]+dist_left], phi-180-diff*2) - * vel = list(rotateBy0(vel, 180-diff*2)) # <<<<<<<<<<<<<< + * pos = rotate(ThisClosestP, [ThisClosestP[0], ThisClosestP[1]+dist_left], normal-diff) + * vel = rotateBy0(vel, 180-diff*2) # <<<<<<<<<<<<<< * vel = [vel[0]*closestObj.bounciness, vel[1]*closestObj.bounciness] * # HACK */ - __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_rotateBy0); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1642, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_4 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1642, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyInt_SubtractCObj(__pyx_int_180, __pyx_t_4, 0xB4, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1642, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_rotateBy0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = NULL; + __pyx_t_12 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1717, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = __Pyx_PyInt_SubtractCObj(__pyx_int_180, __pyx_t_12, 0xB4, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1717, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_14))) { - __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_14); - if (likely(__pyx_t_4)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14); - __Pyx_INCREF(__pyx_t_4); + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_14, function); + __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_vel, __pyx_t_3}; - __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; + PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_v_vel, __pyx_t_1}; + __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1717, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1642, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } - __pyx_t_14 = __Pyx_PySequence_ListKeepNew(__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1642, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF_SET(__pyx_v_vel, __pyx_t_14); - __pyx_t_14 = 0; + __Pyx_DECREF_SET(__pyx_v_vel, __pyx_t_13); + __pyx_t_13 = 0; - /* "collisions.py":1643 - * pos = rotate(ThisClosestP, [ThisClosestP[0], ThisClosestP[1]+dist_left], phi-180-diff*2) - * vel = list(rotateBy0(vel, 180-diff*2)) + /* "collisions.py":1718 + * pos = rotate(ThisClosestP, [ThisClosestP[0], ThisClosestP[1]+dist_left], normal-diff) + * vel = rotateBy0(vel, 180-diff*2) * vel = [vel[0]*closestObj.bounciness, vel[1]*closestObj.bounciness] # <<<<<<<<<<<<<< * # HACK - * smallness = rotateBy0([0,AVERYSMALLNUMBER], phi-180-diff*2) + * angle = direction((0, 0), vel)-quart */ - __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1643, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1643, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_14, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1643, __pyx_L1_error) + __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1718, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1643, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1643, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_4 = PyNumber_Multiply(__pyx_t_5, __pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1643, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = PyList_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1643, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_14, 0, __pyx_t_3)) __PYX_ERR(0, 1643, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_14, 1, __pyx_t_4)) __PYX_ERR(0, 1643, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_4 = 0; - __Pyx_DECREF_SET(__pyx_v_vel, __pyx_t_14); - __pyx_t_14 = 0; + __pyx_t_1 = PyNumber_Multiply(__pyx_t_13, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_12 = PyNumber_Multiply(__pyx_t_3, __pyx_t_13); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = PyList_New(2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1718, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_GIVEREF(__pyx_t_1); + if (__Pyx_PyList_SET_ITEM(__pyx_t_13, 0, __pyx_t_1)) __PYX_ERR(0, 1718, __pyx_L1_error); + __Pyx_GIVEREF(__pyx_t_12); + if (__Pyx_PyList_SET_ITEM(__pyx_t_13, 1, __pyx_t_12)) __PYX_ERR(0, 1718, __pyx_L1_error); + __pyx_t_1 = 0; + __pyx_t_12 = 0; + __Pyx_DECREF_SET(__pyx_v_vel, __pyx_t_13); + __pyx_t_13 = 0; - /* "collisions.py":1645 + /* "collisions.py":1720 * vel = [vel[0]*closestObj.bounciness, vel[1]*closestObj.bounciness] * # HACK - * smallness = rotateBy0([0,AVERYSMALLNUMBER], phi-180-diff*2) # <<<<<<<<<<<<<< + * angle = direction((0, 0), vel)-quart # <<<<<<<<<<<<<< + * qx = -math.sin(angle) * AVERYSMALLNUMBER + * qy = math.cos(angle) * AVERYSMALLNUMBER + */ + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_direction); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1720, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_12); + if (likely(__pyx_t_1)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_12, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_tuple__2, __pyx_v_vel}; + __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1720, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + __pyx_t_12 = PyNumber_Subtract(__pyx_t_13, __pyx_v_quart); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1720, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_v_angle = __pyx_t_12; + __pyx_t_12 = 0; + + /* "collisions.py":1721 + * # HACK + * angle = direction((0, 0), vel)-quart + * qx = -math.sin(angle) * AVERYSMALLNUMBER # <<<<<<<<<<<<<< + * qy = math.cos(angle) * AVERYSMALLNUMBER + * smallness = (qx, qy) + */ + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_math); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1721, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_sin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1721, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_13 = NULL; + __pyx_t_6 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_13)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_13); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_1, function); + __pyx_t_6 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_v_angle}; + __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1721, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + } + __pyx_t_1 = PyNumber_Negative(__pyx_t_12); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1721, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_AVERYSMALLNUMBER); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1721, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_13 = PyNumber_Multiply(__pyx_t_1, __pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1721, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_v_qx = __pyx_t_13; + __pyx_t_13 = 0; + + /* "collisions.py":1722 + * angle = direction((0, 0), vel)-quart + * qx = -math.sin(angle) * AVERYSMALLNUMBER + * qy = math.cos(angle) * AVERYSMALLNUMBER # <<<<<<<<<<<<<< + * smallness = (qx, qy) * out, outvel = self.handleCollisionsPos(Circle(ThisClosestP[0]+smallness[0], ThisClosestP[1]+smallness[1], newCir.r), - * Circle(*pos, oldCir.r), objs, vel, False, precision) */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_rotateBy0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1645, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_AVERYSMALLNUMBER); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1645, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1645, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_INCREF(__pyx_int_0); - __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_int_0)) __PYX_ERR(0, 1645, __pyx_L1_error); - __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(0, 1645, __pyx_L1_error); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_phi, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1645, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1645, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1645, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_math); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1722, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_cos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1722, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = NULL; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_9); + if (unlikely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); + __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_5, __pyx_t_1}; - __pyx_t_14 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_v_angle}; + __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1722, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1645, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_v_smallness = __pyx_t_14; - __pyx_t_14 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_AVERYSMALLNUMBER); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1722, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_12 = PyNumber_Multiply(__pyx_t_13, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1722, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_qy = __pyx_t_12; + __pyx_t_12 = 0; - /* "collisions.py":1646 - * # HACK - * smallness = rotateBy0([0,AVERYSMALLNUMBER], phi-180-diff*2) + /* "collisions.py":1723 + * qx = -math.sin(angle) * AVERYSMALLNUMBER + * qy = math.cos(angle) * AVERYSMALLNUMBER + * smallness = (qx, qy) # <<<<<<<<<<<<<< + * out, outvel = self.handleCollisionsPos(Circle(ThisClosestP[0]+smallness[0], ThisClosestP[1]+smallness[1], newCir.r), + * Circle(*pos, oldCir.r), objs, vel, False, precision) + */ + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1723, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_INCREF(__pyx_v_qx); + __Pyx_GIVEREF(__pyx_v_qx); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_qx)) __PYX_ERR(0, 1723, __pyx_L1_error); + __Pyx_INCREF(__pyx_v_qy); + __Pyx_GIVEREF(__pyx_v_qy); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_qy)) __PYX_ERR(0, 1723, __pyx_L1_error); + __pyx_v_smallness = ((PyObject*)__pyx_t_12); + __pyx_t_12 = 0; + + /* "collisions.py":1724 + * qy = math.cos(angle) * AVERYSMALLNUMBER + * smallness = (qx, qy) * out, outvel = self.handleCollisionsPos(Circle(ThisClosestP[0]+smallness[0], ThisClosestP[1]+smallness[1], newCir.r), # <<<<<<<<<<<<<< * Circle(*pos, oldCir.r), objs, vel, False, precision) * if replaceSelf: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handleCollisionsPos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1646, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Circle); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1646, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = __Pyx_GetItemInt_Tuple(__pyx_v_ThisClosestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1646, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_smallness, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1646, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handleCollisionsPos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Circle); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Add(__pyx_t_9, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1646, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ThisClosestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_ThisClosestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1646, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_smallness, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1646, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_13 = PyNumber_Add(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1646, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_newCir, __pyx_n_s_r); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1646, __pyx_L1_error) + __pyx_t_14 = __Pyx_GetItemInt_Tuple(__pyx_v_smallness, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_14); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_ThisClosestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_smallness, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_9 = PyNumber_Add(__pyx_t_14, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = NULL; + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_newCir, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_14 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_5))) { - __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5); - if (likely(__pyx_t_3)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); - __Pyx_INCREF(__pyx_t_3); + if (unlikely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_14)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); + __Pyx_INCREF(__pyx_t_14); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_5, function); + __Pyx_DECREF_SET(__pyx_t_3, function); __pyx_t_6 = 1; } } #endif { - PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_t_2, __pyx_t_13, __pyx_t_9}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + PyObject *__pyx_callargs[4] = {__pyx_t_14, __pyx_t_4, __pyx_t_9, __pyx_t_2}; + __pyx_t_13 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 3+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1646, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - /* "collisions.py":1647 - * smallness = rotateBy0([0,AVERYSMALLNUMBER], phi-180-diff*2) + /* "collisions.py":1725 + * smallness = (qx, qy) * out, outvel = self.handleCollisionsPos(Circle(ThisClosestP[0]+smallness[0], ThisClosestP[1]+smallness[1], newCir.r), * Circle(*pos, oldCir.r), objs, vel, False, precision) # <<<<<<<<<<<<<< * if replaceSelf: - * self.x, self.y = out[0][0], out[0][1] + * self.x, self.y = out[0], out[1] */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Circle); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1647, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = __Pyx_PySequence_Tuple(__pyx_v_pos); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1647, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_9); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_r); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1647, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1647, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Circle); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1725, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_pos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1725, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_13); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_13)) __PYX_ERR(0, 1647, __pyx_L1_error); - __pyx_t_13 = 0; - __pyx_t_13 = PyNumber_Add(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1647, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_13); - __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_oldCir, __pyx_n_s_r); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1725, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1725, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_GIVEREF(__pyx_t_9); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_9)) __PYX_ERR(0, 1725, __pyx_L1_error); + __pyx_t_9 = 0; + __pyx_t_9 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1725, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1647, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = NULL; + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1725, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; + __pyx_t_9 = NULL; __pyx_t_6 = 0; #if CYTHON_UNPACK_METHODS - if (likely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_13)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_13); + if (likely(PyMethod_Check(__pyx_t_1))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1); + if (likely(__pyx_t_9)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); + __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); + __Pyx_DECREF_SET(__pyx_t_1, function); __pyx_t_6 = 1; } } #endif { - PyObject *__pyx_callargs[7] = {__pyx_t_13, __pyx_t_1, __pyx_t_2, __pyx_v_objs, __pyx_v_vel, Py_False, __pyx_v_precision}; - __pyx_t_14 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 6+__pyx_t_6); - __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1646, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); + PyObject *__pyx_callargs[7] = {__pyx_t_9, __pyx_t_13, __pyx_t_4, __pyx_v_objs, __pyx_v_vel, Py_False, __pyx_v_precision}; + __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_6, 6+__pyx_t_6); + __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - if ((likely(PyTuple_CheckExact(__pyx_t_14))) || (PyList_CheckExact(__pyx_t_14))) { - PyObject* sequence = __pyx_t_14; + if ((likely(PyTuple_CheckExact(__pyx_t_12))) || (PyList_CheckExact(__pyx_t_12))) { + PyObject* sequence = __pyx_t_12; Py_ssize_t size = __Pyx_PySequence_SIZE(sequence); if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 1646, __pyx_L1_error) + __PYX_ERR(0, 1724, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); + __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); + __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); } else { - __pyx_t_4 = PyList_GET_ITEM(sequence, 0); - __pyx_t_2 = PyList_GET_ITEM(sequence, 1); + __pyx_t_1 = PyList_GET_ITEM(sequence, 0); + __pyx_t_4 = PyList_GET_ITEM(sequence, 1); } + __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); - __Pyx_INCREF(__pyx_t_2); #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1646, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1646, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); #endif - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else { Py_ssize_t index = -1; - __pyx_t_1 = PyObject_GetIter(__pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1646, __pyx_L1_error) + __pyx_t_13 = PyObject_GetIter(__pyx_t_12); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1724, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_13); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_26 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_13); + index = 0; __pyx_t_1 = __pyx_t_26(__pyx_t_13); if (unlikely(!__pyx_t_1)) goto __pyx_L47_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_25 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); - index = 0; __pyx_t_4 = __pyx_t_25(__pyx_t_1); if (unlikely(!__pyx_t_4)) goto __pyx_L27_unpacking_failed; + index = 1; __pyx_t_4 = __pyx_t_26(__pyx_t_13); if (unlikely(!__pyx_t_4)) goto __pyx_L47_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); - index = 1; __pyx_t_2 = __pyx_t_25(__pyx_t_1); if (unlikely(!__pyx_t_2)) goto __pyx_L27_unpacking_failed; - __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_25(__pyx_t_1), 2) < 0) __PYX_ERR(0, 1646, __pyx_L1_error) - __pyx_t_25 = NULL; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - goto __pyx_L28_unpacking_done; - __pyx_L27_unpacking_failed:; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_25 = NULL; + if (__Pyx_IternextUnpackEndCheck(__pyx_t_26(__pyx_t_13), 2) < 0) __PYX_ERR(0, 1724, __pyx_L1_error) + __pyx_t_26 = NULL; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + goto __pyx_L48_unpacking_done; + __pyx_L47_unpacking_failed:; + __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; + __pyx_t_26 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 1646, __pyx_L1_error) - __pyx_L28_unpacking_done:; + __PYX_ERR(0, 1724, __pyx_L1_error) + __pyx_L48_unpacking_done:; } - /* "collisions.py":1646 - * # HACK - * smallness = rotateBy0([0,AVERYSMALLNUMBER], phi-180-diff*2) + /* "collisions.py":1724 + * qy = math.cos(angle) * AVERYSMALLNUMBER + * smallness = (qx, qy) * out, outvel = self.handleCollisionsPos(Circle(ThisClosestP[0]+smallness[0], ThisClosestP[1]+smallness[1], newCir.r), # <<<<<<<<<<<<<< * Circle(*pos, oldCir.r), objs, vel, False, precision) * if replaceSelf: */ - __pyx_v_out = __pyx_t_4; + __pyx_v_out = __pyx_t_1; + __pyx_t_1 = 0; + __pyx_v_outvel = __pyx_t_4; __pyx_t_4 = 0; - __pyx_v_outvel = __pyx_t_2; - __pyx_t_2 = 0; - /* "collisions.py":1648 + /* "collisions.py":1726 * out, outvel = self.handleCollisionsPos(Circle(ThisClosestP[0]+smallness[0], ThisClosestP[1]+smallness[1], newCir.r), * Circle(*pos, oldCir.r), objs, vel, False, precision) * if replaceSelf: # <<<<<<<<<<<<<< - * self.x, self.y = out[0][0], out[0][1] + * self.x, self.y = out[0], out[1] * if verbose: */ - __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_replaceSelf); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1648, __pyx_L1_error) - if (__pyx_t_17) { + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_replaceSelf); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1726, __pyx_L1_error) + if (__pyx_t_18) { - /* "collisions.py":1649 + /* "collisions.py":1727 * Circle(*pos, oldCir.r), objs, vel, False, precision) * if replaceSelf: - * self.x, self.y = out[0][0], out[0][1] # <<<<<<<<<<<<<< + * self.x, self.y = out[0], out[1] # <<<<<<<<<<<<<< * if verbose: * return out, outvel, [True] */ - __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_out, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1649, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_14, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1649, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_out, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1649, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_14, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1649, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_out, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1727, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_out, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_2) < 0) __PYX_ERR(0, 1649, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_4) < 0) __PYX_ERR(0, 1649, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_12) < 0) __PYX_ERR(0, 1727, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_4) < 0) __PYX_ERR(0, 1727, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":1648 + /* "collisions.py":1726 * out, outvel = self.handleCollisionsPos(Circle(ThisClosestP[0]+smallness[0], ThisClosestP[1]+smallness[1], newCir.r), * Circle(*pos, oldCir.r), objs, vel, False, precision) * if replaceSelf: # <<<<<<<<<<<<<< - * self.x, self.y = out[0][0], out[0][1] + * self.x, self.y = out[0], out[1] * if verbose: */ } - /* "collisions.py":1650 + /* "collisions.py":1728 * if replaceSelf: - * self.x, self.y = out[0][0], out[0][1] + * self.x, self.y = out[0], out[1] * if verbose: # <<<<<<<<<<<<<< * return out, outvel, [True] * return out, outvel */ - __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1650, __pyx_L1_error) - if (__pyx_t_17) { + __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_18 < 0))) __PYX_ERR(0, 1728, __pyx_L1_error) + if (__pyx_t_18) { - /* "collisions.py":1651 - * self.x, self.y = out[0][0], out[0][1] + /* "collisions.py":1729 + * self.x, self.y = out[0], out[1] * if verbose: * return out, outvel, [True] # <<<<<<<<<<<<<< * return out, outvel * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1651, __pyx_L1_error) + __pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, Py_True)) __PYX_ERR(0, 1651, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1651, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, Py_True)) __PYX_ERR(0, 1729, __pyx_L1_error); + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1729, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_out); __Pyx_GIVEREF(__pyx_v_out); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_out)) __PYX_ERR(0, 1651, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_out)) __PYX_ERR(0, 1729, __pyx_L1_error); __Pyx_INCREF(__pyx_v_outvel); __Pyx_GIVEREF(__pyx_v_outvel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_outvel)) __PYX_ERR(0, 1651, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_outvel)) __PYX_ERR(0, 1729, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_4)) __PYX_ERR(0, 1651, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_4)) __PYX_ERR(0, 1729, __pyx_L1_error); __pyx_t_4 = 0; - __pyx_r = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; + __pyx_r = ((PyObject*)__pyx_t_12); + __pyx_t_12 = 0; goto __pyx_L0; - /* "collisions.py":1650 + /* "collisions.py":1728 * if replaceSelf: - * self.x, self.y = out[0][0], out[0][1] + * self.x, self.y = out[0], out[1] * if verbose: # <<<<<<<<<<<<<< * return out, outvel, [True] * return out, outvel */ } - /* "collisions.py":1652 + /* "collisions.py":1730 * if verbose: * return out, outvel, [True] * return out, outvel # <<<<<<<<<<<<<< @@ -55182,19 +58165,19 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS * def handleCollisionsVel(self, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1652, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1730, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_out); __Pyx_GIVEREF(__pyx_v_out); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_out)) __PYX_ERR(0, 1652, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_out)) __PYX_ERR(0, 1730, __pyx_L1_error); __Pyx_INCREF(__pyx_v_outvel); __Pyx_GIVEREF(__pyx_v_outvel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_outvel)) __PYX_ERR(0, 1652, __pyx_L1_error); - __pyx_r = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_outvel)) __PYX_ERR(0, 1730, __pyx_L1_error); + __pyx_r = ((PyObject*)__pyx_t_12); + __pyx_t_12 = 0; goto __pyx_L0; - /* "collisions.py":1558 + /* "collisions.py":1600 * return self.closestPointTo(Point(*ps[0])) * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< @@ -55221,25 +58204,31 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS __Pyx_AddTraceback("collisions.Circle.handleCollisionsPos", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; - __Pyx_XDECREF(__pyx_v_velphi); __Pyx_XDECREF(__pyx_v_quart); __Pyx_XDECREF(__pyx_v_mvement); __Pyx_XDECREF(__pyx_v_points); __Pyx_XDECREF(__pyx_v_o); __Pyx_XDECREF(__pyx_v_cs); __Pyx_XDECREF(__pyx_v_closestP); - __Pyx_XDECREF(__pyx_v_closestObj); - __Pyx_XDECREF(__pyx_v_t); - __Pyx_XDECREF(__pyx_v_normal); - __Pyx_XDECREF(__pyx_v_cpoMvemnt); - __Pyx_XDECREF(__pyx_v_dist_left); - __Pyx_XDECREF(__pyx_v_dist_to); + __Pyx_XDECREF(__pyx_v_lns); + __Pyx_XDECREF(__pyx_v_collP); + __Pyx_XDECREF(__pyx_v_factor); + __Pyx_XDECREF(__pyx_v_ln); + __Pyx_XDECREF(__pyx_v_p); + __Pyx_XDECREF(__pyx_v_calculate); __Pyx_XDECREF(__pyx_v_ThisClosestP); - __Pyx_XDECREF(__pyx_v_x); - __Pyx_XDECREF(__pyx_v_y); - __Pyx_XDECREF(__pyx_v_phi); + __Pyx_XDECREF(__pyx_v_dist_left); + __Pyx_XDECREF(__pyx_v_tries); + __Pyx_XDECREF(__pyx_v_ps); + __Pyx_XDECREF(__pyx_v_xs); + __Pyx_XDECREF(__pyx_v_ys); __Pyx_XDECREF(__pyx_v_diff); + __Pyx_XDECREF(__pyx_v_normal); + __Pyx_XDECREF(__pyx_v_phi); __Pyx_XDECREF(__pyx_v_pos); + __Pyx_XDECREF(__pyx_v_angle); + __Pyx_XDECREF(__pyx_v_qx); + __Pyx_XDECREF(__pyx_v_qy); __Pyx_XDECREF(__pyx_v_smallness); __Pyx_XDECREF(__pyx_v_out); __Pyx_XDECREF(__pyx_v_outvel); @@ -55252,7 +58241,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS return __pyx_r; } -/* "collisions.py":1654 +/* "collisions.py":1732 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< @@ -55260,7 +58249,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_14handleCollisionsPos(CYTHON_UNUS * objs: Union[Shapes,Iterable[Shape]], */ -static PyObject *__pyx_pf_10collisions_46__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { +static PyObject *__pyx_pf_10collisions_48__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -55271,39 +58260,45 @@ static PyObject *__pyx_pf_10collisions_46__defaults__(CYTHON_UNUSED PyObject *__ __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - /* "collisions.py":1659 - * replaceSelf: bool = True, + /* "collisions.py":1739 + * maxTries: int = 50, * precision: Number = BASEPRECISION, * verbose: bool = False # <<<<<<<<<<<<<< * ) -> tuple['Circle', pointLike, verboseOutput]: * """ */ - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1654, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_True)); __Pyx_GIVEREF(((PyObject *)Py_True)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_True))) __PYX_ERR(0, 1654, __pyx_L1_error); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_self)->__pyx_arg_precision); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_self)->__pyx_arg_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 1654, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_True))) __PYX_ERR(0, 1732, __pyx_L1_error); + __Pyx_INCREF(((PyObject *)Py_True)); + __Pyx_GIVEREF(((PyObject *)Py_True)); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_True))) __PYX_ERR(0, 1732, __pyx_L1_error); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_self)->__pyx_arg_maxTries); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_self)->__pyx_arg_maxTries); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_self)->__pyx_arg_maxTries)) __PYX_ERR(0, 1732, __pyx_L1_error); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_self)->__pyx_arg_precision); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_self)->__pyx_arg_precision); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 1732, __pyx_L1_error); __Pyx_INCREF(((PyObject *)Py_False)); __Pyx_GIVEREF(((PyObject *)Py_False)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)Py_False))) __PYX_ERR(0, 1654, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)Py_False))) __PYX_ERR(0, 1732, __pyx_L1_error); - /* "collisions.py":1654 + /* "collisions.py":1732 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< * vel: pointLike, * objs: Union[Shapes,Iterable[Shape]], */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1654, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1654, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1732, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 1654, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 1732, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -55322,16 +58317,16 @@ static PyObject *__pyx_pf_10collisions_46__defaults__(CYTHON_UNUSED PyObject *__ } /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_17handleCollisionsVel(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Circle_21handleCollisionsVel(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_6Circle_16handleCollisionsVel, "\n Handles movement of this Circle via velocity and it bouncing off of other objects.\n\n Args:\n vel (pointLike): The velocity of this Circle\n objs (Shapes / Iterable[Shape]): The objects to bounce off of\n replaceSelf (bool, optional): Whether or not to replace self.x and self.y with the new position. Defaults to True.\n precision (Number, optional): The decimal places to round to to check (for things like corner checking). Defaults to 5.\n verbose (bool, optional): Whether to give verbose output or not. Defaults to False.\n\n Returns:\n tuple[Circle, pointLike, veboseOutput?]: The new Circle object and vel of this object respectively, and if verbose then the verboseOutput.\n \n VerboseOutput:\n DidReflect (bool): Whether the line reflected off of something\n "); -static PyMethodDef __pyx_mdef_10collisions_6Circle_17handleCollisionsVel = {"handleCollisionsVel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_17handleCollisionsVel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Circle_16handleCollisionsVel}; -static PyObject *__pyx_pw_10collisions_6Circle_17handleCollisionsVel(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_6Circle_20handleCollisionsVel, "\n Handles movement of this Circle via velocity and it bouncing off of other objects.\n\n Args:\n vel (pointLike): The velocity of this Circle\n objs (Shapes / Iterable[Shape]): The objects to bounce off of\n replaceSelf (bool, optional): Whether or not to replace self.x and self.y with the new position. Defaults to True.\n unstuckable (bool, optional): Whether being in an object but having enough speed to get out allows you to get out or not. Defaults to True. This makes it so if you occasionally get stuck in a wall, you can get out and not be stuck forever. But it also means that if you move too fast or have too thin a wall, you will be able to clip through it. //FIXME: Make you not need this. When circles rest in a v shape, they get stuck.\n maxTries (int, optional): The maximum amount of tries it will do to get the circle to stop colliding when it hits something. Defaults to 50.\n precision (Number, optional): The decimal places to round to to check (for things like corner checking). Defaults to 5.\n verbose (bool, optional): Whether to give verbose output or not. Defaults to False.\n\n Returns:\n tuple[Circle, pointLike, veboseOutput?]: The new Circle object and vel of this object respectively, and if verbose then the verboseOutput.\n \n VerboseOutput:\n DidReflect (bool): Whether the line reflected off of something\n "); +static PyMethodDef __pyx_mdef_10collisions_6Circle_21handleCollisionsVel = {"handleCollisionsVel", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_21handleCollisionsVel, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Circle_20handleCollisionsVel}; +static PyObject *__pyx_pw_10collisions_6Circle_21handleCollisionsVel(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -55342,13 +58337,15 @@ PyObject *__pyx_args, PyObject *__pyx_kwds PyObject *__pyx_v_vel = 0; PyObject *__pyx_v_objs = 0; PyObject *__pyx_v_replaceSelf = 0; + PyObject *__pyx_v_unstuckable = 0; + PyObject *__pyx_v_maxTries = 0; PyObject *__pyx_v_precision = 0; PyObject *__pyx_v_verbose = 0; #if !CYTHON_METH_FASTCALL CYTHON_UNUSED Py_ssize_t __pyx_nargs; #endif CYTHON_UNUSED PyObject *const *__pyx_kwvalues; - PyObject* values[6] = {0,0,0,0,0,0}; + PyObject* values[8] = {0,0,0,0,0,0,0,0}; int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; @@ -55364,14 +58361,20 @@ PyObject *__pyx_args, PyObject *__pyx_kwds #endif __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { - PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_vel,&__pyx_n_s_objs,&__pyx_n_s_replaceSelf,&__pyx_n_s_precision,&__pyx_n_s_verbose,0}; - __pyx_defaults14 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_self); + PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_vel,&__pyx_n_s_objs,&__pyx_n_s_replaceSelf,&__pyx_n_s_unstuckable,&__pyx_n_s_maxTries,&__pyx_n_s_precision,&__pyx_n_s_verbose,0}; + __pyx_defaults15 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_self); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); - values[4] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_precision); - values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); + values[4] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); + values[5] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_maxTries); + values[6] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_precision); + values[7] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { + case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); @@ -55394,7 +58397,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1654, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1732, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -55402,9 +58405,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1654, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1732, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 1); __PYX_ERR(0, 1654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 8, 1); __PYX_ERR(0, 1732, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -55412,38 +58415,56 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1654, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1732, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 2); __PYX_ERR(0, 1654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 8, 2); __PYX_ERR(0, 1732, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_replaceSelf); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1654, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1732, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_precision); + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_unstuckable); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1654, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1732, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { - PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_verbose); + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_maxTries); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1654, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1732, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 6: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_precision); + if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1732, __pyx_L3_error) + } + CYTHON_FALLTHROUGH; + case 7: + if (kw_args > 0) { + PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_verbose); + if (value) { values[7] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1732, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "handleCollisionsVel") < 0)) __PYX_ERR(0, 1654, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "handleCollisionsVel") < 0)) __PYX_ERR(0, 1732, __pyx_L3_error) } } else { switch (__pyx_nargs) { + case 8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7); + CYTHON_FALLTHROUGH; + case 7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6); + CYTHON_FALLTHROUGH; case 6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5); CYTHON_FALLTHROUGH; case 5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4); @@ -55461,12 +58482,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_v_vel = values[1]; __pyx_v_objs = values[2]; __pyx_v_replaceSelf = values[3]; - __pyx_v_precision = values[4]; - __pyx_v_verbose = values[5]; + __pyx_v_unstuckable = values[4]; + __pyx_v_maxTries = ((PyObject*)values[5]); + __pyx_v_precision = values[6]; + __pyx_v_verbose = values[7]; } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, __pyx_nargs); __PYX_ERR(0, 1654, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 8, __pyx_nargs); __PYX_ERR(0, 1732, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -55480,9 +58503,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Circle_16handleCollisionsVel(__pyx_self, __pyx_v_self, __pyx_v_vel, __pyx_v_objs, __pyx_v_replaceSelf, __pyx_v_precision, __pyx_v_verbose); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_maxTries), (&PyInt_Type), 0, "maxTries", 1))) __PYX_ERR(0, 1737, __pyx_L1_error) + __pyx_r = __pyx_pf_10collisions_6Circle_20handleCollisionsVel(__pyx_self, __pyx_v_self, __pyx_v_vel, __pyx_v_objs, __pyx_v_replaceSelf, __pyx_v_unstuckable, __pyx_v_maxTries, __pyx_v_precision, __pyx_v_verbose); /* function exit code */ + goto __pyx_L0; + __pyx_L1_error:; + __pyx_r = NULL; + __pyx_L0:; { Py_ssize_t __pyx_temp; for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) { @@ -55493,7 +58521,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Circle_16handleCollisionsVel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_vel, PyObject *__pyx_v_objs, PyObject *__pyx_v_replaceSelf, PyObject *__pyx_v_precision, PyObject *__pyx_v_verbose) { +static PyObject *__pyx_pf_10collisions_6Circle_20handleCollisionsVel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_vel, PyObject *__pyx_v_objs, PyObject *__pyx_v_replaceSelf, PyObject *__pyx_v_unstuckable, PyObject *__pyx_v_maxTries, PyObject *__pyx_v_precision, PyObject *__pyx_v_verbose) { PyObject *__pyx_v_o = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -55512,34 +58540,34 @@ static PyObject *__pyx_pf_10collisions_6Circle_16handleCollisionsVel(CYTHON_UNUS int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handleCollisionsVel", 1); - /* "collisions.py":1677 + /* "collisions.py":1761 * DidReflect (bool): Whether the line reflected off of something * """ - * o = self.handleCollisionsPos(self, Circle(self.x+vel[0], self.y+vel[1], self.r), objs, vel, False, precision, verbose) # <<<<<<<<<<<<<< + * o = self.handleCollisionsPos(self, Circle(self.x+vel[0], self.y+vel[1], self.r), objs, vel, unstuckable, maxTries, False, precision, verbose) # <<<<<<<<<<<<<< * if replaceSelf: * self.x, self.y = o[0][0], o[0][1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handleCollisionsPos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1677, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handleCollisionsPos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Circle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1677, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Circle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1677, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1677, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1677, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1677, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1677, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1677, __pyx_L1_error) + __pyx_t_8 = PyNumber_Add(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1677, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_9 = 0; @@ -55562,7 +58590,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_16handleCollisionsVel(CYTHON_UNUS __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1677, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -55581,69 +58609,69 @@ static PyObject *__pyx_pf_10collisions_6Circle_16handleCollisionsVel(CYTHON_UNUS } #endif { - PyObject *__pyx_callargs[8] = {__pyx_t_4, __pyx_v_self, __pyx_t_3, __pyx_v_objs, __pyx_v_vel, Py_False, __pyx_v_precision, __pyx_v_verbose}; - __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 7+__pyx_t_9); + PyObject *__pyx_callargs[10] = {__pyx_t_4, __pyx_v_self, __pyx_t_3, __pyx_v_objs, __pyx_v_vel, __pyx_v_unstuckable, __pyx_v_maxTries, Py_False, __pyx_v_precision, __pyx_v_verbose}; + __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 9+__pyx_t_9); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1677, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_o = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":1678 + /* "collisions.py":1762 * """ - * o = self.handleCollisionsPos(self, Circle(self.x+vel[0], self.y+vel[1], self.r), objs, vel, False, precision, verbose) + * o = self.handleCollisionsPos(self, Circle(self.x+vel[0], self.y+vel[1], self.r), objs, vel, unstuckable, maxTries, False, precision, verbose) * if replaceSelf: # <<<<<<<<<<<<<< * self.x, self.y = o[0][0], o[0][1] * if verbose: */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_replaceSelf); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1678, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_replaceSelf); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1762, __pyx_L1_error) if (__pyx_t_10) { - /* "collisions.py":1679 - * o = self.handleCollisionsPos(self, Circle(self.x+vel[0], self.y+vel[1], self.r), objs, vel, False, precision, verbose) + /* "collisions.py":1763 + * o = self.handleCollisionsPos(self, Circle(self.x+vel[0], self.y+vel[1], self.r), objs, vel, unstuckable, maxTries, False, precision, verbose) * if replaceSelf: * self.x, self.y = o[0][0], o[0][1] # <<<<<<<<<<<<<< * if verbose: * return o[0], o[1], o[2] */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_o, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1679, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_o, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1679, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_o, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1679, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_o, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1679, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_2) < 0) __PYX_ERR(0, 1679, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_2) < 0) __PYX_ERR(0, 1763, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_3) < 0) __PYX_ERR(0, 1679, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_3) < 0) __PYX_ERR(0, 1763, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1678 + /* "collisions.py":1762 * """ - * o = self.handleCollisionsPos(self, Circle(self.x+vel[0], self.y+vel[1], self.r), objs, vel, False, precision, verbose) + * o = self.handleCollisionsPos(self, Circle(self.x+vel[0], self.y+vel[1], self.r), objs, vel, unstuckable, maxTries, False, precision, verbose) * if replaceSelf: # <<<<<<<<<<<<<< * self.x, self.y = o[0][0], o[0][1] * if verbose: */ } - /* "collisions.py":1680 + /* "collisions.py":1764 * if replaceSelf: * self.x, self.y = o[0][0], o[0][1] * if verbose: # <<<<<<<<<<<<<< * return o[0], o[1], o[2] * return o[0], o[1] */ - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1680, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1764, __pyx_L1_error) if (__pyx_t_10) { - /* "collisions.py":1681 + /* "collisions.py":1765 * self.x, self.y = o[0][0], o[0][1] * if verbose: * return o[0], o[1], o[2] # <<<<<<<<<<<<<< @@ -55651,20 +58679,20 @@ static PyObject *__pyx_pf_10collisions_6Circle_16handleCollisionsVel(CYTHON_UNUS * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_o, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1681, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_o, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_o, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1681, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_o, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_o, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1681, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_o, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1681, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1765, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 1681, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 1765, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 1681, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 1765, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1)) __PYX_ERR(0, 1681, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1)) __PYX_ERR(0, 1765, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; @@ -55672,7 +58700,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_16handleCollisionsVel(CYTHON_UNUS __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":1680 + /* "collisions.py":1764 * if replaceSelf: * self.x, self.y = o[0][0], o[0][1] * if verbose: # <<<<<<<<<<<<<< @@ -55681,7 +58709,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_16handleCollisionsVel(CYTHON_UNUS */ } - /* "collisions.py":1682 + /* "collisions.py":1766 * if verbose: * return o[0], o[1], o[2] * return o[0], o[1] # <<<<<<<<<<<<<< @@ -55689,23 +58717,23 @@ static PyObject *__pyx_pf_10collisions_6Circle_16handleCollisionsVel(CYTHON_UNUS * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_o, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1682, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_o, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_o, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1682, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_o, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1682, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 1682, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 1766, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1682, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1766, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1654 + /* "collisions.py":1732 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< @@ -55732,7 +58760,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_16handleCollisionsVel(CYTHON_UNUS return __pyx_r; } -/* "collisions.py":1684 +/* "collisions.py":1768 * return o[0], o[1] * * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< @@ -55740,7 +58768,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_16handleCollisionsVel(CYTHON_UNUS * Finds whether a point is on a corner of this shape. But because circles don't have any corners, this will return False. */ -static PyObject *__pyx_pf_10collisions_48__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { +static PyObject *__pyx_pf_10collisions_50__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -55750,18 +58778,18 @@ static PyObject *__pyx_pf_10collisions_48__defaults__(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1684, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_self)->__pyx_arg_precision); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_self)->__pyx_arg_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 1684, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1684, __pyx_L1_error) + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_self)->__pyx_arg_precision); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_self)->__pyx_arg_precision); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 1768, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1684, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1768, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 1684, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 1768, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -55780,16 +58808,16 @@ static PyObject *__pyx_pf_10collisions_48__defaults__(CYTHON_UNUSED PyObject *__ } /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_19isCorner(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Circle_23isCorner(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_6Circle_18isCorner, "\n Finds whether a point is on a corner of this shape. But because circles don't have any corners, this will return False.\n\n Args:\n point (pointLike): The point to find if it's a corner\n precision (Number, optional): The decimal places to round to to check. Defaults to 5.\n\n Returns:\n bool: Whether the point is on a corner of this shape\n "); -static PyMethodDef __pyx_mdef_10collisions_6Circle_19isCorner = {"isCorner", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_19isCorner, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Circle_18isCorner}; -static PyObject *__pyx_pw_10collisions_6Circle_19isCorner(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_6Circle_22isCorner, "\n Finds whether a point is on a corner of this shape. But because circles don't have any corners, this will return False.\n\n Args:\n point (pointLike): The point to find if it's a corner\n precision (Number, optional): The decimal places to round to to check. Defaults to 5.\n\n Returns:\n bool: Whether the point is on a corner of this shape\n "); +static PyMethodDef __pyx_mdef_10collisions_6Circle_23isCorner = {"isCorner", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_23isCorner, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Circle_22isCorner}; +static PyObject *__pyx_pw_10collisions_6Circle_23isCorner(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -55820,7 +58848,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_point,&__pyx_n_s_precision,0}; - __pyx_defaults15 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_self); + __pyx_defaults16 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_self); values[2] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_precision); if (__pyx_kwds) { Py_ssize_t kw_args; @@ -55841,7 +58869,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1684, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1768, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -55849,21 +58877,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1684, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1768, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, 1); __PYX_ERR(0, 1684, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, 1); __PYX_ERR(0, 1768, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_precision); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1684, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1768, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isCorner") < 0)) __PYX_ERR(0, 1684, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isCorner") < 0)) __PYX_ERR(0, 1768, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -55881,7 +58909,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1684, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1768, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -55895,7 +58923,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Circle_18isCorner(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_precision); + __pyx_r = __pyx_pf_10collisions_6Circle_22isCorner(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_precision); /* function exit code */ { @@ -55908,12 +58936,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Circle_18isCorner(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_point, CYTHON_UNUSED PyObject *__pyx_v_precision) { +static PyObject *__pyx_pf_10collisions_6Circle_22isCorner(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_point, CYTHON_UNUSED PyObject *__pyx_v_precision) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("isCorner", 1); - /* "collisions.py":1695 + /* "collisions.py":1779 * bool: Whether the point is on a corner of this shape * """ * return False # <<<<<<<<<<<<<< @@ -55925,7 +58953,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_18isCorner(CYTHON_UNUSED PyObject __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":1684 + /* "collisions.py":1768 * return o[0], o[1] * * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< @@ -55940,7 +58968,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_18isCorner(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":1697 +/* "collisions.py":1781 * return False * * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< @@ -55949,16 +58977,16 @@ static PyObject *__pyx_pf_10collisions_6Circle_18isCorner(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_21tangent(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Circle_25tangent(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_6Circle_20tangent, "\n Finds the tangent on this surface to a point with a given velocity.\n\n Args:\n point (pointLike): The point to find the tangent of this surface from.\n vel (pointLike): Which direction the point is moving.\n\n Returns:\n Number: The tangent of the circle at the point. You can -90 to get the normal.\n "); -static PyMethodDef __pyx_mdef_10collisions_6Circle_21tangent = {"tangent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_21tangent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Circle_20tangent}; -static PyObject *__pyx_pw_10collisions_6Circle_21tangent(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_6Circle_24tangent, "\n Finds the tangent on this surface to a point with a given velocity.\n\n Args:\n point (pointLike): The point to find the tangent of this surface from.\n vel (pointLike): Which direction the point is moving.\n\n Returns:\n Number: The tangent of the circle at the point. You can -90 to get the normal.\n "); +static PyMethodDef __pyx_mdef_10collisions_6Circle_25tangent = {"tangent", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_25tangent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Circle_24tangent}; +static PyObject *__pyx_pw_10collisions_6Circle_25tangent(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -56008,7 +59036,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1697, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1781, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -56016,9 +59044,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1697, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1781, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 1); __PYX_ERR(0, 1697, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 1); __PYX_ERR(0, 1781, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -56026,14 +59054,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1697, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1781, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 2); __PYX_ERR(0, 1697, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 2); __PYX_ERR(0, 1781, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tangent") < 0)) __PYX_ERR(0, 1697, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tangent") < 0)) __PYX_ERR(0, 1781, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -56048,7 +59076,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1697, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1781, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -56062,7 +59090,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Circle_20tangent(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_vel); + __pyx_r = __pyx_pf_10collisions_6Circle_24tangent(__pyx_self, __pyx_v_self, __pyx_v_point, __pyx_v_vel); /* function exit code */ { @@ -56075,7 +59103,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Circle_20tangent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, CYTHON_UNUSED PyObject *__pyx_v_vel) { +static PyObject *__pyx_pf_10collisions_6Circle_24tangent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, CYTHON_UNUSED PyObject *__pyx_v_vel) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -56093,25 +59121,25 @@ static PyObject *__pyx_pf_10collisions_6Circle_20tangent(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tangent", 1); - /* "collisions.py":1708 + /* "collisions.py":1792 * Number: The tangent of the circle at the point. You can -90 to get the normal. * """ * if self.x == point[0]: # <<<<<<<<<<<<<< * return 90 * return math.degrees(math.atan((point[1]-self.y)/(point[0]-self.x))) + (0 if self.x>point[0] else 180) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1708, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1708, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1792, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1708, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1792, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1708, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1792, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "collisions.py":1709 + /* "collisions.py":1793 * """ * if self.x == point[0]: * return 90 # <<<<<<<<<<<<<< @@ -56123,7 +59151,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_20tangent(CYTHON_UNUSED PyObject __pyx_r = __pyx_int_90; goto __pyx_L0; - /* "collisions.py":1708 + /* "collisions.py":1792 * Number: The tangent of the circle at the point. You can -90 to get the normal. * """ * if self.x == point[0]: # <<<<<<<<<<<<<< @@ -56132,7 +59160,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_20tangent(CYTHON_UNUSED PyObject */ } - /* "collisions.py":1710 + /* "collisions.py":1794 * if self.x == point[0]: * return 90 * return math.degrees(math.atan((point[1]-self.y)/(point[0]-self.x))) + (0 if self.x>point[0] else 180) # <<<<<<<<<<<<<< @@ -56140,33 +59168,33 @@ static PyObject *__pyx_pf_10collisions_6Circle_20tangent(CYTHON_UNUSED PyObject * def copy(self) -> 'Circle': */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1710, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_degrees); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1710, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_degrees); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1710, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_math); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_atan); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1710, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_atan); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_point, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1710, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_point, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1710, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyNumber_Subtract(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1710, __pyx_L1_error) + __pyx_t_8 = PyNumber_Subtract(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1710, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1710, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = PyNumber_Subtract(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1710, __pyx_L1_error) + __pyx_t_9 = PyNumber_Subtract(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1710, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -56189,7 +59217,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_20tangent(CYTHON_UNUSED PyObject __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1710, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -56212,18 +59240,18 @@ static PyObject *__pyx_pf_10collisions_6Circle_20tangent(CYTHON_UNUSED PyObject __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1710, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1710, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1710, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1710, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1794, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1710, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1794, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_4) { __Pyx_INCREF(__pyx_int_0); @@ -56232,7 +59260,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_20tangent(CYTHON_UNUSED PyObject __Pyx_INCREF(__pyx_int_180); __pyx_t_1 = __pyx_int_180; } - __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1710, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1794, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -56240,7 +59268,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_20tangent(CYTHON_UNUSED PyObject __pyx_t_5 = 0; goto __pyx_L0; - /* "collisions.py":1697 + /* "collisions.py":1781 * return False * * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< @@ -56266,7 +59294,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_20tangent(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":1712 +/* "collisions.py":1796 * return math.degrees(math.atan((point[1]-self.y)/(point[0]-self.x))) + (0 if self.x>point[0] else 180) * * def copy(self) -> 'Circle': # <<<<<<<<<<<<<< @@ -56275,16 +59303,16 @@ static PyObject *__pyx_pf_10collisions_6Circle_20tangent(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_23copy(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Circle_27copy(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -PyDoc_STRVAR(__pyx_doc_10collisions_6Circle_22copy, "\n Make a replica of this object with the same object.\n "); -static PyMethodDef __pyx_mdef_10collisions_6Circle_23copy = {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_23copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Circle_22copy}; -static PyObject *__pyx_pw_10collisions_6Circle_23copy(PyObject *__pyx_self, +PyDoc_STRVAR(__pyx_doc_10collisions_6Circle_26copy, "\n Make a replica of this object with the same object.\n "); +static PyMethodDef __pyx_mdef_10collisions_6Circle_27copy = {"copy", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_27copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_10collisions_6Circle_26copy}; +static PyObject *__pyx_pw_10collisions_6Circle_27copy(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -56328,12 +59356,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1712, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1796, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(0, 1712, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(0, 1796, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -56344,7 +59372,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("copy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1712, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("copy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1796, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -56358,7 +59386,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Circle_22copy(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_6Circle_26copy(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -56371,7 +59399,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Circle_22copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_6Circle_26copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -56387,7 +59415,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_22copy(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 1); - /* "collisions.py":1716 + /* "collisions.py":1800 * Make a replica of this object with the same object. * """ * return Circle(self.x, self.y, self.r, self.bounciness) # <<<<<<<<<<<<<< @@ -56395,15 +59423,15 @@ static PyObject *__pyx_pf_10collisions_6Circle_22copy(CYTHON_UNUSED PyObject *__ * def __getitem__(self, item: int) -> Number: */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Circle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1716, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Circle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1716, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1716, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1716, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1716, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_7 = NULL; __pyx_t_8 = 0; @@ -56427,7 +59455,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_22copy(CYTHON_UNUSED PyObject *__ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1716, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1800, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -56435,7 +59463,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_22copy(CYTHON_UNUSED PyObject *__ __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1712 + /* "collisions.py":1796 * return math.degrees(math.atan((point[1]-self.y)/(point[0]-self.x))) + (0 if self.x>point[0] else 180) * * def copy(self) -> 'Circle': # <<<<<<<<<<<<<< @@ -56460,7 +59488,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_22copy(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* "collisions.py":1718 +/* "collisions.py":1802 * return Circle(self.x, self.y, self.r, self.bounciness) * * def __getitem__(self, item: int) -> Number: # <<<<<<<<<<<<<< @@ -56469,15 +59497,15 @@ static PyObject *__pyx_pf_10collisions_6Circle_22copy(CYTHON_UNUSED PyObject *__ */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_25__getitem__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Circle_29__getitem__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_6Circle_25__getitem__ = {"__getitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_25__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Circle_25__getitem__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_6Circle_29__getitem__ = {"__getitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_29__getitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_6Circle_29__getitem__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -56524,7 +59552,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1718, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1802, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -56532,14 +59560,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1718, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1802, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 1718, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 1802, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__getitem__") < 0)) __PYX_ERR(0, 1718, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__getitem__") < 0)) __PYX_ERR(0, 1802, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -56552,7 +59580,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1718, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1802, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -56566,8 +59594,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_item), (&PyInt_Type), 0, "item", 1))) __PYX_ERR(0, 1718, __pyx_L1_error) - __pyx_r = __pyx_pf_10collisions_6Circle_24__getitem__(__pyx_self, __pyx_v_self, __pyx_v_item); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_item), (&PyInt_Type), 0, "item", 1))) __PYX_ERR(0, 1802, __pyx_L1_error) + __pyx_r = __pyx_pf_10collisions_6Circle_28__getitem__(__pyx_self, __pyx_v_self, __pyx_v_item); /* function exit code */ goto __pyx_L0; @@ -56584,7 +59612,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Circle_24__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item) { +static PyObject *__pyx_pf_10collisions_6Circle_28__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -56595,19 +59623,19 @@ static PyObject *__pyx_pf_10collisions_6Circle_24__getitem__(CYTHON_UNUSED PyObj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 1); - /* "collisions.py":1719 + /* "collisions.py":1803 * * def __getitem__(self, item: int) -> Number: * if item == 0: # <<<<<<<<<<<<<< * return self.x * elif item == 1: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1719, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1719, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1803, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1803, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":1720 + /* "collisions.py":1804 * def __getitem__(self, item: int) -> Number: * if item == 0: * return self.x # <<<<<<<<<<<<<< @@ -56615,13 +59643,13 @@ static PyObject *__pyx_pf_10collisions_6Circle_24__getitem__(CYTHON_UNUSED PyObj * return self.y */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1720, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1719 + /* "collisions.py":1803 * * def __getitem__(self, item: int) -> Number: * if item == 0: # <<<<<<<<<<<<<< @@ -56630,19 +59658,19 @@ static PyObject *__pyx_pf_10collisions_6Circle_24__getitem__(CYTHON_UNUSED PyObj */ } - /* "collisions.py":1721 + /* "collisions.py":1805 * if item == 0: * return self.x * elif item == 1: # <<<<<<<<<<<<<< * return self.y * elif item == 2: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1721, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1721, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1805, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1805, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":1722 + /* "collisions.py":1806 * return self.x * elif item == 1: * return self.y # <<<<<<<<<<<<<< @@ -56650,13 +59678,13 @@ static PyObject *__pyx_pf_10collisions_6Circle_24__getitem__(CYTHON_UNUSED PyObj * return self.r */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1722, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1806, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1721 + /* "collisions.py":1805 * if item == 0: * return self.x * elif item == 1: # <<<<<<<<<<<<<< @@ -56665,19 +59693,19 @@ static PyObject *__pyx_pf_10collisions_6Circle_24__getitem__(CYTHON_UNUSED PyObj */ } - /* "collisions.py":1723 + /* "collisions.py":1807 * elif item == 1: * return self.y * elif item == 2: # <<<<<<<<<<<<<< * return self.r * else: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1723, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1723, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1807, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1807, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_2)) { - /* "collisions.py":1724 + /* "collisions.py":1808 * return self.y * elif item == 2: * return self.r # <<<<<<<<<<<<<< @@ -56685,13 +59713,13 @@ static PyObject *__pyx_pf_10collisions_6Circle_24__getitem__(CYTHON_UNUSED PyObj * raise IndexError( */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1724, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1808, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1723 + /* "collisions.py":1807 * elif item == 1: * return self.y * elif item == 2: # <<<<<<<<<<<<<< @@ -56700,7 +59728,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_24__getitem__(CYTHON_UNUSED PyObj */ } - /* "collisions.py":1726 + /* "collisions.py":1810 * return self.r * else: * raise IndexError( # <<<<<<<<<<<<<< @@ -56709,35 +59737,35 @@ static PyObject *__pyx_pf_10collisions_6Circle_24__getitem__(CYTHON_UNUSED PyObj */ /*else*/ { - /* "collisions.py":1727 + /* "collisions.py":1811 * else: * raise IndexError( * 'List index out of range! Must be 0-2, found: '+str(item) # <<<<<<<<<<<<<< * ) * */ - __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1727, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_List_index_out_of_range_Must_be_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1727, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_List_index_out_of_range_Must_be_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":1726 + /* "collisions.py":1810 * return self.r * else: * raise IndexError( # <<<<<<<<<<<<<< * 'List index out of range! Must be 0-2, found: '+str(item) * ) */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1726, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1810, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 1726, __pyx_L1_error) + __PYX_ERR(0, 1810, __pyx_L1_error) } - /* "collisions.py":1718 + /* "collisions.py":1802 * return Circle(self.x, self.y, self.r, self.bounciness) * * def __getitem__(self, item: int) -> Number: # <<<<<<<<<<<<<< @@ -56757,7 +59785,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_24__getitem__(CYTHON_UNUSED PyObj return __pyx_r; } -/* "collisions.py":1730 +/* "collisions.py":1814 * ) * * def __setitem__(self, item: int, new: Number) -> None: # <<<<<<<<<<<<<< @@ -56766,15 +59794,15 @@ static PyObject *__pyx_pf_10collisions_6Circle_24__getitem__(CYTHON_UNUSED PyObj */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_27__setitem__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Circle_31__setitem__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_6Circle_27__setitem__ = {"__setitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_27__setitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Circle_27__setitem__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_6Circle_31__setitem__ = {"__setitem__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_31__setitem__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_6Circle_31__setitem__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -56824,7 +59852,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1730, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1814, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -56832,9 +59860,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1730, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1814, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 1730, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 1814, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -56842,14 +59870,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1730, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1814, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 1730, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 1814, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(0, 1730, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(0, 1814, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -56864,7 +59892,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1730, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 1814, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -56878,8 +59906,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_item), (&PyInt_Type), 0, "item", 1))) __PYX_ERR(0, 1730, __pyx_L1_error) - __pyx_r = __pyx_pf_10collisions_6Circle_26__setitem__(__pyx_self, __pyx_v_self, __pyx_v_item, __pyx_v_new); + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_item), (&PyInt_Type), 0, "item", 1))) __PYX_ERR(0, 1814, __pyx_L1_error) + __pyx_r = __pyx_pf_10collisions_6Circle_30__setitem__(__pyx_self, __pyx_v_self, __pyx_v_item, __pyx_v_new); /* function exit code */ goto __pyx_L0; @@ -56896,7 +59924,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Circle_26__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_new) { +static PyObject *__pyx_pf_10collisions_6Circle_30__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_new) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -56907,28 +59935,28 @@ static PyObject *__pyx_pf_10collisions_6Circle_26__setitem__(CYTHON_UNUSED PyObj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 1); - /* "collisions.py":1731 + /* "collisions.py":1815 * * def __setitem__(self, item: int, new: Number) -> None: * if item == 0: # <<<<<<<<<<<<<< * self.x = new * elif item == 1: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1731, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1731, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1815, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1815, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":1732 + /* "collisions.py":1816 * def __setitem__(self, item: int, new: Number) -> None: * if item == 0: * self.x = new # <<<<<<<<<<<<<< * elif item == 1: * self.y = new */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_v_new) < 0) __PYX_ERR(0, 1732, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_v_new) < 0) __PYX_ERR(0, 1816, __pyx_L1_error) - /* "collisions.py":1731 + /* "collisions.py":1815 * * def __setitem__(self, item: int, new: Number) -> None: * if item == 0: # <<<<<<<<<<<<<< @@ -56938,28 +59966,28 @@ static PyObject *__pyx_pf_10collisions_6Circle_26__setitem__(CYTHON_UNUSED PyObj goto __pyx_L3; } - /* "collisions.py":1733 + /* "collisions.py":1817 * if item == 0: * self.x = new * elif item == 1: # <<<<<<<<<<<<<< * self.y = new * elif item == 2: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1733, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1733, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1817, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1817, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":1734 + /* "collisions.py":1818 * self.x = new * elif item == 1: * self.y = new # <<<<<<<<<<<<<< * elif item == 2: * self.r = new */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_v_new) < 0) __PYX_ERR(0, 1734, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_v_new) < 0) __PYX_ERR(0, 1818, __pyx_L1_error) - /* "collisions.py":1733 + /* "collisions.py":1817 * if item == 0: * self.x = new * elif item == 1: # <<<<<<<<<<<<<< @@ -56969,28 +59997,28 @@ static PyObject *__pyx_pf_10collisions_6Circle_26__setitem__(CYTHON_UNUSED PyObj goto __pyx_L3; } - /* "collisions.py":1735 + /* "collisions.py":1819 * elif item == 1: * self.y = new * elif item == 2: # <<<<<<<<<<<<<< * self.r = new * else: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1735, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1735, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1819, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1819, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_2)) { - /* "collisions.py":1736 + /* "collisions.py":1820 * self.y = new * elif item == 2: * self.r = new # <<<<<<<<<<<<<< * else: * raise IndexError( */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_r, __pyx_v_new) < 0) __PYX_ERR(0, 1736, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_r, __pyx_v_new) < 0) __PYX_ERR(0, 1820, __pyx_L1_error) - /* "collisions.py":1735 + /* "collisions.py":1819 * elif item == 1: * self.y = new * elif item == 2: # <<<<<<<<<<<<<< @@ -57000,7 +60028,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_26__setitem__(CYTHON_UNUSED PyObj goto __pyx_L3; } - /* "collisions.py":1738 + /* "collisions.py":1822 * self.r = new * else: * raise IndexError( # <<<<<<<<<<<<<< @@ -57009,36 +60037,36 @@ static PyObject *__pyx_pf_10collisions_6Circle_26__setitem__(CYTHON_UNUSED PyObj */ /*else*/ { - /* "collisions.py":1739 + /* "collisions.py":1823 * else: * raise IndexError( * 'List index out of range! Must be 0-2, found: '+str(item) # <<<<<<<<<<<<<< * ) * */ - __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1739, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_List_index_out_of_range_Must_be_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1739, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_List_index_out_of_range_Must_be_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":1738 + /* "collisions.py":1822 * self.r = new * else: * raise IndexError( # <<<<<<<<<<<<<< * 'List index out of range! Must be 0-2, found: '+str(item) * ) */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1738, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1822, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 1738, __pyx_L1_error) + __PYX_ERR(0, 1822, __pyx_L1_error) } __pyx_L3:; - /* "collisions.py":1730 + /* "collisions.py":1814 * ) * * def __setitem__(self, item: int, new: Number) -> None: # <<<<<<<<<<<<<< @@ -57060,7 +60088,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_26__setitem__(CYTHON_UNUSED PyObj return __pyx_r; } -/* "collisions.py":1742 +/* "collisions.py":1826 * ) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -57069,15 +60097,15 @@ static PyObject *__pyx_pf_10collisions_6Circle_26__setitem__(CYTHON_UNUSED PyObj */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_29__iter__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Circle_33__iter__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_6Circle_29__iter__ = {"__iter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_29__iter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Circle_29__iter__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_6Circle_33__iter__ = {"__iter__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_33__iter__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_6Circle_33__iter__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -57121,12 +60149,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1742, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1826, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__iter__") < 0)) __PYX_ERR(0, 1742, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__iter__") < 0)) __PYX_ERR(0, 1826, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -57137,7 +60165,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1742, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1826, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -57151,7 +60179,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Circle_28__iter__(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_6Circle_32__iter__(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -57164,7 +60192,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Circle_28__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_6Circle_32__iter__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -57176,7 +60204,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_28__iter__(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 1); - /* "collisions.py":1743 + /* "collisions.py":1827 * * def __iter__(self): * return iter((self.x, self.y, self.r)) # <<<<<<<<<<<<<< @@ -57184,31 +60212,31 @@ static PyObject *__pyx_pf_10collisions_6Circle_28__iter__(CYTHON_UNUSED PyObject * def __str__(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1743, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1743, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1743, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1743, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 1743, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 1827, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 1743, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 1827, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(0, 1743, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(0, 1827, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1743, __pyx_L1_error) + __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":1742 + /* "collisions.py":1826 * ) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -57230,7 +60258,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_28__iter__(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":1745 +/* "collisions.py":1829 * return iter((self.x, self.y, self.r)) * * def __str__(self): # <<<<<<<<<<<<<< @@ -57239,15 +60267,15 @@ static PyObject *__pyx_pf_10collisions_6Circle_28__iter__(CYTHON_UNUSED PyObject */ /* Python wrapper */ -static PyObject *__pyx_pw_10collisions_6Circle_31__str__(PyObject *__pyx_self, +static PyObject *__pyx_pw_10collisions_6Circle_35__str__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_10collisions_6Circle_31__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_31__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_10collisions_6Circle_31__str__(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_10collisions_6Circle_35__str__ = {"__str__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_10collisions_6Circle_35__str__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_10collisions_6Circle_35__str__(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -57291,12 +60319,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1745, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1829, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 1745, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 1829, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -57307,7 +60335,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1745, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1829, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -57321,7 +60349,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_10collisions_6Circle_30__str__(__pyx_self, __pyx_v_self); + __pyx_r = __pyx_pf_10collisions_6Circle_34__str__(__pyx_self, __pyx_v_self); /* function exit code */ { @@ -57334,7 +60362,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_6Circle_30__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { +static PyObject *__pyx_pf_10collisions_6Circle_34__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -57347,7 +60375,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_30__str__(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 1); - /* "collisions.py":1746 + /* "collisions.py":1830 * * def __str__(self): * return f'' # <<<<<<<<<<<<<< @@ -57355,7 +60383,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_30__str__(CYTHON_UNUSED PyObject * class Arc(Circle): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1746, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 127; @@ -57363,9 +60391,9 @@ static PyObject *__pyx_pf_10collisions_6Circle_30__str__(CYTHON_UNUSED PyObject __pyx_t_2 += 11; __Pyx_GIVEREF(__pyx_kp_u_Circle_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Circle_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1746, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1746, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; @@ -57373,13 +60401,13 @@ static PyObject *__pyx_pf_10collisions_6Circle_30__str__(CYTHON_UNUSED PyObject __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); __pyx_t_5 = 0; - __Pyx_INCREF(__pyx_kp_u__6); + __Pyx_INCREF(__pyx_kp_u__8); __pyx_t_2 += 2; - __Pyx_GIVEREF(__pyx_kp_u__6); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1746, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_kp_u__8); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__8); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1746, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; @@ -57391,9 +60419,9 @@ static PyObject *__pyx_pf_10collisions_6Circle_30__str__(CYTHON_UNUSED PyObject __pyx_t_2 += 14; __Pyx_GIVEREF(__pyx_kp_u_with_radius); PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_with_radius); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1746, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1746, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; @@ -57401,18 +60429,18 @@ static PyObject *__pyx_pf_10collisions_6Circle_30__str__(CYTHON_UNUSED PyObject __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_5); __pyx_t_5 = 0; - __Pyx_INCREF(__pyx_kp_u__5); + __Pyx_INCREF(__pyx_kp_u__7); __pyx_t_2 += 1; - __Pyx_GIVEREF(__pyx_kp_u__5); - PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__5); - __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1746, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_kp_u__7); + PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u__7); + __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 7, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1830, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "collisions.py":1745 + /* "collisions.py":1829 * return iter((self.x, self.y, self.r)) * * def __str__(self): # <<<<<<<<<<<<<< @@ -57433,7 +60461,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_30__str__(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":1755 +/* "collisions.py":1841 * GROUPS = {ShpGroups.LINES, ShpGroups.NOTSTRAIGHT} * TYPE = ShpTyps.Arc * def __init__(self, # <<<<<<<<<<<<<< @@ -57441,7 +60469,7 @@ static PyObject *__pyx_pf_10collisions_6Circle_30__str__(CYTHON_UNUSED PyObject * y: Number, */ -static PyObject *__pyx_pf_10collisions_50__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { +static PyObject *__pyx_pf_10collisions_52__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -57451,23 +60479,23 @@ static PyObject *__pyx_pf_10collisions_50__defaults__(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1755, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults17, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1755, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_self)->__pyx_arg_precision); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_self)->__pyx_arg_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 1755, __pyx_L1_error); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults17, __pyx_self)->__pyx_arg_precision); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults17, __pyx_self)->__pyx_arg_precision); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __Pyx_CyFunction_Defaults(__pyx_defaults17, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 1841, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1755, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1841, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1755, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 1755, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 1841, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None)) __PYX_ERR(0, 1755, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None)) __PYX_ERR(0, 1841, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -57531,7 +60559,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_rad,&__pyx_n_s_startAngle,&__pyx_n_s_endAngle,&__pyx_n_s_precision,&__pyx_n_s_bounciness,0}; - __pyx_defaults16 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_self); + __pyx_defaults17 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults17, __pyx_self); values[6] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_precision); if (__pyx_kwds) { Py_ssize_t kw_args; @@ -57562,7 +60590,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1755, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1841, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -57570,9 +60598,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1755, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1841, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 1); __PYX_ERR(0, 1755, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 1); __PYX_ERR(0, 1841, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -57580,9 +60608,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1755, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1841, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 2); __PYX_ERR(0, 1755, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 2); __PYX_ERR(0, 1841, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: @@ -57590,9 +60618,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1755, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1841, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 3); __PYX_ERR(0, 1755, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 3); __PYX_ERR(0, 1841, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: @@ -57600,9 +60628,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1755, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1841, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 4); __PYX_ERR(0, 1755, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 4); __PYX_ERR(0, 1841, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: @@ -57610,28 +60638,28 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1755, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1841, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 5); __PYX_ERR(0, 1755, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, 5); __PYX_ERR(0, 1841, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_precision); if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1755, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1841, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bounciness); if (value) { values[7] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1755, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1841, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 1755, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 1841, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -57657,14 +60685,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_v_endAngle = values[5]; __pyx_v_precision = values[6]; if (values[7]) { - __pyx_v_bounciness = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_bounciness == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1762, __pyx_L3_error) + __pyx_v_bounciness = __pyx_PyFloat_AsDouble(values[7]); if (unlikely((__pyx_v_bounciness == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1848, __pyx_L3_error) } else { __pyx_v_bounciness = __pyx_dynamic_args->__pyx_arg_bounciness; } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, __pyx_nargs); __PYX_ERR(0, 1755, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 8, __pyx_nargs); __PYX_ERR(0, 1841, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -57702,7 +60730,7 @@ static PyObject *__pyx_pf_10collisions_3Arc___init__(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); - /* "collisions.py":1776 + /* "collisions.py":1862 * bounciness (float, optional): How bouncy this object is. 1 = rebounds perfectly, <1 = eventually will stop, >1 = will bounce more each time. Defaults to 0.7. * """ * self.x, self.y, self.r = x, y, rad # <<<<<<<<<<<<<< @@ -57715,14 +60743,14 @@ static PyObject *__pyx_pf_10collisions_3Arc___init__(CYTHON_UNUSED PyObject *__p __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = __pyx_v_rad; __Pyx_INCREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_1) < 0) __PYX_ERR(0, 1776, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_1) < 0) __PYX_ERR(0, 1862, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_2) < 0) __PYX_ERR(0, 1776, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_2) < 0) __PYX_ERR(0, 1862, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_r, __pyx_t_3) < 0) __PYX_ERR(0, 1776, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_r, __pyx_t_3) < 0) __PYX_ERR(0, 1862, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1777 + /* "collisions.py":1863 * """ * self.x, self.y, self.r = x, y, rad * self.startAng, self.endAng = startAngle, endAngle # <<<<<<<<<<<<<< @@ -57733,33 +60761,33 @@ static PyObject *__pyx_pf_10collisions_3Arc___init__(CYTHON_UNUSED PyObject *__p __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = __pyx_v_endAngle; __Pyx_INCREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_startAng, __pyx_t_3) < 0) __PYX_ERR(0, 1777, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_startAng, __pyx_t_3) < 0) __PYX_ERR(0, 1863, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_endAng, __pyx_t_2) < 0) __PYX_ERR(0, 1777, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_endAng, __pyx_t_2) < 0) __PYX_ERR(0, 1863, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":1778 + /* "collisions.py":1864 * self.x, self.y, self.r = x, y, rad * self.startAng, self.endAng = startAngle, endAngle * self.precision = precision # <<<<<<<<<<<<<< * self.bounciness = bounciness * */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_precision, __pyx_v_precision) < 0) __PYX_ERR(0, 1778, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_precision, __pyx_v_precision) < 0) __PYX_ERR(0, 1864, __pyx_L1_error) - /* "collisions.py":1779 + /* "collisions.py":1865 * self.startAng, self.endAng = startAngle, endAngle * self.precision = precision * self.bounciness = bounciness # <<<<<<<<<<<<<< * * def area(self) -> Number: */ - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1779, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1865, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bounciness, __pyx_t_2) < 0) __PYX_ERR(0, 1779, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bounciness, __pyx_t_2) < 0) __PYX_ERR(0, 1865, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":1755 + /* "collisions.py":1841 * GROUPS = {ShpGroups.LINES, ShpGroups.NOTSTRAIGHT} * TYPE = ShpTyps.Arc * def __init__(self, # <<<<<<<<<<<<<< @@ -57782,7 +60810,7 @@ static PyObject *__pyx_pf_10collisions_3Arc___init__(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "collisions.py":1781 +/* "collisions.py":1867 * self.bounciness = bounciness * * def area(self) -> Number: # <<<<<<<<<<<<<< @@ -57844,12 +60872,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1781, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1867, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "area") < 0)) __PYX_ERR(0, 1781, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "area") < 0)) __PYX_ERR(0, 1867, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -57860,7 +60888,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1781, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1867, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -57900,46 +60928,46 @@ static PyObject *__pyx_pf_10collisions_3Arc_2area(CYTHON_UNUSED PyObject *__pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("area", 1); - /* "collisions.py":1788 + /* "collisions.py":1874 * Number: The length of the arc. * """ * if self.endAng < self.startAng: # <<<<<<<<<<<<<< * diff = 360 - self.startAng + self.endAng * else: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1788, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1788, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1788, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1874, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1788, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1874, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - /* "collisions.py":1789 + /* "collisions.py":1875 * """ * if self.endAng < self.startAng: * diff = 360 - self.startAng + self.endAng # <<<<<<<<<<<<<< * else: * diff = self.endAng - self.startAng */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1789, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyInt_SubtractCObj(__pyx_int_360, __pyx_t_3, 0x168, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1789, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_SubtractCObj(__pyx_int_360, __pyx_t_3, 0x168, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1789, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1789, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_diff = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":1788 + /* "collisions.py":1874 * Number: The length of the arc. * """ * if self.endAng < self.startAng: # <<<<<<<<<<<<<< @@ -57949,7 +60977,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_2area(CYTHON_UNUSED PyObject *__pyx_ goto __pyx_L3; } - /* "collisions.py":1791 + /* "collisions.py":1877 * diff = 360 - self.startAng + self.endAng * else: * diff = self.endAng - self.startAng # <<<<<<<<<<<<<< @@ -57957,11 +60985,11 @@ static PyObject *__pyx_pf_10collisions_3Arc_2area(CYTHON_UNUSED PyObject *__pyx_ * */ /*else*/ { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1791, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1791, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1791, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -57970,7 +60998,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_2area(CYTHON_UNUSED PyObject *__pyx_ } __pyx_L3:; - /* "collisions.py":1792 + /* "collisions.py":1878 * else: * diff = self.endAng - self.startAng * return (diff/360) * 2*math.pi * self.r # <<<<<<<<<<<<<< @@ -57978,23 +61006,23 @@ static PyObject *__pyx_pf_10collisions_3Arc_2area(CYTHON_UNUSED PyObject *__pyx_ * def _collides(self, othershape: Shape) -> bool: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_TrueDivideObjC(__pyx_v_diff, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1792, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_TrueDivideObjC(__pyx_v_diff, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_MultiplyObjC(__pyx_t_2, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1792, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_MultiplyObjC(__pyx_t_2, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1792, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1792, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1792, __pyx_L1_error) + __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1792, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1792, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -58002,7 +61030,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_2area(CYTHON_UNUSED PyObject *__pyx_ __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":1781 + /* "collisions.py":1867 * self.bounciness = bounciness * * def area(self) -> Number: # <<<<<<<<<<<<<< @@ -58024,7 +61052,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_2area(CYTHON_UNUSED PyObject *__pyx_ return __pyx_r; } -/* "collisions.py":1794 +/* "collisions.py":1880 * return (diff/360) * 2*math.pi * self.r * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< @@ -58088,7 +61116,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1794, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1880, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -58096,14 +61124,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1794, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1880, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 1794, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 1880, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_collides") < 0)) __PYX_ERR(0, 1794, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_collides") < 0)) __PYX_ERR(0, 1880, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -58116,7 +61144,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1794, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1880, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -58144,7 +61172,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10collisions_3Arc_9_collides_2generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "collisions.py":1802 +/* "collisions.py":1888 * if checkShpType(othershape, ShpTyps.Line, ShpTyps.Circle): * if checkShpType(othershape, ShpTyps.Circle): * if any(othershape._collides(Point(*i)) for i in self.endPoints()): # <<<<<<<<<<<<<< @@ -58153,29 +61181,29 @@ static PyObject *__pyx_gb_10collisions_3Arc_9_collides_2generator7(__pyx_Corouti */ static PyObject *__pyx_pf_10collisions_3Arc_9_collides_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10collisions___pyx_scope_struct_14_genexpr *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_15_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_14_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_14_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_14_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_15_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_15_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_15_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_14_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_15_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1802, __pyx_L1_error) + __PYX_ERR(0, 1888, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_13__collides *) __pyx_self; + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_14__collides *) __pyx_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_3Arc_9_collides_2generator7, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Arc__collides_locals_genexpr, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 1802, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_3Arc_9_collides_2generator7, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Arc__collides_locals_genexpr, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 1888, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -58193,7 +61221,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_9_collides_genexpr(PyObject *__pyx_s static PyObject *__pyx_gb_10collisions_3Arc_9_collides_2generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10collisions___pyx_scope_struct_14_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_14_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10collisions___pyx_scope_struct_15_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_15_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -58217,16 +61245,16 @@ static PyObject *__pyx_gb_10collisions_3Arc_9_collides_2generator7(__pyx_Corouti return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1802, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1802, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1888, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 1888, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1802, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1802, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1888, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -58234,28 +61262,28 @@ static PyObject *__pyx_gb_10collisions_3Arc_9_collides_2generator7(__pyx_Corouti { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1802, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1888, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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_ERR(0, 1802, __pyx_L1_error) + __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_ERR(0, 1888, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1802, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1802, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1888, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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_ERR(0, 1802, __pyx_L1_error) + __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_ERR(0, 1888, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1802, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -58265,7 +61293,7 @@ static PyObject *__pyx_gb_10collisions_3Arc_9_collides_2generator7(__pyx_Corouti PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1802, __pyx_L1_error) + else __PYX_ERR(0, 1888, __pyx_L1_error) } break; } @@ -58275,14 +61303,14 @@ static PyObject *__pyx_gb_10collisions_3Arc_9_collides_2generator7(__pyx_Corouti __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_othershape)) { __Pyx_RaiseClosureNameError("othershape"); __PYX_ERR(0, 1802, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1802, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_othershape)) { __Pyx_RaiseClosureNameError("othershape"); __PYX_ERR(0, 1888, __pyx_L1_error) } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Point); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1802, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Point); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1802, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1802, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -58305,11 +61333,11 @@ static PyObject *__pyx_gb_10collisions_3Arc_9_collides_2generator7(__pyx_Corouti __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1802, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1802, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 1888, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_10) { __Pyx_XDECREF(__pyx_r); @@ -58350,7 +61378,7 @@ static PyObject *__pyx_gb_10collisions_3Arc_9_collides_2generator7(__pyx_Corouti return __pyx_r; } -/* "collisions.py":1794 +/* "collisions.py":1880 * return (diff/360) * 2*math.pi * self.r * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< @@ -58359,7 +61387,7 @@ static PyObject *__pyx_gb_10collisions_3Arc_9_collides_2generator7(__pyx_Corouti */ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { - struct __pyx_obj_10collisions___pyx_scope_struct_13__collides *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_14__collides *__pyx_cur_scope; PyObject *__pyx_v_angle = NULL; PyObject *__pyx_v_intersections = NULL; PyObject *__pyx_v_pt = NULL; @@ -58384,11 +61412,11 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_collides", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_13__collides *)__pyx_tp_new_10collisions___pyx_scope_struct_13__collides(__pyx_ptype_10collisions___pyx_scope_struct_13__collides, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_14__collides *)__pyx_tp_new_10collisions___pyx_scope_struct_14__collides(__pyx_ptype_10collisions___pyx_scope_struct_14__collides, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_13__collides *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_14__collides *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1794, __pyx_L1_error) + __PYX_ERR(0, 1880, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -58396,18 +61424,18 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_othershape); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_othershape); - /* "collisions.py":1795 + /* "collisions.py":1881 * * def _collides(self, othershape: Shape) -> bool: * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< * if round((self.x - othershape.x)**2 + (self.y - othershape.y)**2, self.precision) != round(self.r**2, self.precision): * return False */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1795, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1795, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1795, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -58429,86 +61457,86 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1795, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1795, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1881, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":1796 + /* "collisions.py":1882 * def _collides(self, othershape: Shape) -> bool: * if checkShpType(othershape, ShpTyps.Point): * if round((self.x - othershape.x)**2 + (self.y - othershape.y)**2, self.precision) != round(self.r**2, self.precision): # <<<<<<<<<<<<<< * return False * angle = math.degrees(math.atan2(othershape.y - self.y, othershape.x - self.x)) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1796, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1796, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1796, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1796, __pyx_L1_error) + __pyx_t_2 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1796, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1796, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1796, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1796, __pyx_L1_error) + __pyx_t_1 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1796, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_precision); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1796, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_precision); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1796, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 1796, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 1882, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1796, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 1882, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1796, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1796, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1796, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_precision); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1796, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_precision); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1796, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 1796, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3)) __PYX_ERR(0, 1882, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 1796, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 1882, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1796, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1796, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1882, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1796, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1882, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - /* "collisions.py":1797 + /* "collisions.py":1883 * if checkShpType(othershape, ShpTyps.Point): * if round((self.x - othershape.x)**2 + (self.y - othershape.y)**2, self.precision) != round(self.r**2, self.precision): * return False # <<<<<<<<<<<<<< @@ -58520,7 +61548,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":1796 + /* "collisions.py":1882 * def _collides(self, othershape: Shape) -> bool: * if checkShpType(othershape, ShpTyps.Point): * if round((self.x - othershape.x)**2 + (self.y - othershape.y)**2, self.precision) != round(self.r**2, self.precision): # <<<<<<<<<<<<<< @@ -58529,36 +61557,36 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ */ } - /* "collisions.py":1798 + /* "collisions.py":1884 * if round((self.x - othershape.x)**2 + (self.y - othershape.y)**2, self.precision) != round(self.r**2, self.precision): * return False * angle = math.degrees(math.atan2(othershape.y - self.y, othershape.x - self.x)) # <<<<<<<<<<<<<< * return self.angleInRange(angle) * if checkShpType(othershape, ShpTyps.Line, ShpTyps.Circle): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1798, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_degrees); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1798, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_degrees); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1798, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_atan2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1798, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_atan2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1798, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1798, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = PyNumber_Subtract(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1798, __pyx_L1_error) + __pyx_t_9 = PyNumber_Subtract(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1798, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1798, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = PyNumber_Subtract(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1798, __pyx_L1_error) + __pyx_t_10 = PyNumber_Subtract(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -58582,7 +61610,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1798, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } @@ -58605,14 +61633,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1798, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1884, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_v_angle = __pyx_t_4; __pyx_t_4 = 0; - /* "collisions.py":1799 + /* "collisions.py":1885 * return False * angle = math.degrees(math.atan2(othershape.y - self.y, othershape.x - self.x)) * return self.angleInRange(angle) # <<<<<<<<<<<<<< @@ -58620,7 +61648,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ * if checkShpType(othershape, ShpTyps.Circle): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_angleInRange); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1799, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_angleInRange); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; __pyx_t_5 = 0; @@ -58640,7 +61668,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_angle}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1799, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -58648,7 +61676,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":1795 + /* "collisions.py":1881 * * def _collides(self, othershape: Shape) -> bool: * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< @@ -58657,23 +61685,23 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ */ } - /* "collisions.py":1800 + /* "collisions.py":1886 * angle = math.degrees(math.atan2(othershape.y - self.y, othershape.x - self.x)) * return self.angleInRange(angle) * if checkShpType(othershape, ShpTyps.Line, ShpTyps.Circle): # <<<<<<<<<<<<<< * if checkShpType(othershape, ShpTyps.Circle): * if any(othershape._collides(Point(*i)) for i in self.endPoints()): */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1800, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1800, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1800, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1800, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Circle); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1800, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Circle); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -58696,26 +61724,26 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1800, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1800, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1886, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - /* "collisions.py":1801 + /* "collisions.py":1887 * return self.angleInRange(angle) * if checkShpType(othershape, ShpTyps.Line, ShpTyps.Circle): * if checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< * if any(othershape._collides(Point(*i)) for i in self.endPoints()): * return True */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1801, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1801, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_Circle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1801, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_Circle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; @@ -58737,22 +61765,22 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1801, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1801, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1887, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - /* "collisions.py":1802 + /* "collisions.py":1888 * if checkShpType(othershape, ShpTyps.Line, ShpTyps.Circle): * if checkShpType(othershape, ShpTyps.Circle): * if any(othershape._collides(Point(*i)) for i in self.endPoints()): # <<<<<<<<<<<<<< * return True * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endPoints); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1802, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endPoints); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = NULL; __pyx_t_5 = 0; @@ -58772,21 +61800,21 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1802, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_1 = __pyx_pf_10collisions_3Arc_9_collides_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1802, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_10collisions_3Arc_9_collides_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1802, __pyx_L1_error) + __pyx_t_4 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1802, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1888, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - /* "collisions.py":1803 + /* "collisions.py":1889 * if checkShpType(othershape, ShpTyps.Circle): * if any(othershape._collides(Point(*i)) for i in self.endPoints()): * return True # <<<<<<<<<<<<<< @@ -58798,7 +61826,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ __pyx_r = Py_True; goto __pyx_L0; - /* "collisions.py":1802 + /* "collisions.py":1888 * if checkShpType(othershape, ShpTyps.Line, ShpTyps.Circle): * if checkShpType(othershape, ShpTyps.Circle): * if any(othershape._collides(Point(*i)) for i in self.endPoints()): # <<<<<<<<<<<<<< @@ -58807,7 +61835,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ */ } - /* "collisions.py":1801 + /* "collisions.py":1887 * return self.angleInRange(angle) * if checkShpType(othershape, ShpTyps.Line, ShpTyps.Circle): * if checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< @@ -58816,20 +61844,20 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ */ } - /* "collisions.py":1804 + /* "collisions.py":1890 * if any(othershape._collides(Point(*i)) for i in self.endPoints()): * return True * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) # <<<<<<<<<<<<<< * for pt in intersections: * if self._collides(Point(*pt)): */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Circle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1804, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Circle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1804, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1804, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1804, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = NULL; __pyx_t_5 = 0; @@ -58852,11 +61880,11 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1804, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1804, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -58877,14 +61905,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_cur_scope->__pyx_v_othershape}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1804, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_v_intersections = __pyx_t_4; __pyx_t_4 = 0; - /* "collisions.py":1805 + /* "collisions.py":1891 * return True * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) * for pt in intersections: # <<<<<<<<<<<<<< @@ -58896,9 +61924,9 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_intersections); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1805, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_intersections); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1805, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1891, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_12)) { @@ -58906,28 +61934,28 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1805, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1891, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_7); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 1805, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_7); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 1891, __pyx_L1_error) #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1805, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1805, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1891, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_7); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 1805, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_7); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 1891, __pyx_L1_error) #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1805, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -58937,7 +61965,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1805, __pyx_L1_error) + else __PYX_ERR(0, 1891, __pyx_L1_error) } break; } @@ -58946,20 +61974,20 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1806 + /* "collisions.py":1892 * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) * for pt in intersections: * if self._collides(Point(*pt)): # <<<<<<<<<<<<<< * return True * return False */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1806, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_Point); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1806, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_Point); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_pt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1806, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_pt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_2, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1806, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_2, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -58982,15 +62010,15 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1806, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1892, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1806, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1892, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_6) { - /* "collisions.py":1807 + /* "collisions.py":1893 * for pt in intersections: * if self._collides(Point(*pt)): * return True # <<<<<<<<<<<<<< @@ -59003,7 +62031,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":1806 + /* "collisions.py":1892 * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) * for pt in intersections: * if self._collides(Point(*pt)): # <<<<<<<<<<<<<< @@ -59012,7 +62040,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ */ } - /* "collisions.py":1805 + /* "collisions.py":1891 * return True * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) * for pt in intersections: # <<<<<<<<<<<<<< @@ -59022,7 +62050,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":1808 + /* "collisions.py":1894 * if self._collides(Point(*pt)): * return True * return False # <<<<<<<<<<<<<< @@ -59034,7 +62062,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":1800 + /* "collisions.py":1886 * angle = math.degrees(math.atan2(othershape.y - self.y, othershape.x - self.x)) * return self.angleInRange(angle) * if checkShpType(othershape, ShpTyps.Line, ShpTyps.Circle): # <<<<<<<<<<<<<< @@ -59043,18 +62071,18 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ */ } - /* "collisions.py":1809 + /* "collisions.py":1895 * return True * return False * if checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) * for pt in intersections: */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1809, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1809, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Arc); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1809, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Arc); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -59076,28 +62104,28 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1809, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1895, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1809, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1895, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - /* "collisions.py":1810 + /* "collisions.py":1896 * return False * if checkShpType(othershape, ShpTyps.Arc): * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) # <<<<<<<<<<<<<< * for pt in intersections: * p = Point(*pt) */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_Circle); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1810, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_Circle); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1810, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1810, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1810, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = NULL; __pyx_t_5 = 0; @@ -59120,11 +62148,11 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1810, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1810, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; @@ -59145,14 +62173,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_cur_scope->__pyx_v_othershape}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1810, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1896, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __pyx_v_intersections = __pyx_t_4; __pyx_t_4 = 0; - /* "collisions.py":1811 + /* "collisions.py":1897 * if checkShpType(othershape, ShpTyps.Arc): * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) * for pt in intersections: # <<<<<<<<<<<<<< @@ -59164,9 +62192,9 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_intersections); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1811, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_intersections); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1811, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1897, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_12)) { @@ -59174,28 +62202,28 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1811, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1897, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_10 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_10); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 1811, __pyx_L1_error) + __pyx_t_10 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_10); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 1897, __pyx_L1_error) #else - __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1811, __pyx_L1_error) + __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1811, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1897, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_10); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 1811, __pyx_L1_error) + __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_11); __Pyx_INCREF(__pyx_t_10); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 1897, __pyx_L1_error) #else - __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1811, __pyx_L1_error) + __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1897, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); #endif } @@ -59205,7 +62233,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1811, __pyx_L1_error) + else __PYX_ERR(0, 1897, __pyx_L1_error) } break; } @@ -59214,32 +62242,32 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ __Pyx_XDECREF_SET(__pyx_v_pt, __pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":1812 + /* "collisions.py":1898 * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) * for pt in intersections: * p = Point(*pt) # <<<<<<<<<<<<<< * if self._collides(p) and othershape._collides(p): * return True */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_Point); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1812, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_Point); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_v_pt); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1812, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_v_pt); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1812, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_9); __pyx_t_9 = 0; - /* "collisions.py":1813 + /* "collisions.py":1899 * for pt in intersections: * p = Point(*pt) * if self._collides(p) and othershape._collides(p): # <<<<<<<<<<<<<< * return True * return False */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1813, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_10 = NULL; __pyx_t_5 = 0; @@ -59259,18 +62287,18 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_p}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1813, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1813, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1899, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_13) { } else { __pyx_t_6 = __pyx_t_13; goto __pyx_L16_bool_binop_done; } - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1813, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_10 = NULL; __pyx_t_5 = 0; @@ -59290,17 +62318,17 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_p}; __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1813, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1813, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_13 < 0))) __PYX_ERR(0, 1899, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_6 = __pyx_t_13; __pyx_L16_bool_binop_done:; if (__pyx_t_6) { - /* "collisions.py":1814 + /* "collisions.py":1900 * p = Point(*pt) * if self._collides(p) and othershape._collides(p): * return True # <<<<<<<<<<<<<< @@ -59313,7 +62341,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":1813 + /* "collisions.py":1899 * for pt in intersections: * p = Point(*pt) * if self._collides(p) and othershape._collides(p): # <<<<<<<<<<<<<< @@ -59322,7 +62350,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ */ } - /* "collisions.py":1811 + /* "collisions.py":1897 * if checkShpType(othershape, ShpTyps.Arc): * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) * for pt in intersections: # <<<<<<<<<<<<<< @@ -59332,7 +62360,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":1815 + /* "collisions.py":1901 * if self._collides(p) and othershape._collides(p): * return True * return False # <<<<<<<<<<<<<< @@ -59344,7 +62372,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":1809 + /* "collisions.py":1895 * return True * return False * if checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< @@ -59353,7 +62381,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ */ } - /* "collisions.py":1816 + /* "collisions.py":1902 * return True * return False * return othershape._collides(self) # <<<<<<<<<<<<<< @@ -59361,7 +62389,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ * def flip(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1816, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_7 = NULL; __pyx_t_5 = 0; @@ -59381,7 +62409,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_self}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1816, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1902, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -59389,7 +62417,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":1794 + /* "collisions.py":1880 * return (diff/360) * 2*math.pi * self.r * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< @@ -59421,7 +62449,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_4_collides(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":1818 +/* "collisions.py":1904 * return othershape._collides(self) * * def flip(self): # <<<<<<<<<<<<<< @@ -59483,12 +62511,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1818, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1904, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "flip") < 0)) __PYX_ERR(0, 1818, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "flip") < 0)) __PYX_ERR(0, 1904, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -59499,7 +62527,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("flip", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1818, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("flip", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1904, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -59536,23 +62564,23 @@ static PyObject *__pyx_pf_10collisions_3Arc_6flip(CYTHON_UNUSED PyObject *__pyx_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("flip", 1); - /* "collisions.py":1822 + /* "collisions.py":1908 * Flips the portion taken to make the arc; so an arc covering 90 degrees of the circle will now cover 270, and vice versa. * """ * self.startAng, self.endAng = self.endAng, self.startAng # <<<<<<<<<<<<<< * * def _contains(self, othershape: Shape) -> bool: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1822, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1822, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1908, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_startAng, __pyx_t_1) < 0) __PYX_ERR(0, 1822, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_startAng, __pyx_t_1) < 0) __PYX_ERR(0, 1908, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_endAng, __pyx_t_2) < 0) __PYX_ERR(0, 1822, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_endAng, __pyx_t_2) < 0) __PYX_ERR(0, 1908, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":1818 + /* "collisions.py":1904 * return othershape._collides(self) * * def flip(self): # <<<<<<<<<<<<<< @@ -59574,7 +62602,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_6flip(CYTHON_UNUSED PyObject *__pyx_ return __pyx_r; } -/* "collisions.py":1824 +/* "collisions.py":1910 * self.startAng, self.endAng = self.endAng, self.startAng * * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< @@ -59638,7 +62666,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1824, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1910, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -59646,14 +62674,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1824, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1910, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, 1); __PYX_ERR(0, 1824, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, 1); __PYX_ERR(0, 1910, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_contains") < 0)) __PYX_ERR(0, 1824, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_contains") < 0)) __PYX_ERR(0, 1910, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -59666,7 +62694,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1824, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1910, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -59698,7 +62726,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_8_contains(CYTHON_UNUSED PyObject *_ __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("_contains", 1); - /* "collisions.py":1825 + /* "collisions.py":1911 * * def _contains(self, othershape: Shape) -> bool: * return False # <<<<<<<<<<<<<< @@ -59710,7 +62738,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_8_contains(CYTHON_UNUSED PyObject *_ __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":1824 + /* "collisions.py":1910 * self.startAng, self.endAng = self.endAng, self.startAng * * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< @@ -59725,7 +62753,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_8_contains(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":1827 +/* "collisions.py":1913 * return False * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -59789,7 +62817,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1827, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1913, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -59797,14 +62825,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1827, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1913, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, 1); __PYX_ERR(0, 1827, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, 1); __PYX_ERR(0, 1913, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_where") < 0)) __PYX_ERR(0, 1827, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_where") < 0)) __PYX_ERR(0, 1913, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -59817,7 +62845,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1827, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1913, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -59867,18 +62895,18 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_where", 1); - /* "collisions.py":1828 + /* "collisions.py":1914 * * def _where(self, othershape: Shape) -> Iterable[pointLike]: * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< * if self._collides(othershape): * return [(othershape.x, othershape.y)] */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1828, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1828, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1828, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -59900,22 +62928,22 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1828, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1828, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1914, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":1829 + /* "collisions.py":1915 * def _where(self, othershape: Shape) -> Iterable[pointLike]: * if checkShpType(othershape, ShpTyps.Point): * if self._collides(othershape): # <<<<<<<<<<<<<< * return [(othershape.x, othershape.y)] * return [] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1829, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1915, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -59935,15 +62963,15 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_othershape}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1829, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1915, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1829, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1915, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":1830 + /* "collisions.py":1916 * if checkShpType(othershape, ShpTyps.Point): * if self._collides(othershape): * return [(othershape.x, othershape.y)] # <<<<<<<<<<<<<< @@ -59951,28 +62979,28 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p * if checkShpType(othershape, ShpTyps.Line, ShpTyps.Circle): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1830, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1916, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1830, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1916, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1830, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1916, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 1830, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 1916, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 1830, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 1916, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1830, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1916, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 1830, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 1916, __pyx_L1_error); __pyx_t_4 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1829 + /* "collisions.py":1915 * def _where(self, othershape: Shape) -> Iterable[pointLike]: * if checkShpType(othershape, ShpTyps.Point): * if self._collides(othershape): # <<<<<<<<<<<<<< @@ -59981,7 +63009,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p */ } - /* "collisions.py":1831 + /* "collisions.py":1917 * if self._collides(othershape): * return [(othershape.x, othershape.y)] * return [] # <<<<<<<<<<<<<< @@ -59989,13 +63017,13 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1831, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1828 + /* "collisions.py":1914 * * def _where(self, othershape: Shape) -> Iterable[pointLike]: * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< @@ -60004,23 +63032,23 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p */ } - /* "collisions.py":1832 + /* "collisions.py":1918 * return [(othershape.x, othershape.y)] * return [] * if checkShpType(othershape, ShpTyps.Line, ShpTyps.Circle): # <<<<<<<<<<<<<< * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) * return [pt for pt in intersections if self._collides(Point(*pt))] */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1832, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1832, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1832, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1832, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Circle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1832, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Circle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -60043,28 +63071,28 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1832, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1918, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1832, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1918, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "collisions.py":1833 + /* "collisions.py":1919 * return [] * if checkShpType(othershape, ShpTyps.Line, ShpTyps.Circle): * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) # <<<<<<<<<<<<<< * return [pt for pt in intersections if self._collides(Point(*pt))] * if checkShpType(othershape, ShpTyps.Arc): */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Circle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1833, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Circle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1919, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1833, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1919, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1833, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1919, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1833, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1919, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_5 = 0; @@ -60087,11 +63115,11 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1833, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1919, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1833, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1919, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -60112,14 +63140,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_othershape}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1833, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1919, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_v_intersections = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":1834 + /* "collisions.py":1920 * if checkShpType(othershape, ShpTyps.Line, ShpTyps.Circle): * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) * return [pt for pt in intersections if self._collides(Point(*pt))] # <<<<<<<<<<<<<< @@ -60128,16 +63156,16 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1834, __pyx_L8_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1920, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_v_intersections)) || PyTuple_CheckExact(__pyx_v_intersections)) { __pyx_t_7 = __pyx_v_intersections; __Pyx_INCREF(__pyx_t_7); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_intersections); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1834, __pyx_L8_error) + __pyx_t_10 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_intersections); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1920, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1834, __pyx_L8_error) + __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1920, __pyx_L8_error) } for (;;) { if (likely(!__pyx_t_11)) { @@ -60145,28 +63173,28 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1834, __pyx_L8_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1920, __pyx_L8_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1834, __pyx_L8_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1920, __pyx_L8_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1834, __pyx_L8_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1920, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1834, __pyx_L8_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1920, __pyx_L8_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1834, __pyx_L8_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1920, __pyx_L8_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1834, __pyx_L8_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1920, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -60176,7 +63204,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1834, __pyx_L8_error) + else __PYX_ERR(0, 1920, __pyx_L8_error) } break; } @@ -60184,13 +63212,13 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p } __Pyx_XDECREF_SET(__pyx_9genexpr27__pyx_v_pt, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1834, __pyx_L8_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1920, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Point); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1834, __pyx_L8_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Point); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1920, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_9genexpr27__pyx_v_pt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1834, __pyx_L8_error) + __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_9genexpr27__pyx_v_pt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1920, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1834, __pyx_L8_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1920, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -60213,14 +63241,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1834, __pyx_L8_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1920, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1834, __pyx_L8_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1920, __pyx_L8_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr27__pyx_v_pt))) __PYX_ERR(0, 1834, __pyx_L8_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr27__pyx_v_pt))) __PYX_ERR(0, 1920, __pyx_L8_error) } } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -60235,7 +63263,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1832 + /* "collisions.py":1918 * return [(othershape.x, othershape.y)] * return [] * if checkShpType(othershape, ShpTyps.Line, ShpTyps.Circle): # <<<<<<<<<<<<<< @@ -60244,18 +63272,18 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p */ } - /* "collisions.py":1835 + /* "collisions.py":1921 * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) * return [pt for pt in intersections if self._collides(Point(*pt))] * if checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) * return [pt for pt in intersections if self._collides(Point(*pt)) and othershape._collides(Point(*pt))] */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1835, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1921, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1835, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1921, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Arc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1835, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Arc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1921, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -60277,28 +63305,28 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1835, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1921, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1835, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1921, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "collisions.py":1836 + /* "collisions.py":1922 * return [pt for pt in intersections if self._collides(Point(*pt))] * if checkShpType(othershape, ShpTyps.Arc): * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) # <<<<<<<<<<<<<< * return [pt for pt in intersections if self._collides(Point(*pt)) and othershape._collides(Point(*pt))] * return othershape._where(self) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Circle); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1836, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Circle); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1836, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1836, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1836, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; __pyx_t_5 = 0; @@ -60321,11 +63349,11 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1836, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1836, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; @@ -60346,14 +63374,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_othershape}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1836, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __pyx_v_intersections = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":1837 + /* "collisions.py":1923 * if checkShpType(othershape, ShpTyps.Arc): * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) * return [pt for pt in intersections if self._collides(Point(*pt)) and othershape._collides(Point(*pt))] # <<<<<<<<<<<<<< @@ -60362,16 +63390,16 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1837, __pyx_L17_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1923, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_v_intersections)) || PyTuple_CheckExact(__pyx_v_intersections)) { __pyx_t_8 = __pyx_v_intersections; __Pyx_INCREF(__pyx_t_8); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_intersections); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1837, __pyx_L17_error) + __pyx_t_10 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_intersections); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1923, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1837, __pyx_L17_error) + __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1923, __pyx_L17_error) } for (;;) { if (likely(!__pyx_t_11)) { @@ -60379,28 +63407,28 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1837, __pyx_L17_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1923, __pyx_L17_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1837, __pyx_L17_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1923, __pyx_L17_error) #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1837, __pyx_L17_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1923, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1837, __pyx_L17_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1923, __pyx_L17_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1837, __pyx_L17_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1923, __pyx_L17_error) #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1837, __pyx_L17_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1923, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -60410,7 +63438,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1837, __pyx_L17_error) + else __PYX_ERR(0, 1923, __pyx_L17_error) } break; } @@ -60418,13 +63446,13 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p } __Pyx_XDECREF_SET(__pyx_9genexpr28__pyx_v_pt, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1837, __pyx_L17_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1923, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_Point); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1837, __pyx_L17_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_Point); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1923, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_9genexpr28__pyx_v_pt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1837, __pyx_L17_error) + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_9genexpr28__pyx_v_pt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1923, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1837, __pyx_L17_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1923, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -60447,24 +63475,24 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1837, __pyx_L17_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1923, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1837, __pyx_L17_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1923, __pyx_L17_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_12) { } else { __pyx_t_6 = __pyx_t_12; goto __pyx_L21_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1837, __pyx_L17_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1923, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Point); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1837, __pyx_L17_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Point); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1923, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_9genexpr28__pyx_v_pt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1837, __pyx_L17_error) + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_9genexpr28__pyx_v_pt); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1923, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1837, __pyx_L17_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1923, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -60487,16 +63515,16 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1837, __pyx_L17_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1923, __pyx_L17_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1837, __pyx_L17_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 1923, __pyx_L17_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_6 = __pyx_t_12; __pyx_L21_bool_binop_done:; if (__pyx_t_6) { - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr28__pyx_v_pt))) __PYX_ERR(0, 1837, __pyx_L17_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr28__pyx_v_pt))) __PYX_ERR(0, 1923, __pyx_L17_error) } } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -60511,7 +63539,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1835 + /* "collisions.py":1921 * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) * return [pt for pt in intersections if self._collides(Point(*pt))] * if checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< @@ -60520,7 +63548,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p */ } - /* "collisions.py":1838 + /* "collisions.py":1924 * intersections = Circle(self.x, self.y, self.r).whereCollides(othershape) * return [pt for pt in intersections if self._collides(Point(*pt)) and othershape._collides(Point(*pt))] * return othershape._where(self) # <<<<<<<<<<<<<< @@ -60528,7 +63556,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLike|Iterable[pointLike]: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_where); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1838, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_where); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = NULL; __pyx_t_5 = 0; @@ -60548,7 +63576,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_self}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1838, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1924, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } @@ -60556,7 +63584,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1827 + /* "collisions.py":1913 * return False * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -60584,7 +63612,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_10_where(CYTHON_UNUSED PyObject *__p return __pyx_r; } -/* "collisions.py":1840 +/* "collisions.py":1926 * return othershape._where(self) * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLike|Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -60653,7 +63681,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1840, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1926, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -60661,21 +63689,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1840, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1926, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, 1); __PYX_ERR(0, 1840, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, 1); __PYX_ERR(0, 1926, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_returnAll); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1840, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1926, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "closestPointTo") < 0)) __PYX_ERR(0, 1840, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "closestPointTo") < 0)) __PYX_ERR(0, 1926, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -60693,7 +63721,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1840, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1926, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -60720,7 +63748,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "collisions.py":1867 +/* "collisions.py":1953 * cirO = Circle(self.x, self.y, self.r) * if cirO.collides(othershape): * def checkP(p, this): # <<<<<<<<<<<<<< @@ -60784,7 +63812,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1867, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1953, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -60792,14 +63820,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1867, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1953, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("checkP", 1, 2, 2, 1); __PYX_ERR(0, 1867, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("checkP", 1, 2, 2, 1); __PYX_ERR(0, 1953, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "checkP") < 0)) __PYX_ERR(0, 1867, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "checkP") < 0)) __PYX_ERR(0, 1953, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -60812,7 +63840,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("checkP", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1867, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("checkP", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1953, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -60840,8 +63868,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_pf_10collisions_3Arc_14closestPointTo_checkP(PyObject *__pyx_self, PyObject *__pyx_v_p, PyObject *__pyx_v_this) { - struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo *__pyx_cur_scope; - struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo *__pyx_outer_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_16_closestPointTo *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_16_closestPointTo *__pyx_outer_scope; PyObject *__pyx_v_op = NULL; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -60857,36 +63885,36 @@ static PyObject *__pyx_pf_10collisions_3Arc_14closestPointTo_checkP(PyObject *__ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("checkP", 0); - __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_16_closestPointTo *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; __Pyx_INCREF(__pyx_v_p); - /* "collisions.py":1868 + /* "collisions.py":1954 * if cirO.collides(othershape): * def checkP(p, this): * if not this: # <<<<<<<<<<<<<< * p = self.closestPointTo(Point(*p)) * op = othershape.closestPointTo(Point(*p)) */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_this); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1868, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_this); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 1954, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { - /* "collisions.py":1869 + /* "collisions.py":1955 * def checkP(p, this): * if not this: * p = self.closestPointTo(Point(*p)) # <<<<<<<<<<<<<< * op = othershape.closestPointTo(Point(*p)) * return (p, (op[0]-p[0])**2+(op[1]-p[1])**2) */ - if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1869, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1869, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1955, __pyx_L1_error) } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Point); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1869, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Point); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_p); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1869, __pyx_L1_error) + __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_p); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1869, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -60909,14 +63937,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_14closestPointTo_checkP(PyObject *__ __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1869, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_p, __pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1868 + /* "collisions.py":1954 * if cirO.collides(othershape): * def checkP(p, this): * if not this: # <<<<<<<<<<<<<< @@ -60925,21 +63953,21 @@ static PyObject *__pyx_pf_10collisions_3Arc_14closestPointTo_checkP(PyObject *__ */ } - /* "collisions.py":1870 + /* "collisions.py":1956 * if not this: * p = self.closestPointTo(Point(*p)) * op = othershape.closestPointTo(Point(*p)) # <<<<<<<<<<<<<< * return (p, (op[0]-p[0])**2+(op[1]-p[1])**2) * alls = [ */ - if (unlikely(!__pyx_cur_scope->__pyx_v_othershape)) { __Pyx_RaiseClosureNameError("othershape"); __PYX_ERR(0, 1870, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1870, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_othershape)) { __Pyx_RaiseClosureNameError("othershape"); __PYX_ERR(0, 1956, __pyx_L1_error) } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1870, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_p); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1870, __pyx_L1_error) + __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_p); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1870, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -60962,14 +63990,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_14closestPointTo_checkP(PyObject *__ __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1870, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1956, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_op = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":1871 + /* "collisions.py":1957 * p = self.closestPointTo(Point(*p)) * op = othershape.closestPointTo(Point(*p)) * return (p, (op[0]-p[0])**2+(op[1]-p[1])**2) # <<<<<<<<<<<<<< @@ -60977,45 +64005,45 @@ static PyObject *__pyx_pf_10collisions_3Arc_14closestPointTo_checkP(PyObject *__ * checkP(i, True) for i in self.endPoints() */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_op, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1871, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_op, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1871, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1871, __pyx_L1_error) + __pyx_t_5 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Power(__pyx_t_5, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1871, __pyx_L1_error) + __pyx_t_4 = PyNumber_Power(__pyx_t_5, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_op, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1871, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_op, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1871, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyNumber_Subtract(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1871, __pyx_L1_error) + __pyx_t_6 = PyNumber_Subtract(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Power(__pyx_t_6, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1871, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_6, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1871, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1871, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1957, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_p); __Pyx_GIVEREF(__pyx_v_p); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_p)) __PYX_ERR(0, 1871, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_p)) __PYX_ERR(0, 1957, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6)) __PYX_ERR(0, 1871, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6)) __PYX_ERR(0, 1957, __pyx_L1_error); __pyx_t_6 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":1867 + /* "collisions.py":1953 * cirO = Circle(self.x, self.y, self.r) * if cirO.collides(othershape): * def checkP(p, this): # <<<<<<<<<<<<<< @@ -61040,7 +64068,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_14closestPointTo_checkP(PyObject *__ return __pyx_r; } -/* "collisions.py":1879 +/* "collisions.py":1965 * checkP(i, False) for i in cirO.whereCollides(othershape) * ] * alls.sort(key=lambda i: i[1]) # <<<<<<<<<<<<<< @@ -61101,12 +64129,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1879, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1965, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda18") < 0)) __PYX_ERR(0, 1879, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda18") < 0)) __PYX_ERR(0, 1965, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -61117,7 +64145,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda18", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1879, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda18", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1965, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -61153,7 +64181,7 @@ static PyObject *__pyx_lambda_funcdef_lambda18(CYTHON_UNUSED PyObject *__pyx_sel int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda18", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1879, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -61170,7 +64198,7 @@ static PyObject *__pyx_lambda_funcdef_lambda18(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "collisions.py":1917 +/* "collisions.py":2003 * d = (cp[0]-ocp[0])**2+(cp[1]-ocp[1])**2 * closests.append((cp, d)) * closests.sort(key=lambda x: x[1]) # <<<<<<<<<<<<<< @@ -61231,12 +64259,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1917, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2003, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda19") < 0)) __PYX_ERR(0, 1917, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda19") < 0)) __PYX_ERR(0, 2003, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -61247,7 +64275,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda19", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1917, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda19", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2003, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -61283,7 +64311,7 @@ static PyObject *__pyx_lambda_funcdef_lambda19(CYTHON_UNUSED PyObject *__pyx_sel int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda19", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1917, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -61300,7 +64328,7 @@ static PyObject *__pyx_lambda_funcdef_lambda19(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "collisions.py":1840 +/* "collisions.py":1926 * return othershape._where(self) * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLike|Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -61309,7 +64337,7 @@ static PyObject *__pyx_lambda_funcdef_lambda19(CYTHON_UNUSED PyObject *__pyx_sel */ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape, PyObject *__pyx_v_returnAll) { - struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_16_closestPointTo *__pyx_cur_scope; PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; PyObject *__pyx_v_phi = NULL; @@ -61348,11 +64376,11 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("closestPointTo", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo *)__pyx_tp_new_10collisions___pyx_scope_struct_15_closestPointTo(__pyx_ptype_10collisions___pyx_scope_struct_15_closestPointTo, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_16_closestPointTo *)__pyx_tp_new_10collisions___pyx_scope_struct_16_closestPointTo(__pyx_ptype_10collisions___pyx_scope_struct_16_closestPointTo, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_16_closestPointTo *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 1840, __pyx_L1_error) + __PYX_ERR(0, 1926, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -61363,18 +64391,18 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __Pyx_INCREF(__pyx_cur_scope->__pyx_v_othershape); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_othershape); - /* "collisions.py":1851 + /* "collisions.py":1937 * pointLike|Iterable[pointLike]: The closest point(s) on this object to the other object. Whether this is an iterable or not depends on the `returnAll` parameter. * """ * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< * x, y = othershape.x - self.x, othershape.y - self.y * #if abs(x)**2 + abs(y)**2 < self.r**2: */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1851, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1851, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1851, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -61396,34 +64424,34 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1851, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1851, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1937, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":1852 + /* "collisions.py":1938 * """ * if checkShpType(othershape, ShpTyps.Point): * x, y = othershape.x - self.x, othershape.y - self.y # <<<<<<<<<<<<<< * #if abs(x)**2 + abs(y)**2 < self.r**2: * # return othershape */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1852, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1852, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1852, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1852, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1852, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1852, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -61432,23 +64460,23 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __pyx_v_y = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":1855 + /* "collisions.py":1941 * #if abs(x)**2 + abs(y)**2 < self.r**2: * # return othershape * phi = self.constrainAng(math.degrees(math.atan2(y, x))) # <<<<<<<<<<<<<< * * angle = math.radians(phi-90) */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_constrainAng); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1855, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_constrainAng); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1855, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_degrees); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1855, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_degrees); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_math); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1855, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_math); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_atan2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1855, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_atan2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -61469,7 +64497,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_y, __pyx_v_x}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1855, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -61492,7 +64520,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1855, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } @@ -61515,26 +64543,26 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1855, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_phi = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":1857 + /* "collisions.py":1943 * phi = self.constrainAng(math.degrees(math.atan2(y, x))) * * angle = math.radians(phi-90) # <<<<<<<<<<<<<< * * qx = self.x - math.sin(angle) * self.r */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1857, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_radians); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1857, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_radians); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_phi, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1857, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_phi, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_7 = NULL; __pyx_t_5 = 0; @@ -61555,25 +64583,25 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1857, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_v_angle = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":1859 + /* "collisions.py":1945 * angle = math.radians(phi-90) * * qx = self.x - math.sin(angle) * self.r # <<<<<<<<<<<<<< * qy = self.y + math.cos(angle) * self.r * if returnAll: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1859, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1859, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sin); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1859, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sin); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -61594,35 +64622,35 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_angle}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1859, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1859, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1859, __pyx_L1_error) + __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1859, __pyx_L1_error) + __pyx_t_7 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_qx = __pyx_t_7; __pyx_t_7 = 0; - /* "collisions.py":1860 + /* "collisions.py":1946 * * qx = self.x - math.sin(angle) * self.r * qy = self.y + math.cos(angle) * self.r # <<<<<<<<<<<<<< * if returnAll: * return [[qx, qy]] */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1860, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1946, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1860, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1946, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_cos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1860, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_cos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1946, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -61643,34 +64671,34 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_angle}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1860, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1946, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1860, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1946, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1860, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1946, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1860, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1946, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_qy = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":1861 + /* "collisions.py":1947 * qx = self.x - math.sin(angle) * self.r * qy = self.y + math.cos(angle) * self.r * if returnAll: # <<<<<<<<<<<<<< * return [[qx, qy]] * return qx, qy */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1861, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1947, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":1862 + /* "collisions.py":1948 * qy = self.y + math.cos(angle) * self.r * if returnAll: * return [[qx, qy]] # <<<<<<<<<<<<<< @@ -61678,24 +64706,24 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj * elif checkShpType(othershape, ShpTyps.Line): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1862, __pyx_L1_error) + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1948, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_qx); __Pyx_GIVEREF(__pyx_v_qx); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_qx)) __PYX_ERR(0, 1862, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_qx)) __PYX_ERR(0, 1948, __pyx_L1_error); __Pyx_INCREF(__pyx_v_qy); __Pyx_GIVEREF(__pyx_v_qy); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_v_qy)) __PYX_ERR(0, 1862, __pyx_L1_error); - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1862, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_v_qy)) __PYX_ERR(0, 1948, __pyx_L1_error); + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1948, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 1862, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 1948, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":1861 + /* "collisions.py":1947 * qx = self.x - math.sin(angle) * self.r * qy = self.y + math.cos(angle) * self.r * if returnAll: # <<<<<<<<<<<<<< @@ -61704,7 +64732,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj */ } - /* "collisions.py":1863 + /* "collisions.py":1949 * if returnAll: * return [[qx, qy]] * return qx, qy # <<<<<<<<<<<<<< @@ -61712,19 +64740,19 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj * cirO = Circle(self.x, self.y, self.r) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1863, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_qx); __Pyx_GIVEREF(__pyx_v_qx); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_qx)) __PYX_ERR(0, 1863, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_qx)) __PYX_ERR(0, 1949, __pyx_L1_error); __Pyx_INCREF(__pyx_v_qy); __Pyx_GIVEREF(__pyx_v_qy); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_qy)) __PYX_ERR(0, 1863, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_qy)) __PYX_ERR(0, 1949, __pyx_L1_error); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":1851 + /* "collisions.py":1937 * pointLike|Iterable[pointLike]: The closest point(s) on this object to the other object. Whether this is an iterable or not depends on the `returnAll` parameter. * """ * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< @@ -61733,18 +64761,18 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj */ } - /* "collisions.py":1864 + /* "collisions.py":1950 * return [[qx, qy]] * return qx, qy * elif checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< * cirO = Circle(self.x, self.y, self.r) * if cirO.collides(othershape): */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1864, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1864, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Line); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1864, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Line); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; @@ -61766,28 +64794,28 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1864, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1950, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1864, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1950, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { - /* "collisions.py":1865 + /* "collisions.py":1951 * return qx, qy * elif checkShpType(othershape, ShpTyps.Line): * cirO = Circle(self.x, self.y, self.r) # <<<<<<<<<<<<<< * if cirO.collides(othershape): * def checkP(p, this): */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Circle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1865, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Circle); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1865, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1865, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1865, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = NULL; __pyx_t_5 = 0; @@ -61810,21 +64838,21 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1865, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_v_cirO = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":1866 + /* "collisions.py":1952 * elif checkShpType(othershape, ShpTyps.Line): * cirO = Circle(self.x, self.y, self.r) * if cirO.collides(othershape): # <<<<<<<<<<<<<< * def checkP(p, this): * if not this: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cirO, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1866, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cirO, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1952, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; __pyx_t_5 = 0; @@ -61844,27 +64872,27 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_othershape}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1866, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1952, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1866, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1952, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { - /* "collisions.py":1867 + /* "collisions.py":1953 * cirO = Circle(self.x, self.y, self.r) * if cirO.collides(othershape): * def checkP(p, this): # <<<<<<<<<<<<<< * if not this: * p = self.closestPointTo(Point(*p)) */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_14closestPointTo_1checkP, 0, __pyx_n_s_Arc_closestPointTo_locals_checkP, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1867, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_14closestPointTo_1checkP, 0, __pyx_n_s_Arc_closestPointTo_locals_checkP, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_checkP = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":1876 + /* "collisions.py":1962 * ] + [ * checkP(i, False) for i in othershape.toPoints() * ] + [ # <<<<<<<<<<<<<< @@ -61873,24 +64901,24 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj */ { /* enter inner scope */ - /* "collisions.py":1872 + /* "collisions.py":1958 * op = othershape.closestPointTo(Point(*p)) * return (p, (op[0]-p[0])**2+(op[1]-p[1])**2) * alls = [ # <<<<<<<<<<<<<< * checkP(i, True) for i in self.endPoints() * ] + [ */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1872, __pyx_L8_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1958, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); - /* "collisions.py":1873 + /* "collisions.py":1959 * return (p, (op[0]-p[0])**2+(op[1]-p[1])**2) * alls = [ * checkP(i, True) for i in self.endPoints() # <<<<<<<<<<<<<< * ] + [ * checkP(i, False) for i in othershape.toPoints() */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_endPoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1873, __pyx_L8_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_endPoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1959, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = NULL; __pyx_t_5 = 0; @@ -61910,7 +64938,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1873, __pyx_L8_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1959, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -61919,9 +64947,9 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1873, __pyx_L8_error) + __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1959, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1873, __pyx_L8_error) + __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1959, __pyx_L8_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -61930,28 +64958,28 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1873, __pyx_L8_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1959, __pyx_L8_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1873, __pyx_L8_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1959, __pyx_L8_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1873, __pyx_L8_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1959, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1873, __pyx_L8_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1959, __pyx_L8_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1873, __pyx_L8_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1959, __pyx_L8_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1873, __pyx_L8_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1959, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -61961,7 +64989,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1873, __pyx_L8_error) + else __PYX_ERR(0, 1959, __pyx_L8_error) } break; } @@ -61969,9 +64997,9 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj } __Pyx_XDECREF_SET(__pyx_9genexpr29__pyx_v_i, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_pf_10collisions_3Arc_14closestPointTo_checkP(__pyx_v_checkP, __pyx_9genexpr29__pyx_v_i, Py_True); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1873, __pyx_L8_error) + __pyx_t_1 = __pyx_pf_10collisions_3Arc_14closestPointTo_checkP(__pyx_v_checkP, __pyx_9genexpr29__pyx_v_i, Py_True); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1959, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 1872, __pyx_L8_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 1958, __pyx_L8_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -61984,24 +65012,24 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj } /* exit inner scope */ { /* enter inner scope */ - /* "collisions.py":1874 + /* "collisions.py":1960 * alls = [ * checkP(i, True) for i in self.endPoints() * ] + [ # <<<<<<<<<<<<<< * checkP(i, False) for i in othershape.toPoints() * ] + [ */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1874, __pyx_L15_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1960, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_2); - /* "collisions.py":1875 + /* "collisions.py":1961 * checkP(i, True) for i in self.endPoints() * ] + [ * checkP(i, False) for i in othershape.toPoints() # <<<<<<<<<<<<<< * ] + [ * checkP(i, False) for i in cirO.whereCollides(othershape) */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1875, __pyx_L15_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1961, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -62021,7 +65049,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1875, __pyx_L15_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1961, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } @@ -62030,9 +65058,9 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1875, __pyx_L15_error) + __pyx_t_10 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1961, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1875, __pyx_L15_error) + __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1961, __pyx_L15_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -62041,28 +65069,28 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1875, __pyx_L15_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1961, __pyx_L15_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1875, __pyx_L15_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1961, __pyx_L15_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1875, __pyx_L15_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1961, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1875, __pyx_L15_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1961, __pyx_L15_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1875, __pyx_L15_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1961, __pyx_L15_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1875, __pyx_L15_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1961, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -62072,7 +65100,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1875, __pyx_L15_error) + else __PYX_ERR(0, 1961, __pyx_L15_error) } break; } @@ -62080,9 +65108,9 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj } __Pyx_XDECREF_SET(__pyx_9genexpr30__pyx_v_i, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __pyx_pf_10collisions_3Arc_14closestPointTo_checkP(__pyx_v_checkP, __pyx_9genexpr30__pyx_v_i, Py_False); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1875, __pyx_L15_error) + __pyx_t_1 = __pyx_pf_10collisions_3Arc_14closestPointTo_checkP(__pyx_v_checkP, __pyx_9genexpr30__pyx_v_i, Py_False); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1961, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 1874, __pyx_L15_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 1960, __pyx_L15_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -62094,37 +65122,37 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __pyx_L19_exit_scope:; } /* exit inner scope */ - /* "collisions.py":1874 + /* "collisions.py":1960 * alls = [ * checkP(i, True) for i in self.endPoints() * ] + [ # <<<<<<<<<<<<<< * checkP(i, False) for i in othershape.toPoints() * ] + [ */ - __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1874, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1960, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; { /* enter inner scope */ - /* "collisions.py":1876 + /* "collisions.py":1962 * ] + [ * checkP(i, False) for i in othershape.toPoints() * ] + [ # <<<<<<<<<<<<<< * checkP(i, False) for i in cirO.whereCollides(othershape) * ] */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1876, __pyx_L22_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1962, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_2); - /* "collisions.py":1877 + /* "collisions.py":1963 * checkP(i, False) for i in othershape.toPoints() * ] + [ * checkP(i, False) for i in cirO.whereCollides(othershape) # <<<<<<<<<<<<<< * ] * alls.sort(key=lambda i: i[1]) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cirO, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1877, __pyx_L22_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cirO, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1963, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -62144,7 +65172,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_othershape}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1877, __pyx_L22_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1963, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -62153,9 +65181,9 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1877, __pyx_L22_error) + __pyx_t_10 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1963, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1877, __pyx_L22_error) + __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1963, __pyx_L22_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -62164,28 +65192,28 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1877, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1963, __pyx_L22_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1877, __pyx_L22_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1963, __pyx_L22_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1877, __pyx_L22_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1963, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1877, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1963, __pyx_L22_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1877, __pyx_L22_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1963, __pyx_L22_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1877, __pyx_L22_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1963, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -62195,7 +65223,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1877, __pyx_L22_error) + else __PYX_ERR(0, 1963, __pyx_L22_error) } break; } @@ -62203,9 +65231,9 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj } __Pyx_XDECREF_SET(__pyx_9genexpr31__pyx_v_i, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_pf_10collisions_3Arc_14closestPointTo_checkP(__pyx_v_checkP, __pyx_9genexpr31__pyx_v_i, Py_False); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1877, __pyx_L22_error) + __pyx_t_3 = __pyx_pf_10collisions_3Arc_14closestPointTo_checkP(__pyx_v_checkP, __pyx_9genexpr31__pyx_v_i, Py_False); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1963, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_3); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1876, __pyx_L22_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 1962, __pyx_L22_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -62217,52 +65245,52 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __pyx_L26_exit_scope:; } /* exit inner scope */ - /* "collisions.py":1876 + /* "collisions.py":1962 * ] + [ * checkP(i, False) for i in othershape.toPoints() * ] + [ # <<<<<<<<<<<<<< * checkP(i, False) for i in cirO.whereCollides(othershape) * ] */ - __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1876, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1962, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_alls = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":1879 + /* "collisions.py":1965 * checkP(i, False) for i in cirO.whereCollides(othershape) * ] * alls.sort(key=lambda i: i[1]) # <<<<<<<<<<<<<< * if returnAll: * return [i[0] for i in alls] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_alls, __pyx_n_s_sort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1879, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_alls, __pyx_n_s_sort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1879, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_14closestPointTo_2lambda18, 0, __pyx_n_s_Arc_closestPointTo_locals_lambda, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1879, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_14closestPointTo_2lambda18, 0, __pyx_n_s_Arc_closestPointTo_locals_lambda, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_t_7) < 0) __PYX_ERR(0, 1879, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_t_7) < 0) __PYX_ERR(0, 1965, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1879, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1880 + /* "collisions.py":1966 * ] * alls.sort(key=lambda i: i[1]) * if returnAll: # <<<<<<<<<<<<<< * return [i[0] for i in alls] * return alls[0][0] */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1880, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1966, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":1881 + /* "collisions.py":1967 * alls.sort(key=lambda i: i[1]) * if returnAll: * return [i[0] for i in alls] # <<<<<<<<<<<<<< @@ -62271,7 +65299,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1881, __pyx_L30_error) + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1967, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = __pyx_v_alls; __Pyx_INCREF(__pyx_t_2); __pyx_t_10 = 0; @@ -62279,21 +65307,21 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1881, __pyx_L30_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1967, __pyx_L30_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1881, __pyx_L30_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1967, __pyx_L30_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1881, __pyx_L30_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1967, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_XDECREF_SET(__pyx_9genexpr32__pyx_v_i, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_9genexpr32__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1881, __pyx_L30_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_9genexpr32__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1967, __pyx_L30_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 1881, __pyx_L30_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 1967, __pyx_L30_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -62308,7 +65336,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __pyx_t_7 = 0; goto __pyx_L0; - /* "collisions.py":1880 + /* "collisions.py":1966 * ] * alls.sort(key=lambda i: i[1]) * if returnAll: # <<<<<<<<<<<<<< @@ -62317,7 +65345,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj */ } - /* "collisions.py":1882 + /* "collisions.py":1968 * if returnAll: * return [i[0] for i in alls] * return alls[0][0] # <<<<<<<<<<<<<< @@ -62325,16 +65353,16 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj * elif checkShpType(othershape, ShpTyps.Circle): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_alls, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1882, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_alls, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1968, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1882, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1968, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1866 + /* "collisions.py":1952 * elif checkShpType(othershape, ShpTyps.Line): * cirO = Circle(self.x, self.y, self.r) * if cirO.collides(othershape): # <<<<<<<<<<<<<< @@ -62343,7 +65371,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj */ } - /* "collisions.py":1883 + /* "collisions.py":1969 * return [i[0] for i in alls] * return alls[0][0] * return self.closestPointTo(Point(*cirO.closestPointTo(othershape)), returnAll) # <<<<<<<<<<<<<< @@ -62351,11 +65379,11 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1883, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Point); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1883, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Point); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cirO, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1883, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_cirO, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_9 = NULL; __pyx_t_5 = 0; @@ -62375,14 +65403,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_cur_scope->__pyx_v_othershape}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1883, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1883, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1883, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -62405,7 +65433,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1883, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1969, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } @@ -62413,7 +65441,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1864 + /* "collisions.py":1950 * return [[qx, qy]] * return qx, qy * elif checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< @@ -62422,18 +65450,18 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj */ } - /* "collisions.py":1884 + /* "collisions.py":1970 * return alls[0][0] * return self.closestPointTo(Point(*cirO.closestPointTo(othershape)), returnAll) * elif checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) * elif checkShpType(othershape, ShpTyps.Arc): */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1884, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1884, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Circle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1884, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Circle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -62455,15 +65483,15 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1884, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1970, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1884, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1970, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "collisions.py":1885 + /* "collisions.py":1971 * return self.closestPointTo(Point(*cirO.closestPointTo(othershape)), returnAll) * elif checkShpType(othershape, ShpTyps.Circle): * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) # <<<<<<<<<<<<<< @@ -62471,13 +65499,13 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj * wheres = self.whereCollides(othershape) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1885, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1971, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1885, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1971, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1885, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1971, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1885, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1971, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = NULL; __pyx_t_5 = 0; @@ -62499,7 +65527,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1885, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1971, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -62522,7 +65550,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1885, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1971, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } @@ -62530,7 +65558,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1884 + /* "collisions.py":1970 * return alls[0][0] * return self.closestPointTo(Point(*cirO.closestPointTo(othershape)), returnAll) * elif checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< @@ -62539,18 +65567,18 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj */ } - /* "collisions.py":1886 + /* "collisions.py":1972 * elif checkShpType(othershape, ShpTyps.Circle): * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) * elif checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< * wheres = self.whereCollides(othershape) * if wheres != []: */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1886, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1886, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Arc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1886, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Arc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -62572,22 +65600,22 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1886, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1886, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1972, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "collisions.py":1887 + /* "collisions.py":1973 * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) * elif checkShpType(othershape, ShpTyps.Arc): * wheres = self.whereCollides(othershape) # <<<<<<<<<<<<<< * if wheres != []: * if returnAll: */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1887, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1973, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = NULL; __pyx_t_5 = 0; @@ -62607,39 +65635,39 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_othershape}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1887, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1973, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_v_wheres = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":1888 + /* "collisions.py":1974 * elif checkShpType(othershape, ShpTyps.Arc): * wheres = self.whereCollides(othershape) * if wheres != []: # <<<<<<<<<<<<<< * if returnAll: * return wheres */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1888, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyObject_RichCompare(__pyx_v_wheres, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1888, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_v_wheres, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1974, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1888, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1974, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_6) { - /* "collisions.py":1889 + /* "collisions.py":1975 * wheres = self.whereCollides(othershape) * if wheres != []: * if returnAll: # <<<<<<<<<<<<<< * return wheres * return wheres[0] */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1889, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1975, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":1890 + /* "collisions.py":1976 * if wheres != []: * if returnAll: * return wheres # <<<<<<<<<<<<<< @@ -62651,7 +65679,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __pyx_r = __pyx_v_wheres; goto __pyx_L0; - /* "collisions.py":1889 + /* "collisions.py":1975 * wheres = self.whereCollides(othershape) * if wheres != []: * if returnAll: # <<<<<<<<<<<<<< @@ -62660,7 +65688,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj */ } - /* "collisions.py":1891 + /* "collisions.py":1977 * if returnAll: * return wheres * return wheres[0] # <<<<<<<<<<<<<< @@ -62668,13 +65696,13 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj * phi = (math.degrees(math.atan2(y, x))) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_wheres, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1891, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_wheres, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1977, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; - /* "collisions.py":1888 + /* "collisions.py":1974 * elif checkShpType(othershape, ShpTyps.Arc): * wheres = self.whereCollides(othershape) * if wheres != []: # <<<<<<<<<<<<<< @@ -62683,26 +65711,26 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj */ } - /* "collisions.py":1892 + /* "collisions.py":1978 * return wheres * return wheres[0] * x, y = self.x - othershape.x, self.y - othershape.y # <<<<<<<<<<<<<< * phi = (math.degrees(math.atan2(y, x))) * if Circle(self.x, self.y, self.r).collides(othershape): */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1892, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1892, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1892, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1892, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1892, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1892, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -62711,21 +65739,21 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __pyx_v_y = __pyx_t_4; __pyx_t_4 = 0; - /* "collisions.py":1893 + /* "collisions.py":1979 * return wheres[0] * x, y = self.x - othershape.x, self.y - othershape.y * phi = (math.degrees(math.atan2(y, x))) # <<<<<<<<<<<<<< * if Circle(self.x, self.y, self.r).collides(othershape): * phi -= 180 */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1893, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_degrees); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1893, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_degrees); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1893, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_atan2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1893, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_atan2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -62746,7 +65774,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_y, __pyx_v_x}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1893, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -62769,27 +65797,27 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1893, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_v_phi = __pyx_t_4; __pyx_t_4 = 0; - /* "collisions.py":1894 + /* "collisions.py":1980 * x, y = self.x - othershape.x, self.y - othershape.y * phi = (math.degrees(math.atan2(y, x))) * if Circle(self.x, self.y, self.r).collides(othershape): # <<<<<<<<<<<<<< * phi -= 180 * angle = math.radians(othershape.constrainAng(phi%360)-90) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Circle); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1894, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Circle); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1894, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1894, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1894, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = NULL; __pyx_t_5 = 0; @@ -62812,11 +65840,11 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1894, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1894, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; @@ -62837,27 +65865,27 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_cur_scope->__pyx_v_othershape}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1894, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1894, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1980, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - /* "collisions.py":1895 + /* "collisions.py":1981 * phi = (math.degrees(math.atan2(y, x))) * if Circle(self.x, self.y, self.r).collides(othershape): * phi -= 180 # <<<<<<<<<<<<<< * angle = math.radians(othershape.constrainAng(phi%360)-90) * */ - __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_phi, __pyx_int_180, 0xB4, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1895, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_phi, __pyx_int_180, 0xB4, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1981, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF_SET(__pyx_v_phi, __pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":1894 + /* "collisions.py":1980 * x, y = self.x - othershape.x, self.y - othershape.y * phi = (math.degrees(math.atan2(y, x))) * if Circle(self.x, self.y, self.r).collides(othershape): # <<<<<<<<<<<<<< @@ -62866,21 +65894,21 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj */ } - /* "collisions.py":1896 + /* "collisions.py":1982 * if Circle(self.x, self.y, self.r).collides(othershape): * phi -= 180 * angle = math.radians(othershape.constrainAng(phi%360)-90) # <<<<<<<<<<<<<< * * qx = othershape.x - math.sin(angle) * othershape.r */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1896, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_radians); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1896, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_radians); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_constrainAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1896, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_constrainAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_v_phi, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1896, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_v_phi, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = NULL; __pyx_t_5 = 0; @@ -62901,11 +65929,11 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1896, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_3, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1896, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_3, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -62927,25 +65955,25 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1896, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1982, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __pyx_v_angle = __pyx_t_4; __pyx_t_4 = 0; - /* "collisions.py":1898 + /* "collisions.py":1984 * angle = math.radians(othershape.constrainAng(phi%360)-90) * * qx = othershape.x - math.sin(angle) * othershape.r # <<<<<<<<<<<<<< * qy = othershape.y + math.cos(angle) * othershape.r * */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1898, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1898, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1898, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -62966,35 +65994,35 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_angle}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1898, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1898, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1898, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1898, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_qx = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":1899 + /* "collisions.py":1985 * * qx = othershape.x - math.sin(angle) * othershape.r * qy = othershape.y + math.cos(angle) * othershape.r # <<<<<<<<<<<<<< * * x, y = qx - self.x, qy - self.y */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1899, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1899, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_cos); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1899, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_cos); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -63015,38 +66043,38 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_angle}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1899, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1899, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1899, __pyx_L1_error) + __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1899, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1985, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_v_qy = __pyx_t_7; __pyx_t_7 = 0; - /* "collisions.py":1901 + /* "collisions.py":1987 * qy = othershape.y + math.cos(angle) * othershape.r * * x, y = qx - self.x, qy - self.y # <<<<<<<<<<<<<< * phi = (math.degrees(math.atan2(y, x))) % 360 * angle = math.radians(self.constrainAng(phi)-90) */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1901, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1987, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PyNumber_Subtract(__pyx_v_qx, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1901, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_v_qx, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1987, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1901, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1987, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_qy, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1901, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_v_qy, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1987, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_4); @@ -63054,21 +66082,21 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1902 + /* "collisions.py":1988 * * x, y = qx - self.x, qy - self.y * phi = (math.degrees(math.atan2(y, x))) % 360 # <<<<<<<<<<<<<< * angle = math.radians(self.constrainAng(phi)-90) * */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1902, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_degrees); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1902, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_degrees); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1902, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_atan2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1902, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_atan2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -63089,7 +66117,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_y, __pyx_v_x}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1902, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -63112,29 +66140,29 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1902, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_7 = __Pyx_PyInt_RemainderObjC(__pyx_t_3, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1902, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_RemainderObjC(__pyx_t_3, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_phi, __pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1903 + /* "collisions.py":1989 * x, y = qx - self.x, qy - self.y * phi = (math.degrees(math.atan2(y, x))) % 360 * angle = math.radians(self.constrainAng(phi)-90) # <<<<<<<<<<<<<< * * qx = self.x - math.sin(angle) * self.r */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1903, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_radians); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1903, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_radians); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_constrainAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1903, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_constrainAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; __pyx_t_5 = 0; @@ -63154,11 +66182,11 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_phi}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1903, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_3, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1903, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_3, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -63180,25 +66208,25 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1903, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1989, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF_SET(__pyx_v_angle, __pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1905 + /* "collisions.py":1991 * angle = math.radians(self.constrainAng(phi)-90) * * qx = self.x - math.sin(angle) * self.r # <<<<<<<<<<<<<< * qy = self.y + math.cos(angle) * self.r * if returnAll: */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1905, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1905, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1905, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -63219,35 +66247,35 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_angle}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1905, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1905, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1905, __pyx_L1_error) + __pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Subtract(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1905, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_qx, __pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1906 + /* "collisions.py":1992 * * qx = self.x - math.sin(angle) * self.r * qy = self.y + math.cos(angle) * self.r # <<<<<<<<<<<<<< * if returnAll: * return [[qx, qy]] */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1906, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_math); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1906, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_math); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_cos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1906, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_cos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; @@ -63268,34 +66296,34 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_angle}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1906, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1906, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyNumber_Multiply(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1906, __pyx_L1_error) + __pyx_t_7 = PyNumber_Multiply(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1906, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF_SET(__pyx_v_qy, __pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":1907 + /* "collisions.py":1993 * qx = self.x - math.sin(angle) * self.r * qy = self.y + math.cos(angle) * self.r * if returnAll: # <<<<<<<<<<<<<< * return [[qx, qy]] * return qx, qy */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1907, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1993, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":1908 + /* "collisions.py":1994 * qy = self.y + math.cos(angle) * self.r * if returnAll: * return [[qx, qy]] # <<<<<<<<<<<<<< @@ -63303,24 +66331,24 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj * else: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1908, __pyx_L1_error) + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1994, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_qx); __Pyx_GIVEREF(__pyx_v_qx); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_qx)) __PYX_ERR(0, 1908, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_qx)) __PYX_ERR(0, 1994, __pyx_L1_error); __Pyx_INCREF(__pyx_v_qy); __Pyx_GIVEREF(__pyx_v_qy); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_v_qy)) __PYX_ERR(0, 1908, __pyx_L1_error); - __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1908, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_v_qy)) __PYX_ERR(0, 1994, __pyx_L1_error); + __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1994, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_4)) __PYX_ERR(0, 1908, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_4)) __PYX_ERR(0, 1994, __pyx_L1_error); __pyx_t_4 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; - /* "collisions.py":1907 + /* "collisions.py":1993 * qx = self.x - math.sin(angle) * self.r * qy = self.y + math.cos(angle) * self.r * if returnAll: # <<<<<<<<<<<<<< @@ -63329,7 +66357,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj */ } - /* "collisions.py":1909 + /* "collisions.py":1995 * if returnAll: * return [[qx, qy]] * return qx, qy # <<<<<<<<<<<<<< @@ -63337,19 +66365,19 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj * closests = [] */ __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1909, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1995, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_v_qx); __Pyx_GIVEREF(__pyx_v_qx); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_qx)) __PYX_ERR(0, 1909, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_qx)) __PYX_ERR(0, 1995, __pyx_L1_error); __Pyx_INCREF(__pyx_v_qy); __Pyx_GIVEREF(__pyx_v_qy); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_qy)) __PYX_ERR(0, 1909, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_qy)) __PYX_ERR(0, 1995, __pyx_L1_error); __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; - /* "collisions.py":1886 + /* "collisions.py":1972 * elif checkShpType(othershape, ShpTyps.Circle): * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) * elif checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< @@ -63358,7 +66386,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj */ } - /* "collisions.py":1911 + /* "collisions.py":1997 * return qx, qy * else: * closests = [] # <<<<<<<<<<<<<< @@ -63366,19 +66394,19 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj * cp = self.closestPointTo(ln) */ /*else*/ { - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1911, __pyx_L1_error) + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1997, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_v_closests = ((PyObject*)__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1912 + /* "collisions.py":1998 * else: * closests = [] * for ln in othershape.toLines(): # <<<<<<<<<<<<<< * cp = self.closestPointTo(ln) * ocp = othershape.closestPointTo(Point(*cp)) */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_toLines); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1912, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_toLines); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; @@ -63398,7 +66426,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1912, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -63407,9 +66435,9 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1912, __pyx_L1_error) + __pyx_t_10 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1912, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1998, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; for (;;) { @@ -63418,28 +66446,28 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1912, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1998, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1912, __pyx_L1_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1998, __pyx_L1_error) #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1912, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1912, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1998, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1912, __pyx_L1_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_10); __Pyx_INCREF(__pyx_t_7); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1998, __pyx_L1_error) #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1912, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1998, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -63449,7 +66477,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 1912, __pyx_L1_error) + else __PYX_ERR(0, 1998, __pyx_L1_error) } break; } @@ -63458,14 +66486,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __Pyx_XDECREF_SET(__pyx_v_ln, __pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1913 + /* "collisions.py":1999 * closests = [] * for ln in othershape.toLines(): * cp = self.closestPointTo(ln) # <<<<<<<<<<<<<< * ocp = othershape.closestPointTo(Point(*cp)) * d = (cp[0]-ocp[0])**2+(cp[1]-ocp[1])**2 */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1913, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_2 = NULL; __pyx_t_5 = 0; @@ -63485,27 +66513,27 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_ln}; __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1913, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1999, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_XDECREF_SET(__pyx_v_cp, __pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1914 + /* "collisions.py":2000 * for ln in othershape.toLines(): * cp = self.closestPointTo(ln) * ocp = othershape.closestPointTo(Point(*cp)) # <<<<<<<<<<<<<< * d = (cp[0]-ocp[0])**2+(cp[1]-ocp[1])**2 * closests.append((cp, d)) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1914, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Point); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1914, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Point); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_cp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1914, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_cp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1914, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -63528,68 +66556,68 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1914, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2000, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_XDECREF_SET(__pyx_v_ocp, __pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1915 + /* "collisions.py":2001 * cp = self.closestPointTo(ln) * ocp = othershape.closestPointTo(Point(*cp)) * d = (cp[0]-ocp[0])**2+(cp[1]-ocp[1])**2 # <<<<<<<<<<<<<< * closests.append((cp, d)) * closests.sort(key=lambda x: x[1]) */ - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_cp, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1915, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_cp, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_ocp, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1915, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_ocp, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyNumber_Subtract(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1915, __pyx_L1_error) + __pyx_t_9 = PyNumber_Subtract(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Power(__pyx_t_9, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1915, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_9, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_cp, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1915, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_cp, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_ocp, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1915, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_ocp, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = PyNumber_Subtract(__pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1915, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1915, __pyx_L1_error) + __pyx_t_7 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1915, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":1916 + /* "collisions.py":2002 * ocp = othershape.closestPointTo(Point(*cp)) * d = (cp[0]-ocp[0])**2+(cp[1]-ocp[1])**2 * closests.append((cp, d)) # <<<<<<<<<<<<<< * closests.sort(key=lambda x: x[1]) * if returnAll: */ - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1916, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2002, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_cp); __Pyx_GIVEREF(__pyx_v_cp); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cp)) __PYX_ERR(0, 1916, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cp)) __PYX_ERR(0, 2002, __pyx_L1_error); __Pyx_INCREF(__pyx_v_d); __Pyx_GIVEREF(__pyx_v_d); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_d)) __PYX_ERR(0, 1916, __pyx_L1_error); - __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_closests, __pyx_t_1); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 1916, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_d)) __PYX_ERR(0, 2002, __pyx_L1_error); + __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_closests, __pyx_t_1); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 2002, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":1912 + /* "collisions.py":1998 * else: * closests = [] * for ln in othershape.toLines(): # <<<<<<<<<<<<<< @@ -63599,38 +66627,38 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":1917 + /* "collisions.py":2003 * d = (cp[0]-ocp[0])**2+(cp[1]-ocp[1])**2 * closests.append((cp, d)) * closests.sort(key=lambda x: x[1]) # <<<<<<<<<<<<<< * if returnAll: * return [i[0] for i in closests] */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_closests, __pyx_n_s_sort); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1917, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_closests, __pyx_n_s_sort); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1917, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_14closestPointTo_3lambda19, 0, __pyx_n_s_Arc_closestPointTo_locals_lambda, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1917, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_14closestPointTo_3lambda19, 0, __pyx_n_s_Arc_closestPointTo_locals_lambda, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_t_7) < 0) __PYX_ERR(0, 1917, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_t_7) < 0) __PYX_ERR(0, 2003, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1917, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1918 + /* "collisions.py":2004 * closests.append((cp, d)) * closests.sort(key=lambda x: x[1]) * if returnAll: # <<<<<<<<<<<<<< * return [i[0] for i in closests] * return closests[0][0] */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1918, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2004, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":1919 + /* "collisions.py":2005 * closests.sort(key=lambda x: x[1]) * if returnAll: * return [i[0] for i in closests] # <<<<<<<<<<<<<< @@ -63639,7 +66667,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1919, __pyx_L45_error) + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2005, __pyx_L45_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_1 = __pyx_v_closests; __Pyx_INCREF(__pyx_t_1); __pyx_t_10 = 0; @@ -63647,21 +66675,21 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 1919, __pyx_L45_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2005, __pyx_L45_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 1919, __pyx_L45_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 2005, __pyx_L45_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1919, __pyx_L45_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2005, __pyx_L45_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XDECREF_SET(__pyx_9genexpr33__pyx_v_i, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_9genexpr33__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1919, __pyx_L45_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_9genexpr33__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2005, __pyx_L45_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 1919, __pyx_L45_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 2005, __pyx_L45_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -63676,7 +66704,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj __pyx_t_7 = 0; goto __pyx_L0; - /* "collisions.py":1918 + /* "collisions.py":2004 * closests.append((cp, d)) * closests.sort(key=lambda x: x[1]) * if returnAll: # <<<<<<<<<<<<<< @@ -63685,7 +66713,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj */ } - /* "collisions.py":1920 + /* "collisions.py":2006 * if returnAll: * return [i[0] for i in closests] * return closests[0][0] # <<<<<<<<<<<<<< @@ -63693,9 +66721,9 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj * def constrainAng(self, phi: Number) -> Number: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_closests, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1920, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt_List(__pyx_v_closests, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1920, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2006, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_r = __pyx_t_1; @@ -63703,7 +66731,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj goto __pyx_L0; } - /* "collisions.py":1840 + /* "collisions.py":1926 * return othershape._where(self) * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLike|Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -63749,7 +66777,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12closestPointTo(CYTHON_UNUSED PyObj return __pyx_r; } -/* "collisions.py":1922 +/* "collisions.py":2008 * return closests[0][0] * * def constrainAng(self, phi: Number) -> Number: # <<<<<<<<<<<<<< @@ -63813,7 +66841,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1922, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2008, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -63821,14 +66849,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1922, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2008, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("constrainAng", 1, 2, 2, 1); __PYX_ERR(0, 1922, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("constrainAng", 1, 2, 2, 1); __PYX_ERR(0, 2008, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "constrainAng") < 0)) __PYX_ERR(0, 1922, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "constrainAng") < 0)) __PYX_ERR(0, 2008, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -63841,7 +66869,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("constrainAng", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1922, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("constrainAng", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2008, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -63868,7 +66896,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "collisions.py":1925 +/* "collisions.py":2011 * self.startAng, self.endAng = self.startAng % 360, self.endAng % 360 * phi = phi % 360 * def angular_distance(a, b): # <<<<<<<<<<<<<< @@ -63932,7 +66960,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1925, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2011, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -63940,14 +66968,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1925, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2011, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("angular_distance", 1, 2, 2, 1); __PYX_ERR(0, 1925, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("angular_distance", 1, 2, 2, 1); __PYX_ERR(0, 2011, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "angular_distance") < 0)) __PYX_ERR(0, 1925, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "angular_distance") < 0)) __PYX_ERR(0, 2011, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -63960,7 +66988,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("angular_distance", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1925, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("angular_distance", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2011, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -64000,7 +67028,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12constrainAng_angular_distance(CYTH int __pyx_clineno = 0; __Pyx_RefNannySetupContext("angular_distance", 1); - /* "collisions.py":1926 + /* "collisions.py":2012 * phi = phi % 360 * def angular_distance(a, b): * return min(abs(a - b), 360 - abs(a - b)) # <<<<<<<<<<<<<< @@ -64008,21 +67036,21 @@ static PyObject *__pyx_pf_10collisions_3Arc_12constrainAng_angular_distance(CYTH * if phi < self.startAng and phi > self.endAng: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyNumber_Subtract(__pyx_v_a, __pyx_v_b); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1926, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_v_a, __pyx_v_b); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2012, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1926, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2012, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_SubtractCObj(__pyx_int_360, __pyx_t_2, 0x168, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1926, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_SubtractCObj(__pyx_int_360, __pyx_t_2, 0x168, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2012, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Subtract(__pyx_v_a, __pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1926, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_v_a, __pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2012, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyNumber_Absolute(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1926, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyNumber_Absolute(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2012, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1926, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1926, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2012, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2012, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __Pyx_INCREF(__pyx_t_1); @@ -64038,7 +67066,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12constrainAng_angular_distance(CYTH __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1925 + /* "collisions.py":2011 * self.startAng, self.endAng = self.startAng % 360, self.endAng % 360 * phi = phi % 360 * def angular_distance(a, b): # <<<<<<<<<<<<<< @@ -64060,7 +67088,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_12constrainAng_angular_distance(CYTH return __pyx_r; } -/* "collisions.py":1922 +/* "collisions.py":2008 * return closests[0][0] * * def constrainAng(self, phi: Number) -> Number: # <<<<<<<<<<<<<< @@ -64085,129 +67113,129 @@ static PyObject *__pyx_pf_10collisions_3Arc_14constrainAng(CYTHON_UNUSED PyObjec __Pyx_RefNannySetupContext("constrainAng", 0); __Pyx_INCREF(__pyx_v_phi); - /* "collisions.py":1923 + /* "collisions.py":2009 * * def constrainAng(self, phi: Number) -> Number: * self.startAng, self.endAng = self.startAng % 360, self.endAng % 360 # <<<<<<<<<<<<<< * phi = phi % 360 * def angular_distance(a, b): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1923, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_t_1, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1923, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_t_1, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1923, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_RemainderObjC(__pyx_t_1, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1923, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_RemainderObjC(__pyx_t_1, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2009, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_startAng, __pyx_t_2) < 0) __PYX_ERR(0, 1923, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_startAng, __pyx_t_2) < 0) __PYX_ERR(0, 2009, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_endAng, __pyx_t_3) < 0) __PYX_ERR(0, 1923, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_endAng, __pyx_t_3) < 0) __PYX_ERR(0, 2009, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1924 + /* "collisions.py":2010 * def constrainAng(self, phi: Number) -> Number: * self.startAng, self.endAng = self.startAng % 360, self.endAng % 360 * phi = phi % 360 # <<<<<<<<<<<<<< * def angular_distance(a, b): * return min(abs(a - b), 360 - abs(a - b)) */ - __pyx_t_3 = __Pyx_PyInt_RemainderObjC(__pyx_v_phi, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1924, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_RemainderObjC(__pyx_v_phi, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2010, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_phi, __pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1925 + /* "collisions.py":2011 * self.startAng, self.endAng = self.startAng % 360, self.endAng % 360 * phi = phi % 360 * def angular_distance(a, b): # <<<<<<<<<<<<<< * return min(abs(a - b), 360 - abs(a - b)) * if self.endAng < self.startAng: */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_12constrainAng_1angular_distance, 0, __pyx_n_s_Arc_constrainAng_locals_angular, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1925, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_12constrainAng_1angular_distance, 0, __pyx_n_s_Arc_constrainAng_locals_angular, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2011, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_angular_distance = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":1927 + /* "collisions.py":2013 * def angular_distance(a, b): * return min(abs(a - b), 360 - abs(a - b)) * if self.endAng < self.startAng: # <<<<<<<<<<<<<< * if phi < self.startAng and phi > self.endAng: * dist_to_start = angular_distance(phi, self.startAng) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1927, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1927, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1927, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2013, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1927, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 2013, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { - /* "collisions.py":1928 + /* "collisions.py":2014 * return min(abs(a - b), 360 - abs(a - b)) * if self.endAng < self.startAng: * if phi < self.startAng and phi > self.endAng: # <<<<<<<<<<<<<< * dist_to_start = angular_distance(phi, self.startAng) * dist_to_end = angular_distance(phi, self.endAng) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1928, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2014, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_phi, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1928, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_v_phi, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2014, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1928, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2014, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L5_bool_binop_done; } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1928, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2014, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_phi, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1928, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_phi, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2014, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1928, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2014, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __pyx_t_5; __pyx_L5_bool_binop_done:; if (__pyx_t_4) { - /* "collisions.py":1929 + /* "collisions.py":2015 * if self.endAng < self.startAng: * if phi < self.startAng and phi > self.endAng: * dist_to_start = angular_distance(phi, self.startAng) # <<<<<<<<<<<<<< * dist_to_end = angular_distance(phi, self.endAng) * return self.startAng if dist_to_start < dist_to_end else self.endAng */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1929, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2015, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_pf_10collisions_3Arc_12constrainAng_angular_distance(__pyx_v_angular_distance, __pyx_v_phi, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1929, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_10collisions_3Arc_12constrainAng_angular_distance(__pyx_v_angular_distance, __pyx_v_phi, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2015, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_dist_to_start = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":1930 + /* "collisions.py":2016 * if phi < self.startAng and phi > self.endAng: * dist_to_start = angular_distance(phi, self.startAng) * dist_to_end = angular_distance(phi, self.endAng) # <<<<<<<<<<<<<< * return self.startAng if dist_to_start < dist_to_end else self.endAng * else: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1930, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __pyx_pf_10collisions_3Arc_12constrainAng_angular_distance(__pyx_v_angular_distance, __pyx_v_phi, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1930, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_10collisions_3Arc_12constrainAng_angular_distance(__pyx_v_angular_distance, __pyx_v_phi, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_dist_to_end = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":1931 + /* "collisions.py":2017 * dist_to_start = angular_distance(phi, self.startAng) * dist_to_end = angular_distance(phi, self.endAng) * return self.startAng if dist_to_start < dist_to_end else self.endAng # <<<<<<<<<<<<<< @@ -64215,16 +67243,16 @@ static PyObject *__pyx_pf_10collisions_3Arc_14constrainAng(CYTHON_UNUSED PyObjec * if phi > self.endAng or phi < self.startAng: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_dist_to_start, __pyx_v_dist_to_end, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1931, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1931, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_v_dist_to_start, __pyx_v_dist_to_end, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2017, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 2017, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_4) { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1931, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2017, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; } else { - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1931, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2017, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = __pyx_t_2; __pyx_t_2 = 0; @@ -64233,7 +67261,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_14constrainAng(CYTHON_UNUSED PyObjec __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1928 + /* "collisions.py":2014 * return min(abs(a - b), 360 - abs(a - b)) * if self.endAng < self.startAng: * if phi < self.startAng and phi > self.endAng: # <<<<<<<<<<<<<< @@ -64242,7 +67270,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_14constrainAng(CYTHON_UNUSED PyObjec */ } - /* "collisions.py":1927 + /* "collisions.py":2013 * def angular_distance(a, b): * return min(abs(a - b), 360 - abs(a - b)) * if self.endAng < self.startAng: # <<<<<<<<<<<<<< @@ -64252,7 +67280,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_14constrainAng(CYTHON_UNUSED PyObjec goto __pyx_L3; } - /* "collisions.py":1933 + /* "collisions.py":2019 * return self.startAng if dist_to_start < dist_to_end else self.endAng * else: * if phi > self.endAng or phi < self.startAng: # <<<<<<<<<<<<<< @@ -64260,70 +67288,70 @@ static PyObject *__pyx_pf_10collisions_3Arc_14constrainAng(CYTHON_UNUSED PyObjec * dist_to_end = angular_distance(phi, self.endAng) */ /*else*/ { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1933, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2019, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_phi, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1933, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_v_phi, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2019, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1933, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2019, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_5) { } else { __pyx_t_4 = __pyx_t_5; goto __pyx_L8_bool_binop_done; } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1933, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2019, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_phi, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1933, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_phi, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2019, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1933, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2019, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = __pyx_t_5; __pyx_L8_bool_binop_done:; if (__pyx_t_4) { - /* "collisions.py":1934 + /* "collisions.py":2020 * else: * if phi > self.endAng or phi < self.startAng: * dist_to_start = angular_distance(phi, self.startAng) # <<<<<<<<<<<<<< * dist_to_end = angular_distance(phi, self.endAng) * if dist_to_start < dist_to_end: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1934, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2020, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __pyx_pf_10collisions_3Arc_12constrainAng_angular_distance(__pyx_v_angular_distance, __pyx_v_phi, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1934, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_10collisions_3Arc_12constrainAng_angular_distance(__pyx_v_angular_distance, __pyx_v_phi, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2020, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_dist_to_start = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":1935 + /* "collisions.py":2021 * if phi > self.endAng or phi < self.startAng: * dist_to_start = angular_distance(phi, self.startAng) * dist_to_end = angular_distance(phi, self.endAng) # <<<<<<<<<<<<<< * if dist_to_start < dist_to_end: * return self.startAng */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1935, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2021, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __pyx_pf_10collisions_3Arc_12constrainAng_angular_distance(__pyx_v_angular_distance, __pyx_v_phi, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1935, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_10collisions_3Arc_12constrainAng_angular_distance(__pyx_v_angular_distance, __pyx_v_phi, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2021, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_dist_to_end = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":1936 + /* "collisions.py":2022 * dist_to_start = angular_distance(phi, self.startAng) * dist_to_end = angular_distance(phi, self.endAng) * if dist_to_start < dist_to_end: # <<<<<<<<<<<<<< * return self.startAng * else: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_dist_to_start, __pyx_v_dist_to_end, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1936, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1936, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_dist_to_start, __pyx_v_dist_to_end, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2022, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 2022, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { - /* "collisions.py":1937 + /* "collisions.py":2023 * dist_to_end = angular_distance(phi, self.endAng) * if dist_to_start < dist_to_end: * return self.startAng # <<<<<<<<<<<<<< @@ -64331,13 +67359,13 @@ static PyObject *__pyx_pf_10collisions_3Arc_14constrainAng(CYTHON_UNUSED PyObjec * return self.endAng */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1937, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2023, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1936 + /* "collisions.py":2022 * dist_to_start = angular_distance(phi, self.startAng) * dist_to_end = angular_distance(phi, self.endAng) * if dist_to_start < dist_to_end: # <<<<<<<<<<<<<< @@ -64346,7 +67374,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_14constrainAng(CYTHON_UNUSED PyObjec */ } - /* "collisions.py":1939 + /* "collisions.py":2025 * return self.startAng * else: * return self.endAng # <<<<<<<<<<<<<< @@ -64355,14 +67383,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_14constrainAng(CYTHON_UNUSED PyObjec */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1939, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; } - /* "collisions.py":1933 + /* "collisions.py":2019 * return self.startAng if dist_to_start < dist_to_end else self.endAng * else: * if phi > self.endAng or phi < self.startAng: # <<<<<<<<<<<<<< @@ -64373,7 +67401,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_14constrainAng(CYTHON_UNUSED PyObjec } __pyx_L3:; - /* "collisions.py":1940 + /* "collisions.py":2026 * else: * return self.endAng * return phi # <<<<<<<<<<<<<< @@ -64385,7 +67413,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_14constrainAng(CYTHON_UNUSED PyObjec __pyx_r = __pyx_v_phi; goto __pyx_L0; - /* "collisions.py":1922 + /* "collisions.py":2008 * return closests[0][0] * * def constrainAng(self, phi: Number) -> Number: # <<<<<<<<<<<<<< @@ -64410,7 +67438,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_14constrainAng(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "collisions.py":1942 +/* "collisions.py":2028 * return phi * * def angleInRange(self, angle: Number) -> bool: # <<<<<<<<<<<<<< @@ -64475,7 +67503,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1942, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2028, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -64483,14 +67511,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1942, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2028, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("angleInRange", 1, 2, 2, 1); __PYX_ERR(0, 1942, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("angleInRange", 1, 2, 2, 1); __PYX_ERR(0, 2028, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "angleInRange") < 0)) __PYX_ERR(0, 1942, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "angleInRange") < 0)) __PYX_ERR(0, 2028, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -64503,7 +67531,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("angleInRange", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1942, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("angleInRange", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2028, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -64543,47 +67571,47 @@ static PyObject *__pyx_pf_10collisions_3Arc_16angleInRange(CYTHON_UNUSED PyObjec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("angleInRange", 1); - /* "collisions.py":1952 + /* "collisions.py":2038 * bool: Whether or not the angle is in the range of this arc. * """ * self.startAng, self.endAng = self.startAng % 360, self.endAng % 360 # <<<<<<<<<<<<<< * if self.startAng > self.endAng: * return angle%360 >= self.startAng or angle%360 <= self.endAng */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1952, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_t_1, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1952, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_t_1, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1952, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyInt_RemainderObjC(__pyx_t_1, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1952, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_RemainderObjC(__pyx_t_1, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_startAng, __pyx_t_2) < 0) __PYX_ERR(0, 1952, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_startAng, __pyx_t_2) < 0) __PYX_ERR(0, 2038, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_endAng, __pyx_t_3) < 0) __PYX_ERR(0, 1952, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_endAng, __pyx_t_3) < 0) __PYX_ERR(0, 2038, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1953 + /* "collisions.py":2039 * """ * self.startAng, self.endAng = self.startAng % 360, self.endAng % 360 * if self.startAng > self.endAng: # <<<<<<<<<<<<<< * return angle%360 >= self.startAng or angle%360 <= self.endAng * else: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1953, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1953, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1953, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2039, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1953, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 2039, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_4) { - /* "collisions.py":1954 + /* "collisions.py":2040 * self.startAng, self.endAng = self.startAng % 360, self.endAng % 360 * if self.startAng > self.endAng: * return angle%360 >= self.startAng or angle%360 <= self.endAng # <<<<<<<<<<<<<< @@ -64591,14 +67619,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_16angleInRange(CYTHON_UNUSED PyObjec * return self.startAng <= angle%360 <= self.endAng */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_v_angle, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1954, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_v_angle, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2040, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1954, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2040, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1954, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_GE); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2040, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1954, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 2040, __pyx_L1_error) if (!__pyx_t_4) { __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { @@ -64607,11 +67635,11 @@ static PyObject *__pyx_pf_10collisions_3Arc_16angleInRange(CYTHON_UNUSED PyObjec __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L4_bool_binop_done; } - __pyx_t_5 = __Pyx_PyInt_RemainderObjC(__pyx_v_angle, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1954, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_RemainderObjC(__pyx_v_angle, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2040, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1954, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2040, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1954, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2040, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_INCREF(__pyx_t_2); @@ -64622,7 +67650,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_16angleInRange(CYTHON_UNUSED PyObjec __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":1953 + /* "collisions.py":2039 * """ * self.startAng, self.endAng = self.startAng % 360, self.endAng % 360 * if self.startAng > self.endAng: # <<<<<<<<<<<<<< @@ -64631,7 +67659,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_16angleInRange(CYTHON_UNUSED PyObjec */ } - /* "collisions.py":1956 + /* "collisions.py":2042 * return angle%360 >= self.startAng or angle%360 <= self.endAng * else: * return self.startAng <= angle%360 <= self.endAng # <<<<<<<<<<<<<< @@ -64640,16 +67668,16 @@ static PyObject *__pyx_pf_10collisions_3Arc_16angleInRange(CYTHON_UNUSED PyObjec */ /*else*/ { __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1956, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2042, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_v_angle, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1956, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_v_angle, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2042, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1956, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2042, __pyx_L1_error) if (__Pyx_PyObject_IsTrue(__pyx_t_3)) { __Pyx_DECREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1956, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2042, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1956, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2042, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -64659,7 +67687,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_16angleInRange(CYTHON_UNUSED PyObjec goto __pyx_L0; } - /* "collisions.py":1942 + /* "collisions.py":2028 * return phi * * def angleInRange(self, angle: Number) -> bool: # <<<<<<<<<<<<<< @@ -64681,7 +67709,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_16angleInRange(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "collisions.py":1958 +/* "collisions.py":2044 * return self.startAng <= angle%360 <= self.endAng * * def endPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -64743,12 +67771,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1958, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2044, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "endPoints") < 0)) __PYX_ERR(0, 1958, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "endPoints") < 0)) __PYX_ERR(0, 2044, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -64759,7 +67787,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("endPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1958, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("endPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2044, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -64804,19 +67832,19 @@ static PyObject *__pyx_pf_10collisions_3Arc_18endPoints(CYTHON_UNUSED PyObject * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("endPoints", 1); - /* "collisions.py":1965 + /* "collisions.py":2051 * Iterable[pointLike]: The endpoints of the arc * """ * startAng = math.radians(self.startAng) # <<<<<<<<<<<<<< * endAng = math.radians(self.endAng) * return (self.x + self.r * math.cos(startAng), self.y + self.r * math.sin(startAng)), \ */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1965, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_radians); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1965, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_radians); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1965, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -64837,26 +67865,26 @@ static PyObject *__pyx_pf_10collisions_3Arc_18endPoints(CYTHON_UNUSED PyObject * __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1965, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_startAng = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":1966 + /* "collisions.py":2052 * """ * startAng = math.radians(self.startAng) * endAng = math.radians(self.endAng) # <<<<<<<<<<<<<< * return (self.x + self.r * math.cos(startAng), self.y + self.r * math.sin(startAng)), \ * (self.x + self.r * math.cos(endAng), self.y + self.r * math.sin(endAng)) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1966, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_radians); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1966, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_radians); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1966, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -64877,14 +67905,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_18endPoints(CYTHON_UNUSED PyObject * __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1966, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_endAng = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":1967 + /* "collisions.py":2053 * startAng = math.radians(self.startAng) * endAng = math.radians(self.endAng) * return (self.x + self.r * math.cos(startAng), self.y + self.r * math.sin(startAng)), \ # <<<<<<<<<<<<<< @@ -64892,13 +67920,13 @@ static PyObject *__pyx_pf_10collisions_3Arc_18endPoints(CYTHON_UNUSED PyObject * * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1967, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1967, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1967, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_cos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1967, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_cos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -64919,25 +67947,25 @@ static PyObject *__pyx_pf_10collisions_3Arc_18endPoints(CYTHON_UNUSED PyObject * PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_startAng}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1967, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_6 = PyNumber_Multiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1967, __pyx_L1_error) + __pyx_t_6 = PyNumber_Multiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1967, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1967, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1967, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1967, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sin); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1967, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sin); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -64958,41 +67986,41 @@ static PyObject *__pyx_pf_10collisions_3Arc_18endPoints(CYTHON_UNUSED PyObject * PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_startAng}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1967, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_7 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1967, __pyx_L1_error) + __pyx_t_7 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1967, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1967, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3)) __PYX_ERR(0, 1967, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3)) __PYX_ERR(0, 2053, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2)) __PYX_ERR(0, 1967, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_2)) __PYX_ERR(0, 2053, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_2 = 0; - /* "collisions.py":1968 + /* "collisions.py":2054 * endAng = math.radians(self.endAng) * return (self.x + self.r * math.cos(startAng), self.y + self.r * math.sin(startAng)), \ * (self.x + self.r * math.cos(endAng), self.y + self.r * math.sin(endAng)) # <<<<<<<<<<<<<< * * def rect(self) -> Iterable[Number]: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1968, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1968, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1968, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1968, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_cos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -65013,25 +68041,25 @@ static PyObject *__pyx_pf_10collisions_3Arc_18endPoints(CYTHON_UNUSED PyObject * PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_endAng}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1968, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_4 = PyNumber_Multiply(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1968, __pyx_L1_error) + __pyx_t_4 = PyNumber_Multiply(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1968, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1968, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1968, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1968, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sin); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1968, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sin); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -65052,47 +68080,47 @@ static PyObject *__pyx_pf_10collisions_3Arc_18endPoints(CYTHON_UNUSED PyObject * PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_endAng}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1968, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __pyx_t_8 = PyNumber_Multiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1968, __pyx_L1_error) + __pyx_t_8 = PyNumber_Multiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1968, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_4, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1968, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6)) __PYX_ERR(0, 1968, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6)) __PYX_ERR(0, 2054, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3)) __PYX_ERR(0, 1968, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3)) __PYX_ERR(0, 2054, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_3 = 0; - /* "collisions.py":1967 + /* "collisions.py":2053 * startAng = math.radians(self.startAng) * endAng = math.radians(self.endAng) * return (self.x + self.r * math.cos(startAng), self.y + self.r * math.sin(startAng)), \ # <<<<<<<<<<<<<< * (self.x + self.r * math.cos(endAng), self.y + self.r * math.sin(endAng)) * */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1967, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7)) __PYX_ERR(0, 1967, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7)) __PYX_ERR(0, 2053, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_8)) __PYX_ERR(0, 1967, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_8)) __PYX_ERR(0, 2053, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":1958 + /* "collisions.py":2044 * return self.startAng <= angle%360 <= self.endAng * * def endPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -65119,7 +68147,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_18endPoints(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "collisions.py":1970 +/* "collisions.py":2056 * (self.x + self.r * math.cos(endAng), self.y + self.r * math.sin(endAng)) * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< @@ -65181,12 +68209,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1970, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2056, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rect") < 0)) __PYX_ERR(0, 1970, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rect") < 0)) __PYX_ERR(0, 2056, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -65197,7 +68225,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1970, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2056, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -65243,14 +68271,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_20rect(CYTHON_UNUSED PyObject *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rect", 1); - /* "collisions.py":1977 + /* "collisions.py":2063 * Iterable[Number]: (min x, min y, max x, max y) * """ * eps = self.endPoints() # <<<<<<<<<<<<<< * * if self.angleInRange(270): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endPoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1977, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endPoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2063, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -65270,21 +68298,21 @@ static PyObject *__pyx_pf_10collisions_3Arc_20rect(CYTHON_UNUSED PyObject *__pyx PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1977, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2063, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_eps = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":1979 + /* "collisions.py":2065 * eps = self.endPoints() * * if self.angleInRange(270): # <<<<<<<<<<<<<< * N = self.y-self.r * else: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_angleInRange); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1979, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_angleInRange); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2065, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -65304,33 +68332,33 @@ static PyObject *__pyx_pf_10collisions_3Arc_20rect(CYTHON_UNUSED PyObject *__pyx PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_int_270}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1979, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2065, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1979, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2065, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "collisions.py":1980 + /* "collisions.py":2066 * * if self.angleInRange(270): * N = self.y-self.r # <<<<<<<<<<<<<< * else: * N = min(eps[0][1], eps[1][1]) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1980, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1980, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1980, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2066, __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_v_N = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":1979 + /* "collisions.py":2065 * eps = self.endPoints() * * if self.angleInRange(270): # <<<<<<<<<<<<<< @@ -65340,7 +68368,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_20rect(CYTHON_UNUSED PyObject *__pyx goto __pyx_L3; } - /* "collisions.py":1982 + /* "collisions.py":2068 * N = self.y-self.r * else: * N = min(eps[0][1], eps[1][1]) # <<<<<<<<<<<<<< @@ -65348,18 +68376,18 @@ static PyObject *__pyx_pf_10collisions_3Arc_20rect(CYTHON_UNUSED PyObject *__pyx * E = self.x-self.r */ /*else*/ { - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_eps, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1982, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_eps, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1982, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_eps, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1982, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_eps, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1982, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2068, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1982, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1982, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2068, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2068, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { __Pyx_INCREF(__pyx_t_2); @@ -65378,14 +68406,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_20rect(CYTHON_UNUSED PyObject *__pyx } __pyx_L3:; - /* "collisions.py":1983 + /* "collisions.py":2069 * else: * N = min(eps[0][1], eps[1][1]) * if self.angleInRange(180): # <<<<<<<<<<<<<< * E = self.x-self.r * else: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_angleInRange); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1983, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_angleInRange); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2069, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; __pyx_t_4 = 0; @@ -65405,33 +68433,33 @@ static PyObject *__pyx_pf_10collisions_3Arc_20rect(CYTHON_UNUSED PyObject *__pyx PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_int_180}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1983, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2069, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1983, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2069, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { - /* "collisions.py":1984 + /* "collisions.py":2070 * N = min(eps[0][1], eps[1][1]) * if self.angleInRange(180): * E = self.x-self.r # <<<<<<<<<<<<<< * else: * E = min(eps[0][0], eps[1][0]) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1984, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2070, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1984, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2070, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1984, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2070, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_E = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":1983 + /* "collisions.py":2069 * else: * N = min(eps[0][1], eps[1][1]) * if self.angleInRange(180): # <<<<<<<<<<<<<< @@ -65441,7 +68469,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_20rect(CYTHON_UNUSED PyObject *__pyx goto __pyx_L4; } - /* "collisions.py":1986 + /* "collisions.py":2072 * E = self.x-self.r * else: * E = min(eps[0][0], eps[1][0]) # <<<<<<<<<<<<<< @@ -65449,18 +68477,18 @@ static PyObject *__pyx_pf_10collisions_3Arc_20rect(CYTHON_UNUSED PyObject *__pyx * S = self.y+self.r */ /*else*/ { - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_eps, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1986, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_eps, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2072, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1986, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2072, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_eps, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1986, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_eps, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2072, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1986, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2072, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1986, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1986, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2072, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2072, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { __Pyx_INCREF(__pyx_t_3); @@ -65479,14 +68507,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_20rect(CYTHON_UNUSED PyObject *__pyx } __pyx_L4:; - /* "collisions.py":1987 + /* "collisions.py":2073 * else: * E = min(eps[0][0], eps[1][0]) * if self.angleInRange(90): # <<<<<<<<<<<<<< * S = self.y+self.r * else: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_angleInRange); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1987, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_angleInRange); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2073, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; __pyx_t_4 = 0; @@ -65506,33 +68534,33 @@ static PyObject *__pyx_pf_10collisions_3Arc_20rect(CYTHON_UNUSED PyObject *__pyx PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_int_90}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1987, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2073, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1987, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2073, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { - /* "collisions.py":1988 + /* "collisions.py":2074 * E = min(eps[0][0], eps[1][0]) * if self.angleInRange(90): * S = self.y+self.r # <<<<<<<<<<<<<< * else: * S = max(eps[0][1], eps[1][1]) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1988, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1988, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1988, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2074, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_S = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":1987 + /* "collisions.py":2073 * else: * E = min(eps[0][0], eps[1][0]) * if self.angleInRange(90): # <<<<<<<<<<<<<< @@ -65542,7 +68570,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_20rect(CYTHON_UNUSED PyObject *__pyx goto __pyx_L5; } - /* "collisions.py":1990 + /* "collisions.py":2076 * S = self.y+self.r * else: * S = max(eps[0][1], eps[1][1]) # <<<<<<<<<<<<<< @@ -65550,18 +68578,18 @@ static PyObject *__pyx_pf_10collisions_3Arc_20rect(CYTHON_UNUSED PyObject *__pyx * W = self.x+self.r */ /*else*/ { - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_eps, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1990, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_eps, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2076, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1990, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2076, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_eps, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1990, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_eps, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2076, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1990, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2076, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1990, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1990, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2076, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2076, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { __Pyx_INCREF(__pyx_t_1); @@ -65580,14 +68608,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_20rect(CYTHON_UNUSED PyObject *__pyx } __pyx_L5:; - /* "collisions.py":1991 + /* "collisions.py":2077 * else: * S = max(eps[0][1], eps[1][1]) * if self.angleInRange(0): # <<<<<<<<<<<<<< * W = self.x+self.r * else: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_angleInRange); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1991, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_angleInRange); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2077, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -65607,33 +68635,33 @@ static PyObject *__pyx_pf_10collisions_3Arc_20rect(CYTHON_UNUSED PyObject *__pyx PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_int_0}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1991, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2077, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1991, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2077, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "collisions.py":1992 + /* "collisions.py":2078 * S = max(eps[0][1], eps[1][1]) * if self.angleInRange(0): * W = self.x+self.r # <<<<<<<<<<<<<< * else: * W = max(eps[0][0], eps[1][0]) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1992, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2078, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1992, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2078, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1992, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2078, __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_v_W = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":1991 + /* "collisions.py":2077 * else: * S = max(eps[0][1], eps[1][1]) * if self.angleInRange(0): # <<<<<<<<<<<<<< @@ -65643,7 +68671,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_20rect(CYTHON_UNUSED PyObject *__pyx goto __pyx_L6; } - /* "collisions.py":1994 + /* "collisions.py":2080 * W = self.x+self.r * else: * W = max(eps[0][0], eps[1][0]) # <<<<<<<<<<<<<< @@ -65651,18 +68679,18 @@ static PyObject *__pyx_pf_10collisions_3Arc_20rect(CYTHON_UNUSED PyObject *__pyx * */ /*else*/ { - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_eps, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1994, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_eps, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2080, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1994, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2080, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_eps, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1994, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_eps, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2080, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1994, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2080, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1994, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1994, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2080, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2080, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { __Pyx_INCREF(__pyx_t_2); @@ -65681,7 +68709,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_20rect(CYTHON_UNUSED PyObject *__pyx } __pyx_L6:; - /* "collisions.py":1995 + /* "collisions.py":2081 * else: * W = max(eps[0][0], eps[1][0]) * return E, N, W, S # <<<<<<<<<<<<<< @@ -65689,25 +68717,25 @@ static PyObject *__pyx_pf_10collisions_3Arc_20rect(CYTHON_UNUSED PyObject *__pyx * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1995, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2081, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_E); __Pyx_GIVEREF(__pyx_v_E); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_E)) __PYX_ERR(0, 1995, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_E)) __PYX_ERR(0, 2081, __pyx_L1_error); __Pyx_INCREF(__pyx_v_N); __Pyx_GIVEREF(__pyx_v_N); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_N)) __PYX_ERR(0, 1995, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_N)) __PYX_ERR(0, 2081, __pyx_L1_error); __Pyx_INCREF(__pyx_v_W); __Pyx_GIVEREF(__pyx_v_W); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_W)) __PYX_ERR(0, 1995, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_W)) __PYX_ERR(0, 2081, __pyx_L1_error); __Pyx_INCREF(__pyx_v_S); __Pyx_GIVEREF(__pyx_v_S); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_S)) __PYX_ERR(0, 1995, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_S)) __PYX_ERR(0, 2081, __pyx_L1_error); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":1970 + /* "collisions.py":2056 * (self.x + self.r * math.cos(endAng), self.y + self.r * math.sin(endAng)) * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< @@ -65734,7 +68762,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_20rect(CYTHON_UNUSED PyObject *__pyx return __pyx_r; } -/* "collisions.py":1997 +/* "collisions.py":2083 * return E, N, W, S * * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< @@ -65742,7 +68770,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_20rect(CYTHON_UNUSED PyObject *__pyx * Finds whether a point is on a corner of this shape. */ -static PyObject *__pyx_pf_10collisions_52__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { +static PyObject *__pyx_pf_10collisions_54__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -65752,18 +68780,18 @@ static PyObject *__pyx_pf_10collisions_52__defaults__(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1997, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults17, __pyx_self)->__pyx_arg_precision); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults17, __pyx_self)->__pyx_arg_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults17, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 1997, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1997, __pyx_L1_error) + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults18, __pyx_self)->__pyx_arg_precision); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults18, __pyx_self)->__pyx_arg_precision); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults18, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 2083, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 1997, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 2083, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 1997, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 2083, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -65822,7 +68850,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_point,&__pyx_n_s_precision,0}; - __pyx_defaults17 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults17, __pyx_self); + __pyx_defaults18 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults18, __pyx_self); values[2] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_precision); if (__pyx_kwds) { Py_ssize_t kw_args; @@ -65843,7 +68871,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1997, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2083, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -65851,21 +68879,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1997, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2083, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, 1); __PYX_ERR(0, 1997, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, 1); __PYX_ERR(0, 2083, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_precision); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1997, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2083, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isCorner") < 0)) __PYX_ERR(0, 1997, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isCorner") < 0)) __PYX_ERR(0, 2083, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -65883,7 +68911,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 1997, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 2083, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -65928,14 +68956,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_22isCorner(CYTHON_UNUSED PyObject *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isCorner", 1); - /* "collisions.py":2008 + /* "collisions.py":2094 * bool: Whether the point is on a corner of this shape * """ * for p in self.toPoints(): # <<<<<<<<<<<<<< * if round(p[0], precision) == round(point[0], precision) and \ * round(p[1], precision) == round(point[1], precision): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2008, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2094, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -65955,7 +68983,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_22isCorner(CYTHON_UNUSED PyObject *_ PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2008, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2094, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -65964,9 +68992,9 @@ static PyObject *__pyx_pf_10collisions_3Arc_22isCorner(CYTHON_UNUSED PyObject *_ __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2008, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2094, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2008, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2094, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -65975,28 +69003,28 @@ static PyObject *__pyx_pf_10collisions_3Arc_22isCorner(CYTHON_UNUSED PyObject *_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2008, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2094, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 2008, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 2094, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2008, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2094, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2008, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2094, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 2008, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 2094, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2008, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2094, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -66006,7 +69034,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_22isCorner(CYTHON_UNUSED PyObject *_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2008, __pyx_L1_error) + else __PYX_ERR(0, 2094, __pyx_L1_error) } break; } @@ -66015,43 +69043,43 @@ static PyObject *__pyx_pf_10collisions_3Arc_22isCorner(CYTHON_UNUSED PyObject *_ __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2009 + /* "collisions.py":2095 * """ * for p in self.toPoints(): * if round(p[0], precision) == round(point[0], precision) and \ # <<<<<<<<<<<<<< * round(p[1], precision) == round(point[1], precision): * return True */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2009, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2009, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 2009, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 2095, __pyx_L1_error); __Pyx_INCREF(__pyx_v_precision); __Pyx_GIVEREF(__pyx_v_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_precision)) __PYX_ERR(0, 2009, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_precision)) __PYX_ERR(0, 2095, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2009, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2009, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2009, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3)) __PYX_ERR(0, 2009, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3)) __PYX_ERR(0, 2095, __pyx_L1_error); __Pyx_INCREF(__pyx_v_precision); __Pyx_GIVEREF(__pyx_v_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_precision)) __PYX_ERR(0, 2009, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_precision)) __PYX_ERR(0, 2095, __pyx_L1_error); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2009, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2095, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2009, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2095, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2009, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2095, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_9) { } else { @@ -66059,48 +69087,48 @@ static PyObject *__pyx_pf_10collisions_3Arc_22isCorner(CYTHON_UNUSED PyObject *_ goto __pyx_L6_bool_binop_done; } - /* "collisions.py":2010 + /* "collisions.py":2096 * for p in self.toPoints(): * if round(p[0], precision) == round(point[0], precision) and \ * round(p[1], precision) == round(point[1], precision): # <<<<<<<<<<<<<< * return True * return False */ - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2010, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2010, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8)) __PYX_ERR(0, 2010, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8)) __PYX_ERR(0, 2096, __pyx_L1_error); __Pyx_INCREF(__pyx_v_precision); __Pyx_GIVEREF(__pyx_v_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_precision)) __PYX_ERR(0, 2010, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_precision)) __PYX_ERR(0, 2096, __pyx_L1_error); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2010, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_point, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2010, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_point, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2010, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 2010, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 2096, __pyx_L1_error); __Pyx_INCREF(__pyx_v_precision); __Pyx_GIVEREF(__pyx_v_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_precision)) __PYX_ERR(0, 2010, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_precision)) __PYX_ERR(0, 2096, __pyx_L1_error); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2010, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_8, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2010, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_8, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2010, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2096, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __pyx_t_9; __pyx_L6_bool_binop_done:; - /* "collisions.py":2009 + /* "collisions.py":2095 * """ * for p in self.toPoints(): * if round(p[0], precision) == round(point[0], precision) and \ # <<<<<<<<<<<<<< @@ -66109,7 +69137,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_22isCorner(CYTHON_UNUSED PyObject *_ */ if (__pyx_t_7) { - /* "collisions.py":2011 + /* "collisions.py":2097 * if round(p[0], precision) == round(point[0], precision) and \ * round(p[1], precision) == round(point[1], precision): * return True # <<<<<<<<<<<<<< @@ -66122,7 +69150,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_22isCorner(CYTHON_UNUSED PyObject *_ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":2009 + /* "collisions.py":2095 * """ * for p in self.toPoints(): * if round(p[0], precision) == round(point[0], precision) and \ # <<<<<<<<<<<<<< @@ -66131,7 +69159,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_22isCorner(CYTHON_UNUSED PyObject *_ */ } - /* "collisions.py":2008 + /* "collisions.py":2094 * bool: Whether the point is on a corner of this shape * """ * for p in self.toPoints(): # <<<<<<<<<<<<<< @@ -66141,7 +69169,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_22isCorner(CYTHON_UNUSED PyObject *_ } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2012 + /* "collisions.py":2098 * round(p[1], precision) == round(point[1], precision): * return True * return False # <<<<<<<<<<<<<< @@ -66153,7 +69181,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_22isCorner(CYTHON_UNUSED PyObject *_ __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":1997 + /* "collisions.py":2083 * return E, N, W, S * * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< @@ -66176,7 +69204,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_22isCorner(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":2014 +/* "collisions.py":2100 * return False * * def toPoints(self): # <<<<<<<<<<<<<< @@ -66238,12 +69266,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2014, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2100, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toPoints") < 0)) __PYX_ERR(0, 2014, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toPoints") < 0)) __PYX_ERR(0, 2100, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -66254,7 +69282,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("toPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2014, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("toPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2100, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -66299,7 +69327,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_24toPoints(CYTHON_UNUSED PyObject *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toPoints", 1); - /* "collisions.py":2019 + /* "collisions.py":2105 * Iterable[pointLike]: Get a list of all the Points that make up this object. * """ * return [ # <<<<<<<<<<<<<< @@ -66308,50 +69336,50 @@ static PyObject *__pyx_pf_10collisions_3Arc_24toPoints(CYTHON_UNUSED PyObject *_ */ __Pyx_XDECREF(__pyx_r); - /* "collisions.py":2020 + /* "collisions.py":2106 * """ * return [ * Point(*rotate((self.x, self.y), (self.x, self.y+self.r), self.startAng-90)), # <<<<<<<<<<<<<< * Point(*rotate((self.x, self.y), (self.x, self.y+self.r), self.endAng-90)), * ] */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Point); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2020, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Point); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_rotate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2020, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_rotate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2020, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2020, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2020, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 2020, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4)) __PYX_ERR(0, 2106, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 2020, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5)) __PYX_ERR(0, 2106, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2020, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2020, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2020, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyNumber_Add(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2020, __pyx_L1_error) + __pyx_t_8 = PyNumber_Add(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2020, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5)) __PYX_ERR(0, 2020, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5)) __PYX_ERR(0, 2106, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8)) __PYX_ERR(0, 2020, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8)) __PYX_ERR(0, 2106, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2020, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_t_8, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2020, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_t_8, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -66375,62 +69403,62 @@ static PyObject *__pyx_pf_10collisions_3Arc_24toPoints(CYTHON_UNUSED PyObject *_ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2020, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2020, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2020, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2021 + /* "collisions.py":2107 * return [ * Point(*rotate((self.x, self.y), (self.x, self.y+self.r), self.startAng-90)), * Point(*rotate((self.x, self.y), (self.x, self.y+self.r), self.endAng-90)), # <<<<<<<<<<<<<< * ] * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2021, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_rotate); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2021, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_rotate); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2021, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2021, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2021, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7)) __PYX_ERR(0, 2021, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7)) __PYX_ERR(0, 2107, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6)) __PYX_ERR(0, 2021, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6)) __PYX_ERR(0, 2107, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2021, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2021, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2021, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = PyNumber_Add(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2021, __pyx_L1_error) + __pyx_t_10 = PyNumber_Add(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2021, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6)) __PYX_ERR(0, 2021, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6)) __PYX_ERR(0, 2107, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_10)) __PYX_ERR(0, 2021, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_10)) __PYX_ERR(0, 2107, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2021, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_t_10, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2021, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_t_10, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; @@ -66454,38 +69482,38 @@ static PyObject *__pyx_pf_10collisions_3Arc_24toPoints(CYTHON_UNUSED PyObject *_ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2021, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2021, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2021, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "collisions.py":2019 + /* "collisions.py":2105 * Iterable[pointLike]: Get a list of all the Points that make up this object. * """ * return [ # <<<<<<<<<<<<<< * Point(*rotate((self.x, self.y), (self.x, self.y+self.r), self.startAng-90)), * Point(*rotate((self.x, self.y), (self.x, self.y+self.r), self.endAng-90)), */ - __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2019, __pyx_L1_error) + __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2105, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(0, 2019, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_2)) __PYX_ERR(0, 2105, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_1)) __PYX_ERR(0, 2019, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_1)) __PYX_ERR(0, 2105, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "collisions.py":2014 + /* "collisions.py":2100 * return False * * def toPoints(self): # <<<<<<<<<<<<<< @@ -66512,7 +69540,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_24toPoints(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":2024 +/* "collisions.py":2110 * ] * * def copy(self) -> 'Arc': # <<<<<<<<<<<<<< @@ -66574,12 +69602,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2024, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2110, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(0, 2024, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(0, 2110, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -66590,7 +69618,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("copy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2024, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("copy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2110, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -66636,7 +69664,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_26copy(CYTHON_UNUSED PyObject *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 1); - /* "collisions.py":2028 + /* "collisions.py":2114 * Because Noah's first arc broke, now you need another one. * """ * return Arc(self.x, self.y, self.r, self.startAng, self.endAng, self.precision, self.bounciness) # <<<<<<<<<<<<<< @@ -66644,21 +69672,21 @@ static PyObject *__pyx_pf_10collisions_3Arc_26copy(CYTHON_UNUSED PyObject *__pyx * def __getitem__(self, item: int) -> Union[Number, pointLike]: */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Arc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2028, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Arc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2028, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2028, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2028, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2028, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2028, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_precision); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2028, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_precision); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2028, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = NULL; __pyx_t_11 = 0; @@ -66685,7 +69713,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_26copy(CYTHON_UNUSED PyObject *__pyx __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2028, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -66693,7 +69721,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_26copy(CYTHON_UNUSED PyObject *__pyx __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2024 + /* "collisions.py":2110 * ] * * def copy(self) -> 'Arc': # <<<<<<<<<<<<<< @@ -66721,7 +69749,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_26copy(CYTHON_UNUSED PyObject *__pyx return __pyx_r; } -/* "collisions.py":2030 +/* "collisions.py":2116 * return Arc(self.x, self.y, self.r, self.startAng, self.endAng, self.precision, self.bounciness) * * def __getitem__(self, item: int) -> Union[Number, pointLike]: # <<<<<<<<<<<<<< @@ -66785,7 +69813,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2030, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2116, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -66793,14 +69821,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2030, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2116, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 2030, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 2116, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__getitem__") < 0)) __PYX_ERR(0, 2030, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__getitem__") < 0)) __PYX_ERR(0, 2116, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -66813,7 +69841,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2030, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2116, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -66827,7 +69855,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_item), (&PyInt_Type), 0, "item", 1))) __PYX_ERR(0, 2030, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_item), (&PyInt_Type), 0, "item", 1))) __PYX_ERR(0, 2116, __pyx_L1_error) __pyx_r = __pyx_pf_10collisions_3Arc_28__getitem__(__pyx_self, __pyx_v_self, __pyx_v_item); /* function exit code */ @@ -66856,19 +69884,19 @@ static PyObject *__pyx_pf_10collisions_3Arc_28__getitem__(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 1); - /* "collisions.py":2031 + /* "collisions.py":2117 * * def __getitem__(self, item: int) -> Union[Number, pointLike]: * if item == 0: # <<<<<<<<<<<<<< * return self.x * elif item == 1: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2031, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2031, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2117, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2117, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":2032 + /* "collisions.py":2118 * def __getitem__(self, item: int) -> Union[Number, pointLike]: * if item == 0: * return self.x # <<<<<<<<<<<<<< @@ -66876,13 +69904,13 @@ static PyObject *__pyx_pf_10collisions_3Arc_28__getitem__(CYTHON_UNUSED PyObject * return self.y */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2032, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2031 + /* "collisions.py":2117 * * def __getitem__(self, item: int) -> Union[Number, pointLike]: * if item == 0: # <<<<<<<<<<<<<< @@ -66891,19 +69919,19 @@ static PyObject *__pyx_pf_10collisions_3Arc_28__getitem__(CYTHON_UNUSED PyObject */ } - /* "collisions.py":2033 + /* "collisions.py":2119 * if item == 0: * return self.x * elif item == 1: # <<<<<<<<<<<<<< * return self.y * elif item == 2: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2033, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2033, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2119, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2119, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":2034 + /* "collisions.py":2120 * return self.x * elif item == 1: * return self.y # <<<<<<<<<<<<<< @@ -66911,13 +69939,13 @@ static PyObject *__pyx_pf_10collisions_3Arc_28__getitem__(CYTHON_UNUSED PyObject * return self.r */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2034, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2033 + /* "collisions.py":2119 * if item == 0: * return self.x * elif item == 1: # <<<<<<<<<<<<<< @@ -66926,19 +69954,19 @@ static PyObject *__pyx_pf_10collisions_3Arc_28__getitem__(CYTHON_UNUSED PyObject */ } - /* "collisions.py":2035 + /* "collisions.py":2121 * elif item == 1: * return self.y * elif item == 2: # <<<<<<<<<<<<<< * return self.r * elif item == 3: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2035, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2035, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2121, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2121, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":2036 + /* "collisions.py":2122 * return self.y * elif item == 2: * return self.r # <<<<<<<<<<<<<< @@ -66946,13 +69974,13 @@ static PyObject *__pyx_pf_10collisions_3Arc_28__getitem__(CYTHON_UNUSED PyObject * return self.startAng */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2036, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2035 + /* "collisions.py":2121 * elif item == 1: * return self.y * elif item == 2: # <<<<<<<<<<<<<< @@ -66961,19 +69989,19 @@ static PyObject *__pyx_pf_10collisions_3Arc_28__getitem__(CYTHON_UNUSED PyObject */ } - /* "collisions.py":2037 + /* "collisions.py":2123 * elif item == 2: * return self.r * elif item == 3: # <<<<<<<<<<<<<< * return self.startAng * elif item == 4: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2037, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2037, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2123, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2123, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":2038 + /* "collisions.py":2124 * return self.r * elif item == 3: * return self.startAng # <<<<<<<<<<<<<< @@ -66981,13 +70009,13 @@ static PyObject *__pyx_pf_10collisions_3Arc_28__getitem__(CYTHON_UNUSED PyObject * return self.endAng */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2038, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2124, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2037 + /* "collisions.py":2123 * elif item == 2: * return self.r * elif item == 3: # <<<<<<<<<<<<<< @@ -66996,19 +70024,19 @@ static PyObject *__pyx_pf_10collisions_3Arc_28__getitem__(CYTHON_UNUSED PyObject */ } - /* "collisions.py":2039 + /* "collisions.py":2125 * elif item == 3: * return self.startAng * elif item == 4: # <<<<<<<<<<<<<< * return self.endAng * else: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2039, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2039, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2125, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_2)) { - /* "collisions.py":2040 + /* "collisions.py":2126 * return self.startAng * elif item == 4: * return self.endAng # <<<<<<<<<<<<<< @@ -67016,13 +70044,13 @@ static PyObject *__pyx_pf_10collisions_3Arc_28__getitem__(CYTHON_UNUSED PyObject * raise IndexError( */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2040, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2126, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2039 + /* "collisions.py":2125 * elif item == 3: * return self.startAng * elif item == 4: # <<<<<<<<<<<<<< @@ -67031,7 +70059,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_28__getitem__(CYTHON_UNUSED PyObject */ } - /* "collisions.py":2042 + /* "collisions.py":2128 * return self.endAng * else: * raise IndexError( # <<<<<<<<<<<<<< @@ -67040,35 +70068,35 @@ static PyObject *__pyx_pf_10collisions_3Arc_28__getitem__(CYTHON_UNUSED PyObject */ /*else*/ { - /* "collisions.py":2043 + /* "collisions.py":2129 * else: * raise IndexError( * 'List index out of range! Must be 0-4, found: '+str(item) # <<<<<<<<<<<<<< * ) * */ - __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2043, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_List_index_out_of_range_Must_be_3, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2043, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_List_index_out_of_range_Must_be_3, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2042 + /* "collisions.py":2128 * return self.endAng * else: * raise IndexError( # <<<<<<<<<<<<<< * 'List index out of range! Must be 0-4, found: '+str(item) * ) */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2042, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 2042, __pyx_L1_error) + __PYX_ERR(0, 2128, __pyx_L1_error) } - /* "collisions.py":2030 + /* "collisions.py":2116 * return Arc(self.x, self.y, self.r, self.startAng, self.endAng, self.precision, self.bounciness) * * def __getitem__(self, item: int) -> Union[Number, pointLike]: # <<<<<<<<<<<<<< @@ -67088,7 +70116,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_28__getitem__(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":2046 +/* "collisions.py":2132 * ) * * def __setitem__(self, item: int, new: Union[Number, pointLike]) -> None: # <<<<<<<<<<<<<< @@ -67155,7 +70183,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2046, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2132, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -67163,9 +70191,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2046, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2132, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 2046, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 2132, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -67173,14 +70201,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2046, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2132, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 2046, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 2132, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(0, 2046, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(0, 2132, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -67195,7 +70223,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 2046, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 2132, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -67209,7 +70237,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_item), (&PyInt_Type), 0, "item", 1))) __PYX_ERR(0, 2046, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_item), (&PyInt_Type), 0, "item", 1))) __PYX_ERR(0, 2132, __pyx_L1_error) __pyx_r = __pyx_pf_10collisions_3Arc_30__setitem__(__pyx_self, __pyx_v_self, __pyx_v_item, __pyx_v_new); /* function exit code */ @@ -67238,28 +70266,28 @@ static PyObject *__pyx_pf_10collisions_3Arc_30__setitem__(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 1); - /* "collisions.py":2047 + /* "collisions.py":2133 * * def __setitem__(self, item: int, new: Union[Number, pointLike]) -> None: * if item == 0: # <<<<<<<<<<<<<< * self.x = new * elif item == 1: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2047, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2047, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2133, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2133, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":2048 + /* "collisions.py":2134 * def __setitem__(self, item: int, new: Union[Number, pointLike]) -> None: * if item == 0: * self.x = new # <<<<<<<<<<<<<< * elif item == 1: * self.y = new */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_v_new) < 0) __PYX_ERR(0, 2048, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_v_new) < 0) __PYX_ERR(0, 2134, __pyx_L1_error) - /* "collisions.py":2047 + /* "collisions.py":2133 * * def __setitem__(self, item: int, new: Union[Number, pointLike]) -> None: * if item == 0: # <<<<<<<<<<<<<< @@ -67269,28 +70297,28 @@ static PyObject *__pyx_pf_10collisions_3Arc_30__setitem__(CYTHON_UNUSED PyObject goto __pyx_L3; } - /* "collisions.py":2049 + /* "collisions.py":2135 * if item == 0: * self.x = new * elif item == 1: # <<<<<<<<<<<<<< * self.y = new * elif item == 2: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2049, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2049, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2135, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2135, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":2050 + /* "collisions.py":2136 * self.x = new * elif item == 1: * self.y = new # <<<<<<<<<<<<<< * elif item == 2: * self.r = new */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_v_new) < 0) __PYX_ERR(0, 2050, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_v_new) < 0) __PYX_ERR(0, 2136, __pyx_L1_error) - /* "collisions.py":2049 + /* "collisions.py":2135 * if item == 0: * self.x = new * elif item == 1: # <<<<<<<<<<<<<< @@ -67300,28 +70328,28 @@ static PyObject *__pyx_pf_10collisions_3Arc_30__setitem__(CYTHON_UNUSED PyObject goto __pyx_L3; } - /* "collisions.py":2051 + /* "collisions.py":2137 * elif item == 1: * self.y = new * elif item == 2: # <<<<<<<<<<<<<< * self.r = new * elif item == 3: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2051, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2051, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2137, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2137, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":2052 + /* "collisions.py":2138 * self.y = new * elif item == 2: * self.r = new # <<<<<<<<<<<<<< * elif item == 3: * self.startAng = new */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_r, __pyx_v_new) < 0) __PYX_ERR(0, 2052, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_r, __pyx_v_new) < 0) __PYX_ERR(0, 2138, __pyx_L1_error) - /* "collisions.py":2051 + /* "collisions.py":2137 * elif item == 1: * self.y = new * elif item == 2: # <<<<<<<<<<<<<< @@ -67331,28 +70359,28 @@ static PyObject *__pyx_pf_10collisions_3Arc_30__setitem__(CYTHON_UNUSED PyObject goto __pyx_L3; } - /* "collisions.py":2053 + /* "collisions.py":2139 * elif item == 2: * self.r = new * elif item == 3: # <<<<<<<<<<<<<< * self.startAng = new * elif item == 4: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2053, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2053, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2139, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2139, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":2054 + /* "collisions.py":2140 * self.r = new * elif item == 3: * self.startAng = new # <<<<<<<<<<<<<< * elif item == 4: * self.endAng = new */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_startAng, __pyx_v_new) < 0) __PYX_ERR(0, 2054, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_startAng, __pyx_v_new) < 0) __PYX_ERR(0, 2140, __pyx_L1_error) - /* "collisions.py":2053 + /* "collisions.py":2139 * elif item == 2: * self.r = new * elif item == 3: # <<<<<<<<<<<<<< @@ -67362,28 +70390,28 @@ static PyObject *__pyx_pf_10collisions_3Arc_30__setitem__(CYTHON_UNUSED PyObject goto __pyx_L3; } - /* "collisions.py":2055 + /* "collisions.py":2141 * elif item == 3: * self.startAng = new * elif item == 4: # <<<<<<<<<<<<<< * self.endAng = new * else: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2055, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2055, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2141, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2141, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(__pyx_t_2)) { - /* "collisions.py":2056 + /* "collisions.py":2142 * self.startAng = new * elif item == 4: * self.endAng = new # <<<<<<<<<<<<<< * else: * raise IndexError( */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_endAng, __pyx_v_new) < 0) __PYX_ERR(0, 2056, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_endAng, __pyx_v_new) < 0) __PYX_ERR(0, 2142, __pyx_L1_error) - /* "collisions.py":2055 + /* "collisions.py":2141 * elif item == 3: * self.startAng = new * elif item == 4: # <<<<<<<<<<<<<< @@ -67393,7 +70421,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_30__setitem__(CYTHON_UNUSED PyObject goto __pyx_L3; } - /* "collisions.py":2058 + /* "collisions.py":2144 * self.endAng = new * else: * raise IndexError( # <<<<<<<<<<<<<< @@ -67402,36 +70430,36 @@ static PyObject *__pyx_pf_10collisions_3Arc_30__setitem__(CYTHON_UNUSED PyObject */ /*else*/ { - /* "collisions.py":2059 + /* "collisions.py":2145 * else: * raise IndexError( * 'List index out of range! Must be 0-4, found: '+str(item) # <<<<<<<<<<<<<< * ) * */ - __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2059, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_List_index_out_of_range_Must_be_3, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2059, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_List_index_out_of_range_Must_be_3, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2058 + /* "collisions.py":2144 * self.endAng = new * else: * raise IndexError( # <<<<<<<<<<<<<< * 'List index out of range! Must be 0-4, found: '+str(item) * ) */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2058, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 2058, __pyx_L1_error) + __PYX_ERR(0, 2144, __pyx_L1_error) } __pyx_L3:; - /* "collisions.py":2046 + /* "collisions.py":2132 * ) * * def __setitem__(self, item: int, new: Union[Number, pointLike]) -> None: # <<<<<<<<<<<<<< @@ -67453,7 +70481,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_30__setitem__(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":2062 +/* "collisions.py":2148 * ) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -67514,12 +70542,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2062, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2148, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__iter__") < 0)) __PYX_ERR(0, 2062, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__iter__") < 0)) __PYX_ERR(0, 2148, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -67530,7 +70558,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2062, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2148, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -67571,7 +70599,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_32__iter__(CYTHON_UNUSED PyObject *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 1); - /* "collisions.py":2063 + /* "collisions.py":2149 * * def __iter__(self): * return iter((self.x, self.y, self.r, self.startAng, self.endAng)) # <<<<<<<<<<<<<< @@ -67579,41 +70607,41 @@ static PyObject *__pyx_pf_10collisions_3Arc_32__iter__(CYTHON_UNUSED PyObject *_ * def __str__(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2063, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2063, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2063, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2063, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2063, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2063, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(0, 2063, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(0, 2149, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2)) __PYX_ERR(0, 2063, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2)) __PYX_ERR(0, 2149, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3)) __PYX_ERR(0, 2063, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_3)) __PYX_ERR(0, 2149, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_4)) __PYX_ERR(0, 2063, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 3, __pyx_t_4)) __PYX_ERR(0, 2149, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_5)) __PYX_ERR(0, 2063, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 4, __pyx_t_5)) __PYX_ERR(0, 2149, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_5 = 0; - __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2063, __pyx_L1_error) + __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "collisions.py":2062 + /* "collisions.py":2148 * ) * * def __iter__(self): # <<<<<<<<<<<<<< @@ -67637,7 +70665,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_32__iter__(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":2065 +/* "collisions.py":2151 * return iter((self.x, self.y, self.r, self.startAng, self.endAng)) * * def __str__(self): # <<<<<<<<<<<<<< @@ -67698,12 +70726,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2065, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2151, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 2065, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 2151, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -67714,7 +70742,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2065, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2151, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -67754,7 +70782,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_34__str__(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 1); - /* "collisions.py":2066 + /* "collisions.py":2152 * * def __str__(self): * return f'' # <<<<<<<<<<<<<< @@ -67762,7 +70790,7 @@ static PyObject *__pyx_pf_10collisions_3Arc_34__str__(CYTHON_UNUSED PyObject *__ * class ClosedShape(Shape): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2066, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 127; @@ -67770,9 +70798,9 @@ static PyObject *__pyx_pf_10collisions_3Arc_34__str__(CYTHON_UNUSED PyObject *__ __pyx_t_2 += 8; __Pyx_GIVEREF(__pyx_kp_u_Arc_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Arc_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2066, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2066, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; @@ -67780,13 +70808,13 @@ static PyObject *__pyx_pf_10collisions_3Arc_34__str__(CYTHON_UNUSED PyObject *__ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); __pyx_t_5 = 0; - __Pyx_INCREF(__pyx_kp_u__6); + __Pyx_INCREF(__pyx_kp_u__8); __pyx_t_2 += 2; - __Pyx_GIVEREF(__pyx_kp_u__6); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2066, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_kp_u__8); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__8); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2066, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; @@ -67798,9 +70826,9 @@ static PyObject *__pyx_pf_10collisions_3Arc_34__str__(CYTHON_UNUSED PyObject *__ __pyx_t_2 += 14; __Pyx_GIVEREF(__pyx_kp_u_with_radius); PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_with_radius); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2066, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2066, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; @@ -67812,9 +70840,9 @@ static PyObject *__pyx_pf_10collisions_3Arc_34__str__(CYTHON_UNUSED PyObject *__ __pyx_t_2 += 20; __Pyx_GIVEREF(__pyx_kp_u_and_angles_between); PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_kp_u_and_angles_between); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2066, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_startAng); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2066, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; @@ -67822,14 +70850,14 @@ static PyObject *__pyx_pf_10collisions_3Arc_34__str__(CYTHON_UNUSED PyObject *__ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_t_4); __pyx_t_4 = 0; - __Pyx_INCREF(__pyx_kp_u__24); + __Pyx_INCREF(__pyx_kp_u__28); __pyx_t_3 = (255 > __pyx_t_3) ? 255 : __pyx_t_3; - __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_kp_u__24); - __Pyx_GIVEREF(__pyx_kp_u__24); - PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_kp_u__24); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2066, __pyx_L1_error) + __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_kp_u__28); + __Pyx_GIVEREF(__pyx_kp_u__28); + PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_kp_u__28); + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_endAng); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2066, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; @@ -67837,19 +70865,19 @@ static PyObject *__pyx_pf_10collisions_3Arc_34__str__(CYTHON_UNUSED PyObject *__ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_t_5); __pyx_t_5 = 0; - __Pyx_INCREF(__pyx_kp_u__25); + __Pyx_INCREF(__pyx_kp_u__29); __pyx_t_3 = (255 > __pyx_t_3) ? 255 : __pyx_t_3; - __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_kp_u__25); - __Pyx_GIVEREF(__pyx_kp_u__25); - PyTuple_SET_ITEM(__pyx_t_1, 10, __pyx_kp_u__25); - __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 11, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2066, __pyx_L1_error) + __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_kp_u__29); + __Pyx_GIVEREF(__pyx_kp_u__29); + PyTuple_SET_ITEM(__pyx_t_1, 10, __pyx_kp_u__29); + __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 11, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "collisions.py":2065 + /* "collisions.py":2151 * return iter((self.x, self.y, self.r, self.startAng, self.endAng)) * * def __str__(self): # <<<<<<<<<<<<<< @@ -67870,9 +70898,9 @@ static PyObject *__pyx_pf_10collisions_3Arc_34__str__(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* "collisions.py":2072 +/* "collisions.py":2158 * Please do not use this class as it is just a building block for subclasses and to provide them with some basic methods.""" - * GROUPS = {ShpGroups.CLOSED} + * GROUPS = {ShpGroups.CLOSED, ShpGroups.SPLITTABLE} * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * if not self.check_rects(othershape): * return [] @@ -67934,7 +70962,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2072, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2158, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -67942,14 +70970,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2072, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2158, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, 1); __PYX_ERR(0, 2072, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, 1); __PYX_ERR(0, 2158, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_where") < 0)) __PYX_ERR(0, 2072, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_where") < 0)) __PYX_ERR(0, 2158, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -67962,7 +70990,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2072, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_where", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2158, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -68009,14 +71037,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_where", 1); - /* "collisions.py":2073 - * GROUPS = {ShpGroups.CLOSED} + /* "collisions.py":2159 + * GROUPS = {ShpGroups.CLOSED, ShpGroups.SPLITTABLE} * def _where(self, othershape: Shape) -> Iterable[pointLike]: * if not self.check_rects(othershape): # <<<<<<<<<<<<<< * return [] * if checkShpType(othershape, ShpTyps.Point): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_rects); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2073, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_check_rects); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -68036,16 +71064,16 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_othershape}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2073, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2073, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { - /* "collisions.py":2074 + /* "collisions.py":2160 * def _where(self, othershape: Shape) -> Iterable[pointLike]: * if not self.check_rects(othershape): * return [] # <<<<<<<<<<<<<< @@ -68053,14 +71081,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje * for i in self.toLines(): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2074, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2160, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2073 - * GROUPS = {ShpGroups.CLOSED} + /* "collisions.py":2159 + * GROUPS = {ShpGroups.CLOSED, ShpGroups.SPLITTABLE} * def _where(self, othershape: Shape) -> Iterable[pointLike]: * if not self.check_rects(othershape): # <<<<<<<<<<<<<< * return [] @@ -68068,18 +71096,18 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje */ } - /* "collisions.py":2075 + /* "collisions.py":2161 * if not self.check_rects(othershape): * return [] * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< * for i in self.toLines(): * if i.collides(othershape): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2075, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2075, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2075, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -68101,22 +71129,22 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2075, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2075, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2076 + /* "collisions.py":2162 * return [] * if checkShpType(othershape, ShpTyps.Point): * for i in self.toLines(): # <<<<<<<<<<<<<< * if i.collides(othershape): * return [[othershape.x, othershape.y]] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2076, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = NULL; __pyx_t_4 = 0; @@ -68136,7 +71164,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2076, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -68145,9 +71173,9 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2076, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2076, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2162, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -68156,28 +71184,28 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2076, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2162, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2076, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2162, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2076, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2076, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2162, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2076, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2162, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2076, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -68187,7 +71215,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2076, __pyx_L1_error) + else __PYX_ERR(0, 2162, __pyx_L1_error) } break; } @@ -68196,14 +71224,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2077 + /* "collisions.py":2163 * if checkShpType(othershape, ShpTyps.Point): * for i in self.toLines(): * if i.collides(othershape): # <<<<<<<<<<<<<< * return [[othershape.x, othershape.y]] * return [] */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2077, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -68223,15 +71251,15 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_othershape}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2077, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2077, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2163, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2078 + /* "collisions.py":2164 * for i in self.toLines(): * if i.collides(othershape): * return [[othershape.x, othershape.y]] # <<<<<<<<<<<<<< @@ -68239,29 +71267,29 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje * else: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2078, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2078, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2078, __pyx_L1_error) + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 2078, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 2164, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_7)) __PYX_ERR(0, 2078, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_7)) __PYX_ERR(0, 2164, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_7 = 0; - __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2078, __pyx_L1_error) + __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_3)) __PYX_ERR(0, 2078, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_3)) __PYX_ERR(0, 2164, __pyx_L1_error); __pyx_t_3 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":2077 + /* "collisions.py":2163 * if checkShpType(othershape, ShpTyps.Point): * for i in self.toLines(): * if i.collides(othershape): # <<<<<<<<<<<<<< @@ -68270,7 +71298,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje */ } - /* "collisions.py":2076 + /* "collisions.py":2162 * return [] * if checkShpType(othershape, ShpTyps.Point): * for i in self.toLines(): # <<<<<<<<<<<<<< @@ -68280,7 +71308,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2079 + /* "collisions.py":2165 * if i.collides(othershape): * return [[othershape.x, othershape.y]] * return [] # <<<<<<<<<<<<<< @@ -68288,13 +71316,13 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje * points = [] */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2079, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":2075 + /* "collisions.py":2161 * if not self.check_rects(othershape): * return [] * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< @@ -68303,7 +71331,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje */ } - /* "collisions.py":2081 + /* "collisions.py":2167 * return [] * else: * points = [] # <<<<<<<<<<<<<< @@ -68311,19 +71339,19 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje * points.extend(i._where(othershape)) */ /*else*/ { - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2081, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_points = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2082 + /* "collisions.py":2168 * else: * points = [] * for i in self.toLines(): # <<<<<<<<<<<<<< * points.extend(i._where(othershape)) * return points */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2082, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -68343,7 +71371,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2082, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } @@ -68352,9 +71380,9 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2082, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2082, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2168, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -68363,28 +71391,28 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2082, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2168, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2082, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2168, __pyx_L1_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2082, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2082, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2168, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2082, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2168, __pyx_L1_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2082, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -68394,7 +71422,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2082, __pyx_L1_error) + else __PYX_ERR(0, 2168, __pyx_L1_error) } break; } @@ -68403,14 +71431,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2083 + /* "collisions.py":2169 * points = [] * for i in self.toLines(): * points.extend(i._where(othershape)) # <<<<<<<<<<<<<< * return points * */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_where); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2083, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_where); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; __pyx_t_4 = 0; @@ -68430,14 +71458,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_othershape}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2083, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_10 = __Pyx_PyList_Extend(__pyx_v_points, __pyx_t_2); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 2083, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyList_Extend(__pyx_v_points, __pyx_t_2); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 2169, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2082 + /* "collisions.py":2168 * else: * points = [] * for i in self.toLines(): # <<<<<<<<<<<<<< @@ -68447,7 +71475,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":2084 + /* "collisions.py":2170 * for i in self.toLines(): * points.extend(i._where(othershape)) * return points # <<<<<<<<<<<<<< @@ -68460,9 +71488,9 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje goto __pyx_L0; } - /* "collisions.py":2072 + /* "collisions.py":2158 * Please do not use this class as it is just a building block for subclasses and to provide them with some basic methods.""" - * GROUPS = {ShpGroups.CLOSED} + * GROUPS = {ShpGroups.CLOSED, ShpGroups.SPLITTABLE} * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * if not self.check_rects(othershape): * return [] @@ -68484,7 +71512,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape__where(CYTHON_UNUSED PyObje return __pyx_r; } -/* "collisions.py":2086 +/* "collisions.py":2172 * return points * * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< @@ -68552,7 +71580,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2086, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2172, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -68560,9 +71588,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2086, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2172, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 1); __PYX_ERR(0, 2086, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 1); __PYX_ERR(0, 2172, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -68570,14 +71598,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2086, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2172, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 2); __PYX_ERR(0, 2086, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, 2); __PYX_ERR(0, 2172, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tangent") < 0)) __PYX_ERR(0, 2086, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "tangent") < 0)) __PYX_ERR(0, 2172, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -68592,7 +71620,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 2086, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("tangent", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 2172, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -68619,7 +71647,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "collisions.py":2104 +/* "collisions.py":2190 * ps.sort(key=lambda x: abs(x[1][0]-point[0])**2+abs(x[1][1]-point[1])**2) * if ps[0][1] == ps[1][1]: * def degrees_to_vector(angle): # <<<<<<<<<<<<<< @@ -68680,12 +71708,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2104, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2190, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "degrees_to_vector") < 0)) __PYX_ERR(0, 2104, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "degrees_to_vector") < 0)) __PYX_ERR(0, 2190, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -68696,7 +71724,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("degrees_to_vector", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2104, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("degrees_to_vector", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2190, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -68737,16 +71765,16 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_7tangent_degrees_to_vector( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("degrees_to_vector", 1); - /* "collisions.py":2106 + /* "collisions.py":2192 * def degrees_to_vector(angle): * # Convert an angle to a unit vector * radians = math.radians(angle) # <<<<<<<<<<<<<< * return math.cos(radians), math.sin(radians) * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2106, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_radians); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2106, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_radians); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -68767,14 +71795,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_7tangent_degrees_to_vector( PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_angle}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2106, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2192, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_radians = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":2107 + /* "collisions.py":2193 * # Convert an angle to a unit vector * radians = math.radians(angle) * return math.cos(radians), math.sin(radians) # <<<<<<<<<<<<<< @@ -68782,9 +71810,9 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_7tangent_degrees_to_vector( * # Convert both angles to vectors */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2107, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_cos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2107, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_cos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -68805,13 +71833,13 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_7tangent_degrees_to_vector( PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_radians}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2107, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2107, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sin); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2107, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sin); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -68832,23 +71860,23 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_7tangent_degrees_to_vector( PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_radians}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2107, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2107, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 2107, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1)) __PYX_ERR(0, 2193, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(0, 2107, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2)) __PYX_ERR(0, 2193, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "collisions.py":2104 + /* "collisions.py":2190 * ps.sort(key=lambda x: abs(x[1][0]-point[0])**2+abs(x[1][1]-point[1])**2) * if ps[0][1] == ps[1][1]: * def degrees_to_vector(angle): # <<<<<<<<<<<<<< @@ -68871,7 +71899,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_7tangent_degrees_to_vector( return __pyx_r; } -/* "collisions.py":2102 +/* "collisions.py":2188 * origps = [[pt[1].tangent(pt[0], vel), pt[0]] for pt in ps] * ps = origps.copy() * ps.sort(key=lambda x: abs(x[1][0]-point[0])**2+abs(x[1][1]-point[1])**2) # <<<<<<<<<<<<<< @@ -68932,12 +71960,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2102, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2188, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda20") < 0)) __PYX_ERR(0, 2102, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda20") < 0)) __PYX_ERR(0, 2188, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -68948,7 +71976,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda20", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2102, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda20", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2188, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -68976,8 +72004,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_lambda_funcdef_lambda20(PyObject *__pyx_self, PyObject *__pyx_v_x) { - struct __pyx_obj_10collisions___pyx_scope_struct_16_tangent *__pyx_cur_scope; - struct __pyx_obj_10collisions___pyx_scope_struct_16_tangent *__pyx_outer_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_17_tangent *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_17_tangent *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -68988,46 +72016,46 @@ static PyObject *__pyx_lambda_funcdef_lambda20(PyObject *__pyx_self, PyObject *_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda20", 1); - __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_16_tangent *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_17_tangent *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2102, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2102, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_v_point)) { __Pyx_RaiseClosureNameError("point"); __PYX_ERR(0, 2102, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2102, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_point)) { __Pyx_RaiseClosureNameError("point"); __PYX_ERR(0, 2188, __pyx_L1_error) } + __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2102, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2102, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2102, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2102, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2102, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_v_point)) { __Pyx_RaiseClosureNameError("point"); __PYX_ERR(0, 2102, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_point, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2102, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_point)) { __Pyx_RaiseClosureNameError("point"); __PYX_ERR(0, 2188, __pyx_L1_error) } + __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_point, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2102, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2102, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2102, __pyx_L1_error) + __pyx_t_4 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2102, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -69049,7 +72077,7 @@ static PyObject *__pyx_lambda_funcdef_lambda20(PyObject *__pyx_self, PyObject *_ return __pyx_r; } -/* "collisions.py":2086 +/* "collisions.py":2172 * return points * * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< @@ -69058,7 +72086,7 @@ static PyObject *__pyx_lambda_funcdef_lambda20(PyObject *__pyx_self, PyObject *_ */ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_point, PyObject *__pyx_v_vel) { - struct __pyx_obj_10collisions___pyx_scope_struct_16_tangent *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_17_tangent *__pyx_cur_scope; PyObject *__pyx_v_p = NULL; PyObject *__pyx_v_ps = NULL; PyObject *__pyx_v_origps = NULL; @@ -69088,11 +72116,11 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("tangent", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_16_tangent *)__pyx_tp_new_10collisions___pyx_scope_struct_16_tangent(__pyx_ptype_10collisions___pyx_scope_struct_16_tangent, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_17_tangent *)__pyx_tp_new_10collisions___pyx_scope_struct_17_tangent(__pyx_ptype_10collisions___pyx_scope_struct_17_tangent, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_16_tangent *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_17_tangent *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2086, __pyx_L1_error) + __PYX_ERR(0, 2172, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -69100,25 +72128,25 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb __Pyx_INCREF(__pyx_cur_scope->__pyx_v_point); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_point); - /* "collisions.py":2098 + /* "collisions.py":2184 * """ * # TODO: Make it so the line normals go in the direction facing away from the centre instead of away from the velocity vector * p = Point(*point) # <<<<<<<<<<<<<< * ps = [[i.closestPointTo(p), i] for i in self.toLines()] * origps = [[pt[1].tangent(pt[0], vel), pt[0]] for pt in ps] */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Point); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2098, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Point); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_point); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2098, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_point); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2098, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2184, __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_v_p = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":2099 + /* "collisions.py":2185 * # TODO: Make it so the line normals go in the direction facing away from the centre instead of away from the velocity vector * p = Point(*point) * ps = [[i.closestPointTo(p), i] for i in self.toLines()] # <<<<<<<<<<<<<< @@ -69126,9 +72154,9 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb * ps = origps.copy() */ { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2099, __pyx_L5_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2185, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2099, __pyx_L5_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2185, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -69148,7 +72176,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2099, __pyx_L5_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2185, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -69157,9 +72185,9 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2099, __pyx_L5_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2185, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2099, __pyx_L5_error) + __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2185, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -69168,28 +72196,28 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2099, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2185, __pyx_L5_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 2099, __pyx_L5_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 2185, __pyx_L5_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2099, __pyx_L5_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2185, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2099, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2185, __pyx_L5_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 2099, __pyx_L5_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 2185, __pyx_L5_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2099, __pyx_L5_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2185, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -69199,7 +72227,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2099, __pyx_L5_error) + else __PYX_ERR(0, 2185, __pyx_L5_error) } break; } @@ -69207,7 +72235,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb } __Pyx_XDECREF_SET(__pyx_9genexpr34__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr34__pyx_v_i, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2099, __pyx_L5_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr34__pyx_v_i, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2185, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_8 = NULL; __pyx_t_5 = 0; @@ -69227,19 +72255,19 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_p}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2099, __pyx_L5_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2185, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2099, __pyx_L5_error) + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2185, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 2099, __pyx_L5_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_2)) __PYX_ERR(0, 2185, __pyx_L5_error); __Pyx_INCREF(__pyx_9genexpr34__pyx_v_i); __Pyx_GIVEREF(__pyx_9genexpr34__pyx_v_i); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_9genexpr34__pyx_v_i)) __PYX_ERR(0, 2099, __pyx_L5_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_9genexpr34__pyx_v_i)) __PYX_ERR(0, 2185, __pyx_L5_error); __pyx_t_2 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 2099, __pyx_L5_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 2185, __pyx_L5_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -69253,7 +72281,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb __pyx_v_ps = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":2100 + /* "collisions.py":2186 * p = Point(*point) * ps = [[i.closestPointTo(p), i] for i in self.toLines()] * origps = [[pt[1].tangent(pt[0], vel), pt[0]] for pt in ps] # <<<<<<<<<<<<<< @@ -69261,16 +72289,16 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb * ps.sort(key=lambda x: abs(x[1][0]-point[0])**2+abs(x[1][1]-point[1])**2) */ { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2100, __pyx_L12_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2186, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_v_ps)) || PyTuple_CheckExact(__pyx_v_ps)) { __pyx_t_1 = __pyx_v_ps; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0; __pyx_t_7 = NULL; } else { - __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_ps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2100, __pyx_L12_error) + __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_ps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2186, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2100, __pyx_L12_error) + __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2186, __pyx_L12_error) } for (;;) { if (likely(!__pyx_t_7)) { @@ -69278,28 +72306,28 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2100, __pyx_L12_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2186, __pyx_L12_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 2100, __pyx_L12_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 2186, __pyx_L12_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2100, __pyx_L12_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2186, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2100, __pyx_L12_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2186, __pyx_L12_error) #endif if (__pyx_t_6 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 2100, __pyx_L12_error) + __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 2186, __pyx_L12_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2100, __pyx_L12_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2186, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -69309,7 +72337,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2100, __pyx_L12_error) + else __PYX_ERR(0, 2186, __pyx_L12_error) } break; } @@ -69317,12 +72345,12 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb } __Pyx_XDECREF_SET(__pyx_9genexpr35__pyx_v_pt, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_9genexpr35__pyx_v_pt, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2100, __pyx_L12_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_9genexpr35__pyx_v_pt, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2186, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_tangent); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2100, __pyx_L12_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_tangent); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2186, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_9genexpr35__pyx_v_pt, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2100, __pyx_L12_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_9genexpr35__pyx_v_pt, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2186, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = NULL; __pyx_t_5 = 0; @@ -69343,21 +72371,21 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2100, __pyx_L12_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2186, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __pyx_t_8 = __Pyx_GetItemInt(__pyx_9genexpr35__pyx_v_pt, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2100, __pyx_L12_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_9genexpr35__pyx_v_pt, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2186, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2100, __pyx_L12_error) + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2186, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 2100, __pyx_L12_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 2186, __pyx_L12_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_8)) __PYX_ERR(0, 2100, __pyx_L12_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_8)) __PYX_ERR(0, 2186, __pyx_L12_error); __pyx_t_4 = 0; __pyx_t_8 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2100, __pyx_L12_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2186, __pyx_L12_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -69371,88 +72399,88 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb __pyx_v_origps = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2101 + /* "collisions.py":2187 * ps = [[i.closestPointTo(p), i] for i in self.toLines()] * origps = [[pt[1].tangent(pt[0], vel), pt[0]] for pt in ps] * ps = origps.copy() # <<<<<<<<<<<<<< * ps.sort(key=lambda x: abs(x[1][0]-point[0])**2+abs(x[1][1]-point[1])**2) * if ps[0][1] == ps[1][1]: */ - __pyx_t_3 = __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyList_Type_copy, __pyx_v_origps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2101, __pyx_L1_error) + __pyx_t_3 = __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyList_Type_copy, __pyx_v_origps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF_SET(__pyx_v_ps, __pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2102 + /* "collisions.py":2188 * origps = [[pt[1].tangent(pt[0], vel), pt[0]] for pt in ps] * ps = origps.copy() * ps.sort(key=lambda x: abs(x[1][0]-point[0])**2+abs(x[1][1]-point[1])**2) # <<<<<<<<<<<<<< * if ps[0][1] == ps[1][1]: * def degrees_to_vector(angle): */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_ps, __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2102, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_ps, __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2102, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_7tangent_2lambda20, 0, __pyx_n_s_ClosedShape_tangent_locals_lambd, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2102, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_7tangent_2lambda20, 0, __pyx_n_s_ClosedShape_tangent_locals_lambd, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_t_2) < 0) __PYX_ERR(0, 2102, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, __pyx_t_2) < 0) __PYX_ERR(0, 2188, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2102, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2103 + /* "collisions.py":2189 * ps = origps.copy() * ps.sort(key=lambda x: abs(x[1][0]-point[0])**2+abs(x[1][1]-point[1])**2) * if ps[0][1] == ps[1][1]: # <<<<<<<<<<<<<< * def degrees_to_vector(angle): * # Convert an angle to a unit vector */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ps, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2103, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ps, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2103, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ps, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2103, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ps, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2103, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2103, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 2103, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 2189, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_10) { - /* "collisions.py":2104 + /* "collisions.py":2190 * ps.sort(key=lambda x: abs(x[1][0]-point[0])**2+abs(x[1][1]-point[1])**2) * if ps[0][1] == ps[1][1]: * def degrees_to_vector(angle): # <<<<<<<<<<<<<< * # Convert an angle to a unit vector * radians = math.radians(angle) */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_7tangent_1degrees_to_vector, 0, __pyx_n_s_ClosedShape_tangent_locals_degre, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2104, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_7tangent_1degrees_to_vector, 0, __pyx_n_s_ClosedShape_tangent_locals_degre, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2190, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_degrees_to_vector = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":2110 + /* "collisions.py":2196 * * # Convert both angles to vectors * x1, y1 = degrees_to_vector(ps[0][0]) # <<<<<<<<<<<<<< * x2, y2 = degrees_to_vector(ps[1][0]) * */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ps, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2110, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ps, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2110, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_pf_10collisions_11ClosedShape_7tangent_degrees_to_vector(__pyx_v_degrees_to_vector, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2110, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_10collisions_11ClosedShape_7tangent_degrees_to_vector(__pyx_v_degrees_to_vector, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { @@ -69461,7 +72489,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 2110, __pyx_L1_error) + __PYX_ERR(0, 2196, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -69474,15 +72502,15 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2110, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2110, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2110, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); @@ -69490,7 +72518,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_1 = __pyx_t_11(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L18_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_8), 2) < 0) __PYX_ERR(0, 2110, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_8), 2) < 0) __PYX_ERR(0, 2196, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L19_unpacking_done; @@ -69498,7 +72526,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 2110, __pyx_L1_error) + __PYX_ERR(0, 2196, __pyx_L1_error) __pyx_L19_unpacking_done:; } __pyx_v_x1 = __pyx_t_3; @@ -69506,19 +72534,19 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb __pyx_v_y1 = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":2111 + /* "collisions.py":2197 * # Convert both angles to vectors * x1, y1 = degrees_to_vector(ps[0][0]) * x2, y2 = degrees_to_vector(ps[1][0]) # <<<<<<<<<<<<<< * * # Average the x and y components */ - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ps, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2111, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ps, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2111, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __pyx_pf_10collisions_11ClosedShape_7tangent_degrees_to_vector(__pyx_v_degrees_to_vector, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2111, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_10collisions_11ClosedShape_7tangent_degrees_to_vector(__pyx_v_degrees_to_vector, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) { @@ -69527,7 +72555,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 2111, __pyx_L1_error) + __PYX_ERR(0, 2197, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -69540,15 +72568,15 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2111, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2111, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2111, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); @@ -69556,7 +72584,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_11(__pyx_t_8); if (unlikely(!__pyx_t_3)) goto __pyx_L20_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_8), 2) < 0) __PYX_ERR(0, 2111, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_8), 2) < 0) __PYX_ERR(0, 2197, __pyx_L1_error) __pyx_t_11 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L21_unpacking_done; @@ -69564,7 +72592,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_11 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 2111, __pyx_L1_error) + __PYX_ERR(0, 2197, __pyx_L1_error) __pyx_L21_unpacking_done:; } __pyx_v_x2 = __pyx_t_1; @@ -69572,37 +72600,37 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb __pyx_v_y2 = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":2114 + /* "collisions.py":2200 * * # Average the x and y components * avg_x = (x1 + x2) / 2 # <<<<<<<<<<<<<< * avg_y = (y1 + y2) / 2 * return math.degrees(math.atan2(avg_y, avg_x)) % 360 */ - __pyx_t_2 = PyNumber_Add(__pyx_v_x1, __pyx_v_x2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2114, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_v_x1, __pyx_v_x2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_2, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2114, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_2, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_avg_x = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":2115 + /* "collisions.py":2201 * # Average the x and y components * avg_x = (x1 + x2) / 2 * avg_y = (y1 + y2) / 2 # <<<<<<<<<<<<<< * return math.degrees(math.atan2(avg_y, avg_x)) % 360 * */ - __pyx_t_3 = PyNumber_Add(__pyx_v_y1, __pyx_v_y2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2115, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_v_y1, __pyx_v_y2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_3, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2115, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_3, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_avg_y = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":2116 + /* "collisions.py":2202 * avg_x = (x1 + x2) / 2 * avg_y = (y1 + y2) / 2 * return math.degrees(math.atan2(avg_y, avg_x)) % 360 # <<<<<<<<<<<<<< @@ -69610,14 +72638,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb * return ps[0][0] */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2116, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_math); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_degrees); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2116, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_degrees); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_math); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2116, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_math); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_atan2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2116, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_atan2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -69638,7 +72666,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_avg_y, __pyx_v_avg_x}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2116, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -69661,18 +72689,18 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2116, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_t_2, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2116, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_t_2, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2202, __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; - /* "collisions.py":2103 + /* "collisions.py":2189 * ps = origps.copy() * ps.sort(key=lambda x: abs(x[1][0]-point[0])**2+abs(x[1][1]-point[1])**2) * if ps[0][1] == ps[1][1]: # <<<<<<<<<<<<<< @@ -69681,7 +72709,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb */ } - /* "collisions.py":2118 + /* "collisions.py":2204 * return math.degrees(math.atan2(avg_y, avg_x)) % 360 * * return ps[0][0] # <<<<<<<<<<<<<< @@ -69689,16 +72717,16 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike, Iterable[pointLike]]: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ps, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2118, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ps, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2118, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":2086 + /* "collisions.py":2172 * return points * * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< @@ -69735,7 +72763,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_2tangent(CYTHON_UNUSED PyOb return __pyx_r; } -/* "collisions.py":2120 +/* "collisions.py":2206 * return ps[0][0] * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike, Iterable[pointLike]]: # <<<<<<<<<<<<<< @@ -69804,7 +72832,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2120, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2206, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -69812,21 +72840,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2120, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2206, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, 1); __PYX_ERR(0, 2120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, 1); __PYX_ERR(0, 2206, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_returnAll); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2120, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2206, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "closestPointTo") < 0)) __PYX_ERR(0, 2120, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "closestPointTo") < 0)) __PYX_ERR(0, 2206, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -69844,7 +72872,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 2120, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("closestPointTo", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 2206, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -69871,7 +72899,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "collisions.py":2143 +/* "collisions.py":2229 * return colls * return colls[0] * def calculate(ln, oln, recalculate): # <<<<<<<<<<<<<< @@ -69938,7 +72966,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2143, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2229, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -69946,9 +72974,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2143, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2229, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 1); __PYX_ERR(0, 2143, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 1); __PYX_ERR(0, 2229, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -69956,14 +72984,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2143, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2229, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 2); __PYX_ERR(0, 2143, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 2); __PYX_ERR(0, 2229, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "calculate") < 0)) __PYX_ERR(0, 2143, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "calculate") < 0)) __PYX_ERR(0, 2229, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -69978,7 +73006,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 2143, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 2229, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -70023,14 +73051,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14closestPointTo_calculate( int __pyx_clineno = 0; __Pyx_RefNannySetupContext("calculate", 1); - /* "collisions.py":2144 + /* "collisions.py":2230 * return colls[0] * def calculate(ln, oln, recalculate): * p2 = oln.closestPointTo(ln) # <<<<<<<<<<<<<< * p = ln.closestPointTo(Point(*p2)) * if recalculate: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_oln, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2144, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_oln, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -70050,27 +73078,27 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14closestPointTo_calculate( PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_ln}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2144, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_p2 = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":2145 + /* "collisions.py":2231 * def calculate(ln, oln, recalculate): * p2 = oln.closestPointTo(ln) * p = ln.closestPointTo(Point(*p2)) # <<<<<<<<<<<<<< * if recalculate: * p3 = oln.closestPointTo(Point(*p)) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2145, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2145, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_p2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2145, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_p2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2145, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -70093,37 +73121,37 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14closestPointTo_calculate( __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2145, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_p = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":2146 + /* "collisions.py":2232 * p2 = oln.closestPointTo(ln) * p = ln.closestPointTo(Point(*p2)) * if recalculate: # <<<<<<<<<<<<<< * p3 = oln.closestPointTo(Point(*p)) * p2 = p */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_recalculate); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 2146, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_recalculate); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 2232, __pyx_L1_error) if (__pyx_t_7) { - /* "collisions.py":2147 + /* "collisions.py":2233 * p = ln.closestPointTo(Point(*p2)) * if recalculate: * p3 = oln.closestPointTo(Point(*p)) # <<<<<<<<<<<<<< * p2 = p * p = p3 */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_oln, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2147, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_oln, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Point); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2147, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Point); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_p); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2147, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_v_p); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2147, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -70146,14 +73174,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14closestPointTo_calculate( __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2147, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2233, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_p3 = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":2148 + /* "collisions.py":2234 * if recalculate: * p3 = oln.closestPointTo(Point(*p)) * p2 = p # <<<<<<<<<<<<<< @@ -70163,7 +73191,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14closestPointTo_calculate( __Pyx_INCREF(__pyx_v_p); __Pyx_DECREF_SET(__pyx_v_p2, __pyx_v_p); - /* "collisions.py":2149 + /* "collisions.py":2235 * p3 = oln.closestPointTo(Point(*p)) * p2 = p * p = p3 # <<<<<<<<<<<<<< @@ -70173,7 +73201,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14closestPointTo_calculate( __Pyx_INCREF(__pyx_v_p3); __Pyx_DECREF_SET(__pyx_v_p, __pyx_v_p3); - /* "collisions.py":2146 + /* "collisions.py":2232 * p2 = oln.closestPointTo(ln) * p = ln.closestPointTo(Point(*p2)) * if recalculate: # <<<<<<<<<<<<<< @@ -70182,7 +73210,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14closestPointTo_calculate( */ } - /* "collisions.py":2150 + /* "collisions.py":2236 * p2 = p * p = p3 * return p2, abs(p[0]-p2[0])**2+abs(p[1]-p2[1])**2 # <<<<<<<<<<<<<< @@ -70190,51 +73218,51 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14closestPointTo_calculate( * calculate(othershape, p, False) for p in self.toLines() */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2150, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_p2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2150, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_p2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2150, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2150, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2150, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2150, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2150, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2150, __pyx_L1_error) + __pyx_t_5 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2150, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2150, __pyx_L1_error) + __pyx_t_5 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2150, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2150, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2236, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_p2); __Pyx_GIVEREF(__pyx_v_p2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_p2)) __PYX_ERR(0, 2150, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_p2)) __PYX_ERR(0, 2236, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1)) __PYX_ERR(0, 2150, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1)) __PYX_ERR(0, 2236, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "collisions.py":2143 + /* "collisions.py":2229 * return colls * return colls[0] * def calculate(ln, oln, recalculate): # <<<<<<<<<<<<<< @@ -70260,7 +73288,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14closestPointTo_calculate( return __pyx_r; } -/* "collisions.py":2179 +/* "collisions.py":2265 * return colls * return colls[0] * def calculate(ln, point, recalculate): # <<<<<<<<<<<<<< @@ -70327,7 +73355,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2179, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2265, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -70335,9 +73363,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2179, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2265, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 1); __PYX_ERR(0, 2179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 1); __PYX_ERR(0, 2265, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -70345,14 +73373,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2179, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2265, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 2); __PYX_ERR(0, 2179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, 2); __PYX_ERR(0, 2265, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "calculate") < 0)) __PYX_ERR(0, 2179, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "calculate") < 0)) __PYX_ERR(0, 2265, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -70367,7 +73395,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 2179, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("calculate", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 2265, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -70395,8 +73423,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_pf_10collisions_11ClosedShape_14closestPointTo_2calculate(PyObject *__pyx_self, PyObject *__pyx_v_ln, PyObject *__pyx_v_point, PyObject *__pyx_v_recalculate) { - struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo *__pyx_cur_scope; - struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo *__pyx_outer_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_18_closestPointTo *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_18_closestPointTo *__pyx_outer_scope; PyObject *__pyx_v_p2 = NULL; PyObject *__pyx_v_olineP = NULL; PyObject *__pyx_r = NULL; @@ -70412,23 +73440,23 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14closestPointTo_2calculate const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("calculate", 1); - __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_18_closestPointTo *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; - /* "collisions.py":2180 + /* "collisions.py":2266 * return colls[0] * def calculate(ln, point, recalculate): * p2 = ln.closestPointTo(Point(*point)) # <<<<<<<<<<<<<< * olineP = point * if recalculate: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2180, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2180, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2180, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2180, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -70451,14 +73479,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14closestPointTo_2calculate __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2180, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_p2 = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":2181 + /* "collisions.py":2267 * def calculate(ln, point, recalculate): * p2 = ln.closestPointTo(Point(*point)) * olineP = point # <<<<<<<<<<<<<< @@ -70468,17 +73496,17 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14closestPointTo_2calculate __Pyx_INCREF(__pyx_v_point); __pyx_v_olineP = __pyx_v_point; - /* "collisions.py":2182 + /* "collisions.py":2268 * p2 = ln.closestPointTo(Point(*point)) * olineP = point * if recalculate: # <<<<<<<<<<<<<< * olineP = p2 * p2 = self.closestPointTo(Point(*p2)) */ - __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_recalculate); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 2182, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_recalculate); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 2268, __pyx_L1_error) if (__pyx_t_7) { - /* "collisions.py":2183 + /* "collisions.py":2269 * olineP = point * if recalculate: * olineP = p2 # <<<<<<<<<<<<<< @@ -70488,21 +73516,21 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14closestPointTo_2calculate __Pyx_INCREF(__pyx_v_p2); __Pyx_DECREF_SET(__pyx_v_olineP, __pyx_v_p2); - /* "collisions.py":2184 + /* "collisions.py":2270 * if recalculate: * olineP = p2 * p2 = self.closestPointTo(Point(*p2)) # <<<<<<<<<<<<<< * return p2, abs(p2[0]-olineP[0])**2+abs(p2[1]-olineP[1])**2 * tries = [] */ - if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2184, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2184, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2270, __pyx_L1_error) } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Point); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2184, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Point); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2184, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2184, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -70525,14 +73553,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14closestPointTo_2calculate __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2184, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF_SET(__pyx_v_p2, __pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2182 + /* "collisions.py":2268 * p2 = ln.closestPointTo(Point(*point)) * olineP = point * if recalculate: # <<<<<<<<<<<<<< @@ -70541,7 +73569,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14closestPointTo_2calculate */ } - /* "collisions.py":2185 + /* "collisions.py":2271 * olineP = p2 * p2 = self.closestPointTo(Point(*p2)) * return p2, abs(p2[0]-olineP[0])**2+abs(p2[1]-olineP[1])**2 # <<<<<<<<<<<<<< @@ -70549,51 +73577,51 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14closestPointTo_2calculate * olns = othershape.toLines() */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2185, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_p2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_olineP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2185, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_olineP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2185, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2185, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2185, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_p2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2185, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_p2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_olineP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2185, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_olineP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2185, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2185, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2185, __pyx_L1_error) + __pyx_t_4 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2185, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2185, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_p2); __Pyx_GIVEREF(__pyx_v_p2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_p2)) __PYX_ERR(0, 2185, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_p2)) __PYX_ERR(0, 2271, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 2185, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1)) __PYX_ERR(0, 2271, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":2179 + /* "collisions.py":2265 * return colls * return colls[0] * def calculate(ln, point, recalculate): # <<<<<<<<<<<<<< @@ -70618,7 +73646,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14closestPointTo_2calculate return __pyx_r; } -/* "collisions.py":2133 +/* "collisions.py":2219 * if checkShpType(othershape, ShpTyps.Point): * ps = [i.closestPointTo(othershape) for i in self.toLines()] * ps.sort(key=lambda x: abs(x[0]-othershape[0])**2+abs(x[1]-othershape[1])**2) # <<<<<<<<<<<<<< @@ -70679,12 +73707,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2133, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2219, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda21") < 0)) __PYX_ERR(0, 2133, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda21") < 0)) __PYX_ERR(0, 2219, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -70695,7 +73723,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda21", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2133, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda21", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2219, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -70723,8 +73751,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_lambda_funcdef_lambda21(PyObject *__pyx_self, PyObject *__pyx_v_x) { - struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo *__pyx_cur_scope; - struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo *__pyx_outer_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_18_closestPointTo *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_18_closestPointTo *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -70735,40 +73763,40 @@ static PyObject *__pyx_lambda_funcdef_lambda21(PyObject *__pyx_self, PyObject *_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda21", 1); - __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_18_closestPointTo *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2133, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(!__pyx_cur_scope->__pyx_v_othershape)) { __Pyx_RaiseClosureNameError("othershape"); __PYX_ERR(0, 2133, __pyx_L1_error) } - __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_othershape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2133, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_othershape)) { __Pyx_RaiseClosureNameError("othershape"); __PYX_ERR(0, 2219, __pyx_L1_error) } + __pyx_t_2 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_othershape, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2133, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2133, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyNumber_Absolute(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2133, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_2, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2133, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_othershape)) { __Pyx_RaiseClosureNameError("othershape"); __PYX_ERR(0, 2133, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_othershape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2133, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_othershape)) { __Pyx_RaiseClosureNameError("othershape"); __PYX_ERR(0, 2219, __pyx_L1_error) } + __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_othershape, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2133, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2133, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2133, __pyx_L1_error) + __pyx_t_4 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2133, __pyx_L1_error) + __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -70790,7 +73818,7 @@ static PyObject *__pyx_lambda_funcdef_lambda21(PyObject *__pyx_self, PyObject *_ return __pyx_r; } -/* "collisions.py":2156 +/* "collisions.py":2242 * calculate(ln, othershape, True) for ln in self.toLines() * ] * tries.sort(key=lambda x: x[1]) # <<<<<<<<<<<<<< @@ -70851,12 +73879,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2156, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2242, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda22") < 0)) __PYX_ERR(0, 2156, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda22") < 0)) __PYX_ERR(0, 2242, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -70867,7 +73895,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda22", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2156, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda22", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2242, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -70903,7 +73931,7 @@ static PyObject *__pyx_lambda_funcdef_lambda22(CYTHON_UNUSED PyObject *__pyx_sel int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda22", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2156, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -70920,7 +73948,7 @@ static PyObject *__pyx_lambda_funcdef_lambda22(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "collisions.py":2169 +/* "collisions.py":2255 * d = (cp[0]-mycp[0])**2+(cp[1]-mycp[1])**2 * closests.append((mycp, d)) * closests.sort(key=lambda x: x[1]) # <<<<<<<<<<<<<< @@ -70981,12 +74009,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2169, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2255, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda23") < 0)) __PYX_ERR(0, 2169, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda23") < 0)) __PYX_ERR(0, 2255, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -70997,7 +74025,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda23", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2169, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda23", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2255, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -71033,7 +74061,7 @@ static PyObject *__pyx_lambda_funcdef_lambda23(CYTHON_UNUSED PyObject *__pyx_sel int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda23", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2169, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -71050,7 +74078,7 @@ static PyObject *__pyx_lambda_funcdef_lambda23(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "collisions.py":2195 +/* "collisions.py":2281 * tries.extend([calculate(oln, ln.p1, True) for ln in slns]) * tries.extend([calculate(oln, ln.p2, True) for ln in slns]) * tries.sort(key=lambda x: x[1]) # <<<<<<<<<<<<<< @@ -71111,12 +74139,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2195, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2281, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda24") < 0)) __PYX_ERR(0, 2195, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda24") < 0)) __PYX_ERR(0, 2281, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -71127,7 +74155,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda24", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2195, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda24", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2281, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -71163,7 +74191,7 @@ static PyObject *__pyx_lambda_funcdef_lambda24(CYTHON_UNUSED PyObject *__pyx_sel int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda24", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2195, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -71180,7 +74208,7 @@ static PyObject *__pyx_lambda_funcdef_lambda24(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "collisions.py":2120 +/* "collisions.py":2206 * return ps[0][0] * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike, Iterable[pointLike]]: # <<<<<<<<<<<<<< @@ -71189,7 +74217,7 @@ static PyObject *__pyx_lambda_funcdef_lambda24(CYTHON_UNUSED PyObject *__pyx_sel */ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape, PyObject *__pyx_v_returnAll) { - struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_18_closestPointTo *__pyx_cur_scope; PyObject *__pyx_v_ps = NULL; PyObject *__pyx_v_colls = NULL; PyObject *__pyx_v_calculate = 0; @@ -71232,11 +74260,11 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("closestPointTo", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo *)__pyx_tp_new_10collisions___pyx_scope_struct_17_closestPointTo(__pyx_ptype_10collisions___pyx_scope_struct_17_closestPointTo, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_18_closestPointTo *)__pyx_tp_new_10collisions___pyx_scope_struct_18_closestPointTo(__pyx_ptype_10collisions___pyx_scope_struct_18_closestPointTo, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_18_closestPointTo *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2120, __pyx_L1_error) + __PYX_ERR(0, 2206, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -71247,18 +74275,18 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __Pyx_INCREF(__pyx_cur_scope->__pyx_v_othershape); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_othershape); - /* "collisions.py":2131 + /* "collisions.py":2217 * pointLike / Iterable[pointLike]: The closest point(s, depending on returnAll) ON this object TO the othershape * """ * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< * ps = [i.closestPointTo(othershape) for i in self.toLines()] * ps.sort(key=lambda x: abs(x[0]-othershape[0])**2+abs(x[1]-othershape[1])**2) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2131, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2131, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2131, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -71280,15 +74308,15 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2131, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2131, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2217, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2132 + /* "collisions.py":2218 * """ * if checkShpType(othershape, ShpTyps.Point): * ps = [i.closestPointTo(othershape) for i in self.toLines()] # <<<<<<<<<<<<<< @@ -71296,9 +74324,9 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS * if returnAll: */ { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2132, __pyx_L6_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2218, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2132, __pyx_L6_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2218, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; @@ -71318,7 +74346,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2132, __pyx_L6_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2218, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -71327,9 +74355,9 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2132, __pyx_L6_error) + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2218, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2132, __pyx_L6_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2218, __pyx_L6_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -71338,28 +74366,28 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2132, __pyx_L6_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2218, __pyx_L6_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2132, __pyx_L6_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2218, __pyx_L6_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2132, __pyx_L6_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2218, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2132, __pyx_L6_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2218, __pyx_L6_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2132, __pyx_L6_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2218, __pyx_L6_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2132, __pyx_L6_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2218, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -71369,7 +74397,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2132, __pyx_L6_error) + else __PYX_ERR(0, 2218, __pyx_L6_error) } break; } @@ -71377,7 +74405,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS } __Pyx_XDECREF_SET(__pyx_9genexpr36__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr36__pyx_v_i, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2132, __pyx_L6_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr36__pyx_v_i, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2218, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_9 = NULL; __pyx_t_5 = 0; @@ -71397,11 +74425,11 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_cur_scope->__pyx_v_othershape}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2132, __pyx_L6_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2218, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2132, __pyx_L6_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2218, __pyx_L6_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -71415,38 +74443,38 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __pyx_v_ps = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2133 + /* "collisions.py":2219 * if checkShpType(othershape, ShpTyps.Point): * ps = [i.closestPointTo(othershape) for i in self.toLines()] * ps.sort(key=lambda x: abs(x[0]-othershape[0])**2+abs(x[1]-othershape[1])**2) # <<<<<<<<<<<<<< * if returnAll: * return ps */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ps, __pyx_n_s_sort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2133, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_ps, __pyx_n_s_sort); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2133, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_14closestPointTo_4lambda21, 0, __pyx_n_s_ClosedShape_closestPointTo_local, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2133, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_14closestPointTo_4lambda21, 0, __pyx_n_s_ClosedShape_closestPointTo_local, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_key, __pyx_t_2) < 0) __PYX_ERR(0, 2133, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_key, __pyx_t_2) < 0) __PYX_ERR(0, 2219, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2133, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2134 + /* "collisions.py":2220 * ps = [i.closestPointTo(othershape) for i in self.toLines()] * ps.sort(key=lambda x: abs(x[0]-othershape[0])**2+abs(x[1]-othershape[1])**2) * if returnAll: # <<<<<<<<<<<<<< * return ps * return ps[0] */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2134, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2220, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":2135 + /* "collisions.py":2221 * ps.sort(key=lambda x: abs(x[0]-othershape[0])**2+abs(x[1]-othershape[1])**2) * if returnAll: * return ps # <<<<<<<<<<<<<< @@ -71458,7 +74486,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __pyx_r = __pyx_v_ps; goto __pyx_L0; - /* "collisions.py":2134 + /* "collisions.py":2220 * ps = [i.closestPointTo(othershape) for i in self.toLines()] * ps.sort(key=lambda x: abs(x[0]-othershape[0])**2+abs(x[1]-othershape[1])**2) * if returnAll: # <<<<<<<<<<<<<< @@ -71467,7 +74495,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS */ } - /* "collisions.py":2136 + /* "collisions.py":2222 * if returnAll: * return ps * return ps[0] # <<<<<<<<<<<<<< @@ -71475,13 +74503,13 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS * colls = self.whereCollides(othershape) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_ps, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2136, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_ps, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":2131 + /* "collisions.py":2217 * pointLike / Iterable[pointLike]: The closest point(s, depending on returnAll) ON this object TO the othershape * """ * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< @@ -71490,18 +74518,18 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS */ } - /* "collisions.py":2137 + /* "collisions.py":2223 * return ps * return ps[0] * elif checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< * colls = self.whereCollides(othershape) * if colls != []: */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2137, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2137, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2137, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -71523,22 +74551,22 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2137, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2223, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2137, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2223, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "collisions.py":2138 + /* "collisions.py":2224 * return ps[0] * elif checkShpType(othershape, ShpTyps.Line): * colls = self.whereCollides(othershape) # <<<<<<<<<<<<<< * if colls != []: * if returnAll: */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2138, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = NULL; __pyx_t_5 = 0; @@ -71558,39 +74586,39 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_othershape}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2138, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2224, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_v_colls = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":2139 + /* "collisions.py":2225 * elif checkShpType(othershape, ShpTyps.Line): * colls = self.whereCollides(othershape) * if colls != []: # <<<<<<<<<<<<<< * if returnAll: * return colls */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2139, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2225, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_colls, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2139, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_colls, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2139, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2225, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_6) { - /* "collisions.py":2140 + /* "collisions.py":2226 * colls = self.whereCollides(othershape) * if colls != []: * if returnAll: # <<<<<<<<<<<<<< * return colls * return colls[0] */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2140, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2226, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":2141 + /* "collisions.py":2227 * if colls != []: * if returnAll: * return colls # <<<<<<<<<<<<<< @@ -71602,7 +74630,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __pyx_r = __pyx_v_colls; goto __pyx_L0; - /* "collisions.py":2140 + /* "collisions.py":2226 * colls = self.whereCollides(othershape) * if colls != []: * if returnAll: # <<<<<<<<<<<<<< @@ -71611,7 +74639,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS */ } - /* "collisions.py":2142 + /* "collisions.py":2228 * if returnAll: * return colls * return colls[0] # <<<<<<<<<<<<<< @@ -71619,13 +74647,13 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS * p2 = oln.closestPointTo(ln) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_colls, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2142, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_colls, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":2139 + /* "collisions.py":2225 * elif checkShpType(othershape, ShpTyps.Line): * colls = self.whereCollides(othershape) * if colls != []: # <<<<<<<<<<<<<< @@ -71634,19 +74662,19 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS */ } - /* "collisions.py":2143 + /* "collisions.py":2229 * return colls * return colls[0] * def calculate(ln, oln, recalculate): # <<<<<<<<<<<<<< * p2 = oln.closestPointTo(ln) * p = ln.closestPointTo(Point(*p2)) */ - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_14closestPointTo_1calculate, 0, __pyx_n_s_ClosedShape_closestPointTo_local_2, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2143, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_14closestPointTo_1calculate, 0, __pyx_n_s_ClosedShape_closestPointTo_local_2, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_calculate = __pyx_t_4; __pyx_t_4 = 0; - /* "collisions.py":2153 + /* "collisions.py":2239 * tries = [ * calculate(othershape, p, False) for p in self.toLines() * ] + [ # <<<<<<<<<<<<<< @@ -71655,24 +74683,24 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS */ { /* enter inner scope */ - /* "collisions.py":2151 + /* "collisions.py":2237 * p = p3 * return p2, abs(p[0]-p2[0])**2+abs(p[1]-p2[1])**2 * tries = [ # <<<<<<<<<<<<<< * calculate(othershape, p, False) for p in self.toLines() * ] + [ */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2151, __pyx_L16_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2237, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_4); - /* "collisions.py":2152 + /* "collisions.py":2238 * return p2, abs(p[0]-p2[0])**2+abs(p[1]-p2[1])**2 * tries = [ * calculate(othershape, p, False) for p in self.toLines() # <<<<<<<<<<<<<< * ] + [ * calculate(ln, othershape, True) for ln in self.toLines() */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2152, __pyx_L16_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2238, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; __pyx_t_5 = 0; @@ -71692,7 +74720,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2152, __pyx_L16_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2238, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -71701,9 +74729,9 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2152, __pyx_L16_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2238, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2152, __pyx_L16_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2238, __pyx_L16_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -71712,28 +74740,28 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2152, __pyx_L16_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2238, __pyx_L16_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2152, __pyx_L16_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2238, __pyx_L16_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2152, __pyx_L16_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2238, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2152, __pyx_L16_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2238, __pyx_L16_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2152, __pyx_L16_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2238, __pyx_L16_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2152, __pyx_L16_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2238, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -71743,7 +74771,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2152, __pyx_L16_error) + else __PYX_ERR(0, 2238, __pyx_L16_error) } break; } @@ -71751,21 +74779,21 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS } __Pyx_XDECREF_SET(__pyx_9genexpr37__pyx_v_p, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2152, __pyx_L16_error) + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2238, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_othershape); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_othershape); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_othershape)) __PYX_ERR(0, 2152, __pyx_L16_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_othershape)) __PYX_ERR(0, 2238, __pyx_L16_error); __Pyx_INCREF(__pyx_9genexpr37__pyx_v_p); __Pyx_GIVEREF(__pyx_9genexpr37__pyx_v_p); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_9genexpr37__pyx_v_p)) __PYX_ERR(0, 2152, __pyx_L16_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_9genexpr37__pyx_v_p)) __PYX_ERR(0, 2238, __pyx_L16_error); __Pyx_INCREF(Py_False); __Pyx_GIVEREF(Py_False); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, Py_False)) __PYX_ERR(0, 2152, __pyx_L16_error); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2152, __pyx_L16_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, Py_False)) __PYX_ERR(0, 2238, __pyx_L16_error); + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2238, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 2151, __pyx_L16_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 2237, __pyx_L16_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -71778,24 +74806,24 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS } /* exit inner scope */ { /* enter inner scope */ - /* "collisions.py":2153 + /* "collisions.py":2239 * tries = [ * calculate(othershape, p, False) for p in self.toLines() * ] + [ # <<<<<<<<<<<<<< * calculate(ln, othershape, True) for ln in self.toLines() * ] */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2153, __pyx_L23_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2239, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_3); - /* "collisions.py":2154 + /* "collisions.py":2240 * calculate(othershape, p, False) for p in self.toLines() * ] + [ * calculate(ln, othershape, True) for ln in self.toLines() # <<<<<<<<<<<<<< * ] * tries.sort(key=lambda x: x[1]) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2154, __pyx_L23_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2240, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = NULL; __pyx_t_5 = 0; @@ -71815,7 +74843,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2154, __pyx_L23_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2240, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -71824,9 +74852,9 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2154, __pyx_L23_error) + __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2240, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2154, __pyx_L23_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2240, __pyx_L23_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -71835,28 +74863,28 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2154, __pyx_L23_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2240, __pyx_L23_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2154, __pyx_L23_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2240, __pyx_L23_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2154, __pyx_L23_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2240, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2154, __pyx_L23_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2240, __pyx_L23_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2154, __pyx_L23_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2240, __pyx_L23_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2154, __pyx_L23_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2240, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -71866,7 +74894,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2154, __pyx_L23_error) + else __PYX_ERR(0, 2240, __pyx_L23_error) } break; } @@ -71874,21 +74902,21 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS } __Pyx_XDECREF_SET(__pyx_9genexpr38__pyx_v_ln, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2154, __pyx_L23_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2240, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_9genexpr38__pyx_v_ln); __Pyx_GIVEREF(__pyx_9genexpr38__pyx_v_ln); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_9genexpr38__pyx_v_ln)) __PYX_ERR(0, 2154, __pyx_L23_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_9genexpr38__pyx_v_ln)) __PYX_ERR(0, 2240, __pyx_L23_error); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_othershape); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_othershape); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_v_othershape)) __PYX_ERR(0, 2154, __pyx_L23_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_v_othershape)) __PYX_ERR(0, 2240, __pyx_L23_error); __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_True)) __PYX_ERR(0, 2154, __pyx_L23_error); - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2154, __pyx_L23_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_True)) __PYX_ERR(0, 2240, __pyx_L23_error); + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2240, __pyx_L23_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 2153, __pyx_L23_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 2239, __pyx_L23_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -71900,52 +74928,52 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __pyx_L27_exit_scope:; } /* exit inner scope */ - /* "collisions.py":2153 + /* "collisions.py":2239 * tries = [ * calculate(othershape, p, False) for p in self.toLines() * ] + [ # <<<<<<<<<<<<<< * calculate(ln, othershape, True) for ln in self.toLines() * ] */ - __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2153, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2239, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_tries = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2156 + /* "collisions.py":2242 * calculate(ln, othershape, True) for ln in self.toLines() * ] * tries.sort(key=lambda x: x[1]) # <<<<<<<<<<<<<< * if returnAll: * return [i[0] for i in tries] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tries, __pyx_n_s_sort); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2156, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tries, __pyx_n_s_sort); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2156, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_14closestPointTo_5lambda22, 0, __pyx_n_s_ClosedShape_closestPointTo_local, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2156, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_14closestPointTo_5lambda22, 0, __pyx_n_s_ClosedShape_closestPointTo_local, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_key, __pyx_t_4) < 0) __PYX_ERR(0, 2156, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_key, __pyx_t_4) < 0) __PYX_ERR(0, 2242, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2156, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2157 + /* "collisions.py":2243 * ] * tries.sort(key=lambda x: x[1]) * if returnAll: # <<<<<<<<<<<<<< * return [i[0] for i in tries] * return tries[0][0] */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2157, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2243, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":2158 + /* "collisions.py":2244 * tries.sort(key=lambda x: x[1]) * if returnAll: * return [i[0] for i in tries] # <<<<<<<<<<<<<< @@ -71954,7 +74982,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2158, __pyx_L31_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2244, __pyx_L31_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_v_tries; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0; @@ -71962,21 +74990,21 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2158, __pyx_L31_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2244, __pyx_L31_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2158, __pyx_L31_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2244, __pyx_L31_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2158, __pyx_L31_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2244, __pyx_L31_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_XDECREF_SET(__pyx_9genexpr39__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_9genexpr39__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2158, __pyx_L31_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_9genexpr39__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2244, __pyx_L31_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2158, __pyx_L31_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2244, __pyx_L31_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -71991,7 +75019,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":2157 + /* "collisions.py":2243 * ] * tries.sort(key=lambda x: x[1]) * if returnAll: # <<<<<<<<<<<<<< @@ -72000,7 +75028,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS */ } - /* "collisions.py":2159 + /* "collisions.py":2245 * if returnAll: * return [i[0] for i in tries] * return tries[0][0] # <<<<<<<<<<<<<< @@ -72008,16 +75036,16 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_tries, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2159, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_tries, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2159, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2137 + /* "collisions.py":2223 * return ps * return ps[0] * elif checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< @@ -72026,18 +75054,18 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS */ } - /* "collisions.py":2160 + /* "collisions.py":2246 * return [i[0] for i in tries] * return tries[0][0] * elif checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) * elif checkShpType(othershape, ShpTyps.Arc): */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2160, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2160, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Circle); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2160, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Circle); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -72059,15 +75087,15 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2160, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2160, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2246, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { - /* "collisions.py":2161 + /* "collisions.py":2247 * return tries[0][0] * elif checkShpType(othershape, ShpTyps.Circle): * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) # <<<<<<<<<<<<<< @@ -72075,13 +75103,13 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS * closests = [] */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2161, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Point); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2161, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Point); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2161, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2161, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; __pyx_t_5 = 0; @@ -72103,7 +75131,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2161, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -72126,7 +75154,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2161, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -72134,7 +75162,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2160 + /* "collisions.py":2246 * return [i[0] for i in tries] * return tries[0][0] * elif checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< @@ -72143,18 +75171,18 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS */ } - /* "collisions.py":2162 + /* "collisions.py":2248 * elif checkShpType(othershape, ShpTyps.Circle): * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) * elif checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< * closests = [] * for ln in self.toLines(): */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2162, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2162, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_Arc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2162, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_Arc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -72176,34 +75204,34 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2162, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2162, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2248, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { - /* "collisions.py":2163 + /* "collisions.py":2249 * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) * elif checkShpType(othershape, ShpTyps.Arc): * closests = [] # <<<<<<<<<<<<<< * for ln in self.toLines(): * cp = othershape.closestPointTo(ln) */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2163, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2249, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_closests = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2164 + /* "collisions.py":2250 * elif checkShpType(othershape, ShpTyps.Arc): * closests = [] * for ln in self.toLines(): # <<<<<<<<<<<<<< * cp = othershape.closestPointTo(ln) * mycp = self.closestPointTo(Point(*cp)) */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2164, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_2 = NULL; __pyx_t_5 = 0; @@ -72223,7 +75251,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2164, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -72232,9 +75260,9 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2164, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2164, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2250, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -72243,28 +75271,28 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2164, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2250, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2164, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2250, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2164, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2164, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2250, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2164, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2250, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2164, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2250, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -72274,7 +75302,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2164, __pyx_L1_error) + else __PYX_ERR(0, 2250, __pyx_L1_error) } break; } @@ -72283,14 +75311,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __Pyx_XDECREF_SET(__pyx_v_ln, __pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2165 + /* "collisions.py":2251 * closests = [] * for ln in self.toLines(): * cp = othershape.closestPointTo(ln) # <<<<<<<<<<<<<< * mycp = self.closestPointTo(Point(*cp)) * d = (cp[0]-mycp[0])**2+(cp[1]-mycp[1])**2 */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2165, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = NULL; __pyx_t_5 = 0; @@ -72310,27 +75338,27 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_ln}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2165, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2251, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_XDECREF_SET(__pyx_v_cp, __pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2166 + /* "collisions.py":2252 * for ln in self.toLines(): * cp = othershape.closestPointTo(ln) * mycp = self.closestPointTo(Point(*cp)) # <<<<<<<<<<<<<< * d = (cp[0]-mycp[0])**2+(cp[1]-mycp[1])**2 * closests.append((mycp, d)) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2166, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_Point); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2166, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_Point); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = __Pyx_PySequence_Tuple(__pyx_v_cp); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2166, __pyx_L1_error) + __pyx_t_10 = __Pyx_PySequence_Tuple(__pyx_v_cp); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2166, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -72353,68 +75381,68 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2166, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_XDECREF_SET(__pyx_v_mycp, __pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2167 + /* "collisions.py":2253 * cp = othershape.closestPointTo(ln) * mycp = self.closestPointTo(Point(*cp)) * d = (cp[0]-mycp[0])**2+(cp[1]-mycp[1])**2 # <<<<<<<<<<<<<< * closests.append((mycp, d)) * closests.sort(key=lambda x: x[1]) */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_cp, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2167, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_cp, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_mycp, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2167, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_mycp, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2167, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2167, __pyx_L1_error) + __pyx_t_2 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_cp, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2167, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_cp, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_mycp, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2167, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_mycp, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2167, __pyx_L1_error) + __pyx_t_10 = PyNumber_Subtract(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Power(__pyx_t_10, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2167, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_10, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2167, __pyx_L1_error) + __pyx_t_10 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2168 + /* "collisions.py":2254 * mycp = self.closestPointTo(Point(*cp)) * d = (cp[0]-mycp[0])**2+(cp[1]-mycp[1])**2 * closests.append((mycp, d)) # <<<<<<<<<<<<<< * closests.sort(key=lambda x: x[1]) * if returnAll: */ - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2168, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_v_mycp); __Pyx_GIVEREF(__pyx_v_mycp); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_mycp)) __PYX_ERR(0, 2168, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_mycp)) __PYX_ERR(0, 2254, __pyx_L1_error); __Pyx_INCREF(__pyx_v_d); __Pyx_GIVEREF(__pyx_v_d); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_d)) __PYX_ERR(0, 2168, __pyx_L1_error); - __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_closests, __pyx_t_10); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 2168, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_v_d)) __PYX_ERR(0, 2254, __pyx_L1_error); + __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_closests, __pyx_t_10); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 2254, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2164 + /* "collisions.py":2250 * elif checkShpType(othershape, ShpTyps.Arc): * closests = [] * for ln in self.toLines(): # <<<<<<<<<<<<<< @@ -72424,38 +75452,38 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2169 + /* "collisions.py":2255 * d = (cp[0]-mycp[0])**2+(cp[1]-mycp[1])**2 * closests.append((mycp, d)) * closests.sort(key=lambda x: x[1]) # <<<<<<<<<<<<<< * if returnAll: * return [i[0] for i in closests] */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_closests, __pyx_n_s_sort); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2169, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_closests, __pyx_n_s_sort); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2169, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_14closestPointTo_6lambda23, 0, __pyx_n_s_ClosedShape_closestPointTo_local, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2169, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_14closestPointTo_6lambda23, 0, __pyx_n_s_ClosedShape_closestPointTo_local, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_key, __pyx_t_3) < 0) __PYX_ERR(0, 2169, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_key, __pyx_t_3) < 0) __PYX_ERR(0, 2255, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2169, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2170 + /* "collisions.py":2256 * closests.append((mycp, d)) * closests.sort(key=lambda x: x[1]) * if returnAll: # <<<<<<<<<<<<<< * return [i[0] for i in closests] * return closests[0][0] */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2170, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2256, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":2171 + /* "collisions.py":2257 * closests.sort(key=lambda x: x[1]) * if returnAll: * return [i[0] for i in closests] # <<<<<<<<<<<<<< @@ -72464,7 +75492,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2171, __pyx_L42_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2257, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_10 = __pyx_v_closests; __Pyx_INCREF(__pyx_t_10); __pyx_t_7 = 0; @@ -72472,21 +75500,21 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2171, __pyx_L42_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2257, __pyx_L42_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_4 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2171, __pyx_L42_error) + __pyx_t_4 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2257, __pyx_L42_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2171, __pyx_L42_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2257, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_XDECREF_SET(__pyx_9genexpr40__pyx_v_i, __pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_9genexpr40__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2171, __pyx_L42_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_9genexpr40__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2257, __pyx_L42_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 2171, __pyx_L42_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 2257, __pyx_L42_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -72501,7 +75529,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2170 + /* "collisions.py":2256 * closests.append((mycp, d)) * closests.sort(key=lambda x: x[1]) * if returnAll: # <<<<<<<<<<<<<< @@ -72510,7 +75538,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS */ } - /* "collisions.py":2172 + /* "collisions.py":2258 * if returnAll: * return [i[0] for i in closests] * return closests[0][0] # <<<<<<<<<<<<<< @@ -72518,16 +75546,16 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS * colls = self.whereCollides(othershape) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_closests, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2172, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_closests, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2172, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_r = __pyx_t_10; __pyx_t_10 = 0; goto __pyx_L0; - /* "collisions.py":2162 + /* "collisions.py":2248 * elif checkShpType(othershape, ShpTyps.Circle): * return self.closestPointTo(Point(othershape.x, othershape.y), returnAll) * elif checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< @@ -72536,7 +75564,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS */ } - /* "collisions.py":2174 + /* "collisions.py":2260 * return closests[0][0] * else: * colls = self.whereCollides(othershape) # <<<<<<<<<<<<<< @@ -72544,7 +75572,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS * if returnAll: */ /*else*/ { - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2174, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -72564,39 +75592,39 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_othershape}; __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2174, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_colls = __pyx_t_10; __pyx_t_10 = 0; - /* "collisions.py":2175 + /* "collisions.py":2261 * else: * colls = self.whereCollides(othershape) * if colls != []: # <<<<<<<<<<<<<< * if returnAll: * return colls */ - __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2175, __pyx_L1_error) + __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_colls, __pyx_t_10, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2175, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_colls, __pyx_t_10, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2261, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2175, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2261, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_6) { - /* "collisions.py":2176 + /* "collisions.py":2262 * colls = self.whereCollides(othershape) * if colls != []: * if returnAll: # <<<<<<<<<<<<<< * return colls * return colls[0] */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2176, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2262, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":2177 + /* "collisions.py":2263 * if colls != []: * if returnAll: * return colls # <<<<<<<<<<<<<< @@ -72608,7 +75636,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __pyx_r = __pyx_v_colls; goto __pyx_L0; - /* "collisions.py":2176 + /* "collisions.py":2262 * colls = self.whereCollides(othershape) * if colls != []: * if returnAll: # <<<<<<<<<<<<<< @@ -72617,7 +75645,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS */ } - /* "collisions.py":2178 + /* "collisions.py":2264 * if returnAll: * return colls * return colls[0] # <<<<<<<<<<<<<< @@ -72625,13 +75653,13 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS * p2 = ln.closestPointTo(Point(*point)) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_colls, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2178, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_colls, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2264, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2175 + /* "collisions.py":2261 * else: * colls = self.whereCollides(othershape) * if colls != []: # <<<<<<<<<<<<<< @@ -72640,38 +75668,38 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS */ } - /* "collisions.py":2179 + /* "collisions.py":2265 * return colls * return colls[0] * def calculate(ln, point, recalculate): # <<<<<<<<<<<<<< * p2 = ln.closestPointTo(Point(*point)) * olineP = point */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_14closestPointTo_3calculate, 0, __pyx_n_s_ClosedShape_closestPointTo_local_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2179, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_14closestPointTo_3calculate, 0, __pyx_n_s_ClosedShape_closestPointTo_local_2, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_calculate = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":2186 + /* "collisions.py":2272 * p2 = self.closestPointTo(Point(*p2)) * return p2, abs(p2[0]-olineP[0])**2+abs(p2[1]-olineP[1])**2 * tries = [] # <<<<<<<<<<<<<< * olns = othershape.toLines() * slns = self.toLines() */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2186, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_tries = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2187 + /* "collisions.py":2273 * return p2, abs(p2[0]-olineP[0])**2+abs(p2[1]-olineP[1])**2 * tries = [] * olns = othershape.toLines() # <<<<<<<<<<<<<< * slns = self.toLines() * for ln in slns: */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_toLines); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2187, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_othershape, __pyx_n_s_toLines); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -72691,21 +75719,21 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2187, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __pyx_v_olns = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":2188 + /* "collisions.py":2274 * tries = [] * olns = othershape.toLines() * slns = self.toLines() # <<<<<<<<<<<<<< * for ln in slns: * tries.extend([calculate(ln, oln.p1, False) for oln in olns]) */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2188, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -72725,14 +75753,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2188, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __pyx_v_slns = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":2189 + /* "collisions.py":2275 * olns = othershape.toLines() * slns = self.toLines() * for ln in slns: # <<<<<<<<<<<<<< @@ -72744,9 +75772,9 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_slns); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2189, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_slns); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2189, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2275, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { @@ -72754,28 +75782,28 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2189, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2275, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_10 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2189, __pyx_L1_error) + __pyx_t_10 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2275, __pyx_L1_error) #else - __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2189, __pyx_L1_error) + __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2189, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2275, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2189, __pyx_L1_error) + __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2275, __pyx_L1_error) #else - __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2189, __pyx_L1_error) + __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2275, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); #endif } @@ -72785,7 +75813,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2189, __pyx_L1_error) + else __PYX_ERR(0, 2275, __pyx_L1_error) } break; } @@ -72794,7 +75822,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __Pyx_XDECREF_SET(__pyx_v_ln, __pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2190 + /* "collisions.py":2276 * slns = self.toLines() * for ln in slns: * tries.extend([calculate(ln, oln.p1, False) for oln in olns]) # <<<<<<<<<<<<<< @@ -72802,16 +75830,16 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS * for oln in olns: */ { /* enter inner scope */ - __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2190, __pyx_L53_error) + __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2276, __pyx_L53_error) __Pyx_GOTREF(__pyx_t_10); if (likely(PyList_CheckExact(__pyx_v_olns)) || PyTuple_CheckExact(__pyx_v_olns)) { __pyx_t_4 = __pyx_v_olns; __Pyx_INCREF(__pyx_t_4); __pyx_t_13 = 0; __pyx_t_14 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_olns); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2190, __pyx_L53_error) + __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_olns); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2276, __pyx_L53_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2190, __pyx_L53_error) + __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2276, __pyx_L53_error) } for (;;) { if (likely(!__pyx_t_14)) { @@ -72819,28 +75847,28 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2190, __pyx_L53_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2276, __pyx_L53_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 2190, __pyx_L53_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 2276, __pyx_L53_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2190, __pyx_L53_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2276, __pyx_L53_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2190, __pyx_L53_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2276, __pyx_L53_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 2190, __pyx_L53_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 2276, __pyx_L53_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2190, __pyx_L53_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2276, __pyx_L53_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -72850,7 +75878,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2190, __pyx_L53_error) + else __PYX_ERR(0, 2276, __pyx_L53_error) } break; } @@ -72858,23 +75886,23 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS } __Pyx_XDECREF_SET(__pyx_9genexpr41__pyx_v_oln, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr41__pyx_v_oln, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2190, __pyx_L53_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr41__pyx_v_oln, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2276, __pyx_L53_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2190, __pyx_L53_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2276, __pyx_L53_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_ln); __Pyx_GIVEREF(__pyx_v_ln); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_ln)) __PYX_ERR(0, 2190, __pyx_L53_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_ln)) __PYX_ERR(0, 2276, __pyx_L53_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 2190, __pyx_L53_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 2276, __pyx_L53_error); __Pyx_INCREF(Py_False); __Pyx_GIVEREF(Py_False); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_False)) __PYX_ERR(0, 2190, __pyx_L53_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_False)) __PYX_ERR(0, 2276, __pyx_L53_error); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2190, __pyx_L53_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2276, __pyx_L53_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2190, __pyx_L53_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2276, __pyx_L53_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -72885,10 +75913,10 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS goto __pyx_L1_error; __pyx_L57_exit_scope:; } /* exit inner scope */ - __pyx_t_12 = __Pyx_PyList_Extend(__pyx_v_tries, __pyx_t_10); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 2190, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyList_Extend(__pyx_v_tries, __pyx_t_10); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 2276, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2191 + /* "collisions.py":2277 * for ln in slns: * tries.extend([calculate(ln, oln.p1, False) for oln in olns]) * tries.extend([calculate(ln, oln.p2, False) for oln in olns]) # <<<<<<<<<<<<<< @@ -72896,16 +75924,16 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS * tries.extend([calculate(oln, ln.p1, True) for ln in slns]) */ { /* enter inner scope */ - __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2191, __pyx_L60_error) + __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2277, __pyx_L60_error) __Pyx_GOTREF(__pyx_t_10); if (likely(PyList_CheckExact(__pyx_v_olns)) || PyTuple_CheckExact(__pyx_v_olns)) { __pyx_t_4 = __pyx_v_olns; __Pyx_INCREF(__pyx_t_4); __pyx_t_13 = 0; __pyx_t_14 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_olns); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2191, __pyx_L60_error) + __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_olns); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2277, __pyx_L60_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2191, __pyx_L60_error) + __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2277, __pyx_L60_error) } for (;;) { if (likely(!__pyx_t_14)) { @@ -72913,28 +75941,28 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2191, __pyx_L60_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2277, __pyx_L60_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 2191, __pyx_L60_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 2277, __pyx_L60_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2191, __pyx_L60_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2277, __pyx_L60_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2191, __pyx_L60_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2277, __pyx_L60_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 2191, __pyx_L60_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 2277, __pyx_L60_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2191, __pyx_L60_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2277, __pyx_L60_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -72944,7 +75972,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2191, __pyx_L60_error) + else __PYX_ERR(0, 2277, __pyx_L60_error) } break; } @@ -72952,23 +75980,23 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS } __Pyx_XDECREF_SET(__pyx_9genexpr42__pyx_v_oln, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr42__pyx_v_oln, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2191, __pyx_L60_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr42__pyx_v_oln, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2277, __pyx_L60_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2191, __pyx_L60_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2277, __pyx_L60_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_ln); __Pyx_GIVEREF(__pyx_v_ln); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_ln)) __PYX_ERR(0, 2191, __pyx_L60_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_ln)) __PYX_ERR(0, 2277, __pyx_L60_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 2191, __pyx_L60_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 2277, __pyx_L60_error); __Pyx_INCREF(Py_False); __Pyx_GIVEREF(Py_False); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_False)) __PYX_ERR(0, 2191, __pyx_L60_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_False)) __PYX_ERR(0, 2277, __pyx_L60_error); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2191, __pyx_L60_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2277, __pyx_L60_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2191, __pyx_L60_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2277, __pyx_L60_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -72979,10 +76007,10 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS goto __pyx_L1_error; __pyx_L64_exit_scope:; } /* exit inner scope */ - __pyx_t_12 = __Pyx_PyList_Extend(__pyx_v_tries, __pyx_t_10); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 2191, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyList_Extend(__pyx_v_tries, __pyx_t_10); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 2277, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2189 + /* "collisions.py":2275 * olns = othershape.toLines() * slns = self.toLines() * for ln in slns: # <<<<<<<<<<<<<< @@ -72992,7 +76020,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2192 + /* "collisions.py":2278 * tries.extend([calculate(ln, oln.p1, False) for oln in olns]) * tries.extend([calculate(ln, oln.p2, False) for oln in olns]) * for oln in olns: # <<<<<<<<<<<<<< @@ -73004,9 +76032,9 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_olns); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2192, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_olns); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2192, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2278, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { @@ -73014,28 +76042,28 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2192, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2278, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_10 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2192, __pyx_L1_error) + __pyx_t_10 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2278, __pyx_L1_error) #else - __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2192, __pyx_L1_error) + __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2192, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2278, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2192, __pyx_L1_error) + __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2278, __pyx_L1_error) #else - __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2192, __pyx_L1_error) + __pyx_t_10 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); #endif } @@ -73045,7 +76073,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2192, __pyx_L1_error) + else __PYX_ERR(0, 2278, __pyx_L1_error) } break; } @@ -73054,7 +76082,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __Pyx_XDECREF_SET(__pyx_v_oln, __pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2193 + /* "collisions.py":2279 * tries.extend([calculate(ln, oln.p2, False) for oln in olns]) * for oln in olns: * tries.extend([calculate(oln, ln.p1, True) for ln in slns]) # <<<<<<<<<<<<<< @@ -73062,16 +76090,16 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS * tries.sort(key=lambda x: x[1]) */ { /* enter inner scope */ - __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2193, __pyx_L70_error) + __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2279, __pyx_L70_error) __Pyx_GOTREF(__pyx_t_10); if (likely(PyList_CheckExact(__pyx_v_slns)) || PyTuple_CheckExact(__pyx_v_slns)) { __pyx_t_4 = __pyx_v_slns; __Pyx_INCREF(__pyx_t_4); __pyx_t_13 = 0; __pyx_t_14 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_slns); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2193, __pyx_L70_error) + __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_slns); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2279, __pyx_L70_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2193, __pyx_L70_error) + __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2279, __pyx_L70_error) } for (;;) { if (likely(!__pyx_t_14)) { @@ -73079,28 +76107,28 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2193, __pyx_L70_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2279, __pyx_L70_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 2193, __pyx_L70_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 2279, __pyx_L70_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2193, __pyx_L70_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2279, __pyx_L70_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2193, __pyx_L70_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2279, __pyx_L70_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 2193, __pyx_L70_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 2279, __pyx_L70_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2193, __pyx_L70_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2279, __pyx_L70_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -73110,7 +76138,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2193, __pyx_L70_error) + else __PYX_ERR(0, 2279, __pyx_L70_error) } break; } @@ -73118,23 +76146,23 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS } __Pyx_XDECREF_SET(__pyx_9genexpr43__pyx_v_ln, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr43__pyx_v_ln, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2193, __pyx_L70_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr43__pyx_v_ln, __pyx_n_s_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2279, __pyx_L70_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2193, __pyx_L70_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2279, __pyx_L70_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_oln); __Pyx_GIVEREF(__pyx_v_oln); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_oln)) __PYX_ERR(0, 2193, __pyx_L70_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_oln)) __PYX_ERR(0, 2279, __pyx_L70_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 2193, __pyx_L70_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 2279, __pyx_L70_error); __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_True)) __PYX_ERR(0, 2193, __pyx_L70_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_True)) __PYX_ERR(0, 2279, __pyx_L70_error); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2193, __pyx_L70_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2279, __pyx_L70_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2193, __pyx_L70_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2279, __pyx_L70_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -73145,10 +76173,10 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS goto __pyx_L1_error; __pyx_L74_exit_scope:; } /* exit inner scope */ - __pyx_t_12 = __Pyx_PyList_Extend(__pyx_v_tries, __pyx_t_10); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 2193, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyList_Extend(__pyx_v_tries, __pyx_t_10); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 2279, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2194 + /* "collisions.py":2280 * for oln in olns: * tries.extend([calculate(oln, ln.p1, True) for ln in slns]) * tries.extend([calculate(oln, ln.p2, True) for ln in slns]) # <<<<<<<<<<<<<< @@ -73156,16 +76184,16 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS * if returnAll: */ { /* enter inner scope */ - __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2194, __pyx_L77_error) + __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2280, __pyx_L77_error) __Pyx_GOTREF(__pyx_t_10); if (likely(PyList_CheckExact(__pyx_v_slns)) || PyTuple_CheckExact(__pyx_v_slns)) { __pyx_t_4 = __pyx_v_slns; __Pyx_INCREF(__pyx_t_4); __pyx_t_13 = 0; __pyx_t_14 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_slns); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2194, __pyx_L77_error) + __pyx_t_13 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_slns); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2280, __pyx_L77_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2194, __pyx_L77_error) + __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2280, __pyx_L77_error) } for (;;) { if (likely(!__pyx_t_14)) { @@ -73173,28 +76201,28 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2194, __pyx_L77_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2280, __pyx_L77_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 2194, __pyx_L77_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 2280, __pyx_L77_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2194, __pyx_L77_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2280, __pyx_L77_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2194, __pyx_L77_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2280, __pyx_L77_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 2194, __pyx_L77_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 2280, __pyx_L77_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2194, __pyx_L77_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2280, __pyx_L77_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -73204,7 +76232,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2194, __pyx_L77_error) + else __PYX_ERR(0, 2280, __pyx_L77_error) } break; } @@ -73212,23 +76240,23 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS } __Pyx_XDECREF_SET(__pyx_9genexpr44__pyx_v_ln, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr44__pyx_v_ln, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2194, __pyx_L77_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr44__pyx_v_ln, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2280, __pyx_L77_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2194, __pyx_L77_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2280, __pyx_L77_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_oln); __Pyx_GIVEREF(__pyx_v_oln); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_oln)) __PYX_ERR(0, 2194, __pyx_L77_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_oln)) __PYX_ERR(0, 2280, __pyx_L77_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 2194, __pyx_L77_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 2280, __pyx_L77_error); __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_True)) __PYX_ERR(0, 2194, __pyx_L77_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, Py_True)) __PYX_ERR(0, 2280, __pyx_L77_error); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2194, __pyx_L77_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_calculate, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2280, __pyx_L77_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2194, __pyx_L77_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_10, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2280, __pyx_L77_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -73239,10 +76267,10 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS goto __pyx_L1_error; __pyx_L81_exit_scope:; } /* exit inner scope */ - __pyx_t_12 = __Pyx_PyList_Extend(__pyx_v_tries, __pyx_t_10); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 2194, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyList_Extend(__pyx_v_tries, __pyx_t_10); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 2280, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2192 + /* "collisions.py":2278 * tries.extend([calculate(ln, oln.p1, False) for oln in olns]) * tries.extend([calculate(ln, oln.p2, False) for oln in olns]) * for oln in olns: # <<<<<<<<<<<<<< @@ -73252,38 +76280,38 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2195 + /* "collisions.py":2281 * tries.extend([calculate(oln, ln.p1, True) for ln in slns]) * tries.extend([calculate(oln, ln.p2, True) for ln in slns]) * tries.sort(key=lambda x: x[1]) # <<<<<<<<<<<<<< * if returnAll: * return [i[0] for i in tries] */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tries, __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2195, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tries, __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2195, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_14closestPointTo_7lambda24, 0, __pyx_n_s_ClosedShape_closestPointTo_local, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2195, __pyx_L1_error) + __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_14closestPointTo_7lambda24, 0, __pyx_n_s_ClosedShape_closestPointTo_local, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_key, __pyx_t_4) < 0) __PYX_ERR(0, 2195, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_key, __pyx_t_4) < 0) __PYX_ERR(0, 2281, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2195, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_10); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2196 + /* "collisions.py":2282 * tries.extend([calculate(oln, ln.p2, True) for ln in slns]) * tries.sort(key=lambda x: x[1]) * if returnAll: # <<<<<<<<<<<<<< * return [i[0] for i in tries] * return tries[0][0] */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2196, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_returnAll); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2282, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":2197 + /* "collisions.py":2283 * tries.sort(key=lambda x: x[1]) * if returnAll: * return [i[0] for i in tries] # <<<<<<<<<<<<<< @@ -73292,7 +76320,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2197, __pyx_L86_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2283, __pyx_L86_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_10 = __pyx_v_tries; __Pyx_INCREF(__pyx_t_10); __pyx_t_7 = 0; @@ -73300,21 +76328,21 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_10); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2197, __pyx_L86_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2283, __pyx_L86_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2197, __pyx_L86_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2283, __pyx_L86_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2197, __pyx_L86_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_10, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2283, __pyx_L86_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XDECREF_SET(__pyx_9genexpr45__pyx_v_i, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_9genexpr45__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2197, __pyx_L86_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_9genexpr45__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2283, __pyx_L86_error) __Pyx_GOTREF(__pyx_t_3); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 2197, __pyx_L86_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 2283, __pyx_L86_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; @@ -73329,7 +76357,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":2196 + /* "collisions.py":2282 * tries.extend([calculate(oln, ln.p2, True) for ln in slns]) * tries.sort(key=lambda x: x[1]) * if returnAll: # <<<<<<<<<<<<<< @@ -73338,7 +76366,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS */ } - /* "collisions.py":2198 + /* "collisions.py":2284 * if returnAll: * return [i[0] for i in tries] * return tries[0][0] # <<<<<<<<<<<<<< @@ -73346,9 +76374,9 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS * def handleCollisionsPos(self, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_tries, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2198, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_tries, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2198, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_r = __pyx_t_10; @@ -73356,7 +76384,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS goto __pyx_L0; } - /* "collisions.py":2120 + /* "collisions.py":2206 * return ps[0][0] * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike, Iterable[pointLike]]: # <<<<<<<<<<<<<< @@ -73404,7 +76432,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS return __pyx_r; } -/* "collisions.py":2200 +/* "collisions.py":2286 * return tries[0][0] * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< @@ -73412,7 +76440,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_4closestPointTo(CYTHON_UNUS * newShp: 'ClosedShape', */ -static PyObject *__pyx_pf_10collisions_54__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { +static PyObject *__pyx_pf_10collisions_56__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -73423,42 +76451,42 @@ static PyObject *__pyx_pf_10collisions_54__defaults__(CYTHON_UNUSED PyObject *__ __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - /* "collisions.py":2207 + /* "collisions.py":2293 * replaceSelf: bool = True, * precision: Number = BASEPRECISION, * verbose: bool = False # <<<<<<<<<<<<<< * ) -> tuple['ClosedShape', pointLike, verboseOutput]: * """ */ - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2200, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults18, __pyx_self)->__pyx_arg_vel); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults18, __pyx_self)->__pyx_arg_vel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults18, __pyx_self)->__pyx_arg_vel)) __PYX_ERR(0, 2200, __pyx_L1_error); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults19, __pyx_self)->__pyx_arg_vel); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults19, __pyx_self)->__pyx_arg_vel); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults19, __pyx_self)->__pyx_arg_vel)) __PYX_ERR(0, 2286, __pyx_L1_error); __Pyx_INCREF(((PyObject *)Py_True)); __Pyx_GIVEREF(((PyObject *)Py_True)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_True))) __PYX_ERR(0, 2200, __pyx_L1_error); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults18, __pyx_self)->__pyx_arg_precision); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults18, __pyx_self)->__pyx_arg_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults18, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 2200, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)Py_True))) __PYX_ERR(0, 2286, __pyx_L1_error); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults19, __pyx_self)->__pyx_arg_precision); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults19, __pyx_self)->__pyx_arg_precision); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __Pyx_CyFunction_Defaults(__pyx_defaults19, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 2286, __pyx_L1_error); __Pyx_INCREF(((PyObject *)Py_False)); __Pyx_GIVEREF(((PyObject *)Py_False)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)Py_False))) __PYX_ERR(0, 2200, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)Py_False))) __PYX_ERR(0, 2286, __pyx_L1_error); - /* "collisions.py":2200 + /* "collisions.py":2286 * return tries[0][0] * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< * oldShp: 'ClosedShape', * newShp: 'ClosedShape', */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2200, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 2200, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 2286, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 2200, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 2286, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -73522,7 +76550,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_oldShp,&__pyx_n_s_newShp,&__pyx_n_s_objs,&__pyx_n_s_vel,&__pyx_n_s_replaceSelf,&__pyx_n_s_precision,&__pyx_n_s_verbose,0}; - __pyx_defaults18 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults18, __pyx_self); + __pyx_defaults19 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults19, __pyx_self); values[4] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_vel); values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); values[6] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_precision); @@ -73556,7 +76584,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2200, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2286, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -73564,9 +76592,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2200, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2286, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 1); __PYX_ERR(0, 2200, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 1); __PYX_ERR(0, 2286, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -73574,9 +76602,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2200, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2286, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 2); __PYX_ERR(0, 2200, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 2); __PYX_ERR(0, 2286, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: @@ -73584,42 +76612,42 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2200, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2286, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 3); __PYX_ERR(0, 2200, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, 3); __PYX_ERR(0, 2286, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_vel); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2200, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2286, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_replaceSelf); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2200, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2286, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_precision); if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2200, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2286, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 7: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_verbose); if (value) { values[7] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2200, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2286, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "handleCollisionsPos") < 0)) __PYX_ERR(0, 2200, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "handleCollisionsPos") < 0)) __PYX_ERR(0, 2286, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -73650,7 +76678,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, __pyx_nargs); __PYX_ERR(0, 2200, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsPos", 0, 4, 8, __pyx_nargs); __PYX_ERR(0, 2286, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -73677,7 +76705,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "collisions.py":2245 +/* "collisions.py":2331 * hit = False * for oldLine, newLine in zip(oldShp.toLines(), newShp.toLines()): * oldLine = Line(*sorted([oldLine.p1, oldLine.p2], key=lambda x: x[0])) # <<<<<<<<<<<<<< @@ -73738,12 +76766,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2245, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2331, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda25") < 0)) __PYX_ERR(0, 2245, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda25") < 0)) __PYX_ERR(0, 2331, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -73754,7 +76782,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda25", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2245, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda25", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2331, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -73790,7 +76818,7 @@ static PyObject *__pyx_lambda_funcdef_lambda25(CYTHON_UNUSED PyObject *__pyx_sel int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda25", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2245, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -73807,7 +76835,7 @@ static PyObject *__pyx_lambda_funcdef_lambda25(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "collisions.py":2246 +/* "collisions.py":2332 * for oldLine, newLine in zip(oldShp.toLines(), newShp.toLines()): * oldLine = Line(*sorted([oldLine.p1, oldLine.p2], key=lambda x: x[0])) * newLine = Line(*sorted([newLine.p1, newLine.p2], key=lambda x: x[0])) # <<<<<<<<<<<<<< @@ -73868,12 +76896,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2246, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2332, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda26") < 0)) __PYX_ERR(0, 2246, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda26") < 0)) __PYX_ERR(0, 2332, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -73884,7 +76912,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda26", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2246, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda26", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2332, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -73920,7 +76948,7 @@ static PyObject *__pyx_lambda_funcdef_lambda26(CYTHON_UNUSED PyObject *__pyx_sel int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda26", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2246, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -73937,7 +76965,7 @@ static PyObject *__pyx_lambda_funcdef_lambda26(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "collisions.py":2270 +/* "collisions.py":2356 * return oldShp, [0, 0] * * points.sort(key=lambda x: (x[3], x[4])) # <<<<<<<<<<<<<< @@ -73998,12 +77026,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2270, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2356, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda27") < 0)) __PYX_ERR(0, 2270, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda27") < 0)) __PYX_ERR(0, 2356, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -74014,7 +77042,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda27", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2270, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda27", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2356, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -74052,16 +77080,16 @@ static PyObject *__pyx_lambda_funcdef_lambda27(CYTHON_UNUSED PyObject *__pyx_sel int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda27", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2270, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_x, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2270, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_x, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2270, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 2270, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 2356, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 2270, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 2356, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = __pyx_t_3; @@ -74081,7 +77109,7 @@ static PyObject *__pyx_lambda_funcdef_lambda27(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "collisions.py":2292 +/* "collisions.py":2378 * if cLines != []: * for cLine in cLines: * sortedOtherLn = Line(*sorted([cLine.p1, cLine.p2], key=lambda x: x[0])) # <<<<<<<<<<<<<< @@ -74142,12 +77170,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2292, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2378, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda28") < 0)) __PYX_ERR(0, 2292, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda28") < 0)) __PYX_ERR(0, 2378, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -74158,7 +77186,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda28", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2292, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda28", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2378, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -74194,7 +77222,7 @@ static PyObject *__pyx_lambda_funcdef_lambda28(CYTHON_UNUSED PyObject *__pyx_sel int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda28", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2292, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -74211,7 +77239,7 @@ static PyObject *__pyx_lambda_funcdef_lambda28(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "collisions.py":2200 +/* "collisions.py":2286 * return tries[0][0] * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< @@ -74288,14 +77316,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_RefNannySetupContext("handleCollisionsPos", 0); __Pyx_INCREF(__pyx_v_vel); - /* "collisions.py":2233 + /* "collisions.py":2319 * """ * # Don't let you move when you're in a wall, but if you are leaving a wall then GET THE HELLA OUTTA THERE * if oldShp.collides(objs): # <<<<<<<<<<<<<< * if newShp.collides(objs): * if verbose: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldShp, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2233, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldShp, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -74315,22 +77343,22 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_objs}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2233, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2233, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2319, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "collisions.py":2234 + /* "collisions.py":2320 * # Don't let you move when you're in a wall, but if you are leaving a wall then GET THE HELLA OUTTA THERE * if oldShp.collides(objs): * if newShp.collides(objs): # <<<<<<<<<<<<<< * if verbose: * return oldShp, [0, 0], [None, True] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_newShp, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2234, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_newShp, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -74350,25 +77378,25 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_objs}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2234, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2234, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2320, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "collisions.py":2235 + /* "collisions.py":2321 * if oldShp.collides(objs): * if newShp.collides(objs): * if verbose: # <<<<<<<<<<<<<< * return oldShp, [0, 0], [None, True] * return oldShp, [0, 0] */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2235, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2321, __pyx_L1_error) if (__pyx_t_5) { - /* "collisions.py":2236 + /* "collisions.py":2322 * if newShp.collides(objs): * if verbose: * return oldShp, [0, 0], [None, True] # <<<<<<<<<<<<<< @@ -74376,38 +77404,38 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON * else: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2236, __pyx_L1_error) + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0)) __PYX_ERR(0, 2236, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0)) __PYX_ERR(0, 2322, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_0)) __PYX_ERR(0, 2236, __pyx_L1_error); - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2236, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_0)) __PYX_ERR(0, 2322, __pyx_L1_error); + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 2236, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 2322, __pyx_L1_error); __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, Py_True)) __PYX_ERR(0, 2236, __pyx_L1_error); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2236, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, Py_True)) __PYX_ERR(0, 2322, __pyx_L1_error); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_oldShp); __Pyx_GIVEREF(__pyx_v_oldShp); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_oldShp)) __PYX_ERR(0, 2236, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_oldShp)) __PYX_ERR(0, 2322, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 2236, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1)) __PYX_ERR(0, 2322, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(0, 2236, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(0, 2322, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2235 + /* "collisions.py":2321 * if oldShp.collides(objs): * if newShp.collides(objs): * if verbose: # <<<<<<<<<<<<<< @@ -74416,7 +77444,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ } - /* "collisions.py":2237 + /* "collisions.py":2323 * if verbose: * return oldShp, [0, 0], [None, True] * return oldShp, [0, 0] # <<<<<<<<<<<<<< @@ -74424,27 +77452,27 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON * if verbose: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2237, __pyx_L1_error) + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_0)) __PYX_ERR(0, 2237, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_int_0)) __PYX_ERR(0, 2323, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_0)) __PYX_ERR(0, 2237, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2237, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_int_0)) __PYX_ERR(0, 2323, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2323, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_oldShp); __Pyx_GIVEREF(__pyx_v_oldShp); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_oldShp)) __PYX_ERR(0, 2237, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_oldShp)) __PYX_ERR(0, 2323, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3)) __PYX_ERR(0, 2237, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3)) __PYX_ERR(0, 2323, __pyx_L1_error); __pyx_t_3 = 0; __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":2234 + /* "collisions.py":2320 * # Don't let you move when you're in a wall, but if you are leaving a wall then GET THE HELLA OUTTA THERE * if oldShp.collides(objs): * if newShp.collides(objs): # <<<<<<<<<<<<<< @@ -74453,7 +77481,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ } - /* "collisions.py":2239 + /* "collisions.py":2325 * return oldShp, [0, 0] * else: * if verbose: # <<<<<<<<<<<<<< @@ -74461,10 +77489,10 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON * return newShp, vel */ /*else*/ { - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2239, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2325, __pyx_L1_error) if (__pyx_t_5) { - /* "collisions.py":2240 + /* "collisions.py":2326 * else: * if verbose: * return newShp, vel, [None, False] # <<<<<<<<<<<<<< @@ -74472,30 +77500,30 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON * points = [] */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2240, __pyx_L1_error) + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 2240, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 2326, __pyx_L1_error); __Pyx_INCREF(Py_False); __Pyx_GIVEREF(Py_False); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, Py_False)) __PYX_ERR(0, 2240, __pyx_L1_error); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2240, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, Py_False)) __PYX_ERR(0, 2326, __pyx_L1_error); + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_newShp); __Pyx_GIVEREF(__pyx_v_newShp); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_newShp)) __PYX_ERR(0, 2240, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_newShp)) __PYX_ERR(0, 2326, __pyx_L1_error); __Pyx_INCREF(__pyx_v_vel); __Pyx_GIVEREF(__pyx_v_vel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vel)) __PYX_ERR(0, 2240, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vel)) __PYX_ERR(0, 2326, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(0, 2240, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2)) __PYX_ERR(0, 2326, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2239 + /* "collisions.py":2325 * return oldShp, [0, 0] * else: * if verbose: # <<<<<<<<<<<<<< @@ -74504,7 +77532,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ } - /* "collisions.py":2241 + /* "collisions.py":2327 * if verbose: * return newShp, vel, [None, False] * return newShp, vel # <<<<<<<<<<<<<< @@ -74512,20 +77540,20 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON * hit = False */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2241, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2327, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_newShp); __Pyx_GIVEREF(__pyx_v_newShp); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_newShp)) __PYX_ERR(0, 2241, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_newShp)) __PYX_ERR(0, 2327, __pyx_L1_error); __Pyx_INCREF(__pyx_v_vel); __Pyx_GIVEREF(__pyx_v_vel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vel)) __PYX_ERR(0, 2241, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_vel)) __PYX_ERR(0, 2327, __pyx_L1_error); __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; } - /* "collisions.py":2233 + /* "collisions.py":2319 * """ * # Don't let you move when you're in a wall, but if you are leaving a wall then GET THE HELLA OUTTA THERE * if oldShp.collides(objs): # <<<<<<<<<<<<<< @@ -74534,19 +77562,19 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ } - /* "collisions.py":2242 + /* "collisions.py":2328 * return newShp, vel, [None, False] * return newShp, vel * points = [] # <<<<<<<<<<<<<< * hit = False * for oldLine, newLine in zip(oldShp.toLines(), newShp.toLines()): */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2242, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_points = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2243 + /* "collisions.py":2329 * return newShp, vel * points = [] * hit = False # <<<<<<<<<<<<<< @@ -74555,14 +77583,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ __pyx_v_hit = 0; - /* "collisions.py":2244 + /* "collisions.py":2330 * points = [] * hit = False * for oldLine, newLine in zip(oldShp.toLines(), newShp.toLines()): # <<<<<<<<<<<<<< * oldLine = Line(*sorted([oldLine.p1, oldLine.p2], key=lambda x: x[0])) * newLine = Line(*sorted([newLine.p1, newLine.p2], key=lambda x: x[0])) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldShp, __pyx_n_s_toLines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2244, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldShp, __pyx_n_s_toLines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; __pyx_t_4 = 0; @@ -74582,11 +77610,11 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2244, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_newShp, __pyx_n_s_toLines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2244, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_newShp, __pyx_n_s_toLines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; __pyx_t_4 = 0; @@ -74606,19 +77634,19 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2244, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2244, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 2244, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 2330, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 2244, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2)) __PYX_ERR(0, 2330, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2244, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { @@ -74626,9 +77654,9 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2244, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2244, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2330, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -74637,28 +77665,28 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2244, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2330, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2244, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2330, __pyx_L1_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2244, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2244, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2330, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2244, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2330, __pyx_L1_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2244, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -74668,7 +77696,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2244, __pyx_L1_error) + else __PYX_ERR(0, 2330, __pyx_L1_error) } break; } @@ -74680,7 +77708,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 2244, __pyx_L1_error) + __PYX_ERR(0, 2330, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -74693,15 +77721,15 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_6); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2244, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2244, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2244, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2330, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); @@ -74709,7 +77737,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_6 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_6)) goto __pyx_L9_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 2244, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 2330, __pyx_L1_error) __pyx_t_10 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L10_unpacking_done; @@ -74717,7 +77745,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_10 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 2244, __pyx_L1_error) + __PYX_ERR(0, 2330, __pyx_L1_error) __pyx_L10_unpacking_done:; } __Pyx_XDECREF_SET(__pyx_v_oldLine, __pyx_t_3); @@ -74725,114 +77753,114 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_XDECREF_SET(__pyx_v_newLine, __pyx_t_6); __pyx_t_6 = 0; - /* "collisions.py":2245 + /* "collisions.py":2331 * hit = False * for oldLine, newLine in zip(oldShp.toLines(), newShp.toLines()): * oldLine = Line(*sorted([oldLine.p1, oldLine.p2], key=lambda x: x[0])) # <<<<<<<<<<<<<< * newLine = Line(*sorted([newLine.p1, newLine.p2], key=lambda x: x[0])) * mvement = Polygon(oldLine.p1, oldLine.p2, newLine.p2, newLine.p1) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2245, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2245, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2245, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyList_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2245, __pyx_L1_error) + __pyx_t_9 = PyList_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_6)) __PYX_ERR(0, 2245, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_6)) __PYX_ERR(0, 2331, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_3)) __PYX_ERR(0, 2245, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_3)) __PYX_ERR(0, 2331, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2245, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9)) __PYX_ERR(0, 2245, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_9)) __PYX_ERR(0, 2331, __pyx_L1_error); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2245, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_19handleCollisionsPos_lambda25, 0, __pyx_n_s_ClosedShape_handleCollisionsPos, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2245, __pyx_L1_error) + __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_19handleCollisionsPos_lambda25, 0, __pyx_n_s_ClosedShape_handleCollisionsPos, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_key, __pyx_t_6) < 0) __PYX_ERR(0, 2245, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_key, __pyx_t_6) < 0) __PYX_ERR(0, 2331, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2245, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PySequence_Tuple(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2245, __pyx_L1_error) + __pyx_t_9 = __Pyx_PySequence_Tuple(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2245, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF_SET(__pyx_v_oldLine, __pyx_t_6); __pyx_t_6 = 0; - /* "collisions.py":2246 + /* "collisions.py":2332 * for oldLine, newLine in zip(oldShp.toLines(), newShp.toLines()): * oldLine = Line(*sorted([oldLine.p1, oldLine.p2], key=lambda x: x[0])) * newLine = Line(*sorted([newLine.p1, newLine.p2], key=lambda x: x[0])) # <<<<<<<<<<<<<< * mvement = Polygon(oldLine.p1, oldLine.p2, newLine.p2, newLine.p1) * for o in objs: */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Line); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2246, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Line); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2246, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2246, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2246, __pyx_L1_error) + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_9)) __PYX_ERR(0, 2246, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_9)) __PYX_ERR(0, 2332, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 2246, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 2332, __pyx_L1_error); __pyx_t_9 = 0; __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2246, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 2246, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3)) __PYX_ERR(0, 2332, __pyx_L1_error); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2246, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_19handleCollisionsPos_1lambda26, 0, __pyx_n_s_ClosedShape_handleCollisionsPos, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2246, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_19handleCollisionsPos_1lambda26, 0, __pyx_n_s_ClosedShape_handleCollisionsPos, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_key, __pyx_t_9) < 0) __PYX_ERR(0, 2246, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_key, __pyx_t_9) < 0) __PYX_ERR(0, 2332, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2246, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2246, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2246, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_newLine, __pyx_t_9); __pyx_t_9 = 0; - /* "collisions.py":2247 + /* "collisions.py":2333 * oldLine = Line(*sorted([oldLine.p1, oldLine.p2], key=lambda x: x[0])) * newLine = Line(*sorted([newLine.p1, newLine.p2], key=lambda x: x[0])) * mvement = Polygon(oldLine.p1, oldLine.p2, newLine.p2, newLine.p1) # <<<<<<<<<<<<<< * for o in objs: * if o.collides(mvement): */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2247, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2247, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2247, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2247, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = NULL; __pyx_t_4 = 0; @@ -74856,14 +77884,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2247, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2333, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_XDECREF_SET(__pyx_v_mvement, __pyx_t_9); __pyx_t_9 = 0; - /* "collisions.py":2248 + /* "collisions.py":2334 * newLine = Line(*sorted([newLine.p1, newLine.p2], key=lambda x: x[0])) * mvement = Polygon(oldLine.p1, oldLine.p2, newLine.p2, newLine.p1) * for o in objs: # <<<<<<<<<<<<<< @@ -74875,9 +77903,9 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __pyx_t_14 = 0; __pyx_t_15 = NULL; } else { - __pyx_t_14 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_objs); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2248, __pyx_L1_error) + __pyx_t_14 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_objs); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2248, __pyx_L1_error) + __pyx_t_15 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2334, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_15)) { @@ -74885,28 +77913,28 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2248, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2334, __pyx_L1_error) #endif if (__pyx_t_14 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_14); __Pyx_INCREF(__pyx_t_3); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(0, 2248, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_14); __Pyx_INCREF(__pyx_t_3); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(0, 2334, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2248, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2248, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2334, __pyx_L1_error) #endif if (__pyx_t_14 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_14); __Pyx_INCREF(__pyx_t_3); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(0, 2248, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_14); __Pyx_INCREF(__pyx_t_3); __pyx_t_14++; if (unlikely((0 < 0))) __PYX_ERR(0, 2334, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2248, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -74916,7 +77944,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2248, __pyx_L1_error) + else __PYX_ERR(0, 2334, __pyx_L1_error) } break; } @@ -74925,14 +77953,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2249 + /* "collisions.py":2335 * mvement = Polygon(oldLine.p1, oldLine.p2, newLine.p2, newLine.p1) * for o in objs: * if o.collides(mvement): # <<<<<<<<<<<<<< * hit = True * ps = o.whereCollides(mvement) + [i for i in o.closestPointTo(oldLine, True) if mvement.collides(Point(*i))] */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2249, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_11 = NULL; __pyx_t_4 = 0; @@ -74952,15 +77980,15 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_mvement}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2249, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2335, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2249, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2335, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { - /* "collisions.py":2250 + /* "collisions.py":2336 * for o in objs: * if o.collides(mvement): * hit = True # <<<<<<<<<<<<<< @@ -74969,14 +77997,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ __pyx_v_hit = 1; - /* "collisions.py":2251 + /* "collisions.py":2337 * if o.collides(mvement): * hit = True * ps = o.whereCollides(mvement) + [i for i in o.closestPointTo(oldLine, True) if mvement.collides(Point(*i))] # <<<<<<<<<<<<<< * for p in ps: * if oldShp.collides(Point(*p)): */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2251, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_11 = NULL; __pyx_t_4 = 0; @@ -74996,14 +78024,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_mvement}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2251, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } { /* enter inner scope */ - __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2251, __pyx_L16_error) + __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2337, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2251, __pyx_L16_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_o, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2337, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_4 = 0; @@ -75023,7 +78051,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_oldLine, Py_True}; __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2251, __pyx_L16_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2337, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -75032,9 +78060,9 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __pyx_t_16 = 0; __pyx_t_17 = NULL; } else { - __pyx_t_16 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2251, __pyx_L16_error) + __pyx_t_16 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2337, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_17 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2251, __pyx_L16_error) + __pyx_t_17 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2337, __pyx_L16_error) } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; for (;;) { @@ -75043,28 +78071,28 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2251, __pyx_L16_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2337, __pyx_L16_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_11 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_16); __Pyx_INCREF(__pyx_t_11); __pyx_t_16++; if (unlikely((0 < 0))) __PYX_ERR(0, 2251, __pyx_L16_error) + __pyx_t_11 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_16); __Pyx_INCREF(__pyx_t_11); __pyx_t_16++; if (unlikely((0 < 0))) __PYX_ERR(0, 2337, __pyx_L16_error) #else - __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2251, __pyx_L16_error) + __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2337, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_11); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2251, __pyx_L16_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2337, __pyx_L16_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_16); __Pyx_INCREF(__pyx_t_11); __pyx_t_16++; if (unlikely((0 < 0))) __PYX_ERR(0, 2251, __pyx_L16_error) + __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_16); __Pyx_INCREF(__pyx_t_11); __pyx_t_16++; if (unlikely((0 < 0))) __PYX_ERR(0, 2337, __pyx_L16_error) #else - __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2251, __pyx_L16_error) + __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2337, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_11); #endif } @@ -75074,7 +78102,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2251, __pyx_L16_error) + else __PYX_ERR(0, 2337, __pyx_L16_error) } break; } @@ -75082,13 +78110,13 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON } __Pyx_XDECREF_SET(__pyx_9genexpr46__pyx_v_i, __pyx_t_11); __pyx_t_11 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_mvement, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2251, __pyx_L16_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_mvement, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2337, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_Point); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2251, __pyx_L16_error) + __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_Point); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2337, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_18 = __Pyx_PySequence_Tuple(__pyx_9genexpr46__pyx_v_i); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 2251, __pyx_L16_error) + __pyx_t_18 = __Pyx_PySequence_Tuple(__pyx_9genexpr46__pyx_v_i); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 2337, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_18); - __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_18, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2251, __pyx_L16_error) + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_18, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2337, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; @@ -75111,14 +78139,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2251, __pyx_L16_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2337, __pyx_L16_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2251, __pyx_L16_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2337, __pyx_L16_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_5) { - if (unlikely(__Pyx_ListComp_Append(__pyx_t_12, (PyObject*)__pyx_9genexpr46__pyx_v_i))) __PYX_ERR(0, 2251, __pyx_L16_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_12, (PyObject*)__pyx_9genexpr46__pyx_v_i))) __PYX_ERR(0, 2337, __pyx_L16_error) } } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -75129,14 +78157,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON goto __pyx_L1_error; __pyx_L21_exit_scope:; } /* exit inner scope */ - __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2251, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_XDECREF_SET(__pyx_v_ps, __pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2252 + /* "collisions.py":2338 * hit = True * ps = o.whereCollides(mvement) + [i for i in o.closestPointTo(oldLine, True) if mvement.collides(Point(*i))] * for p in ps: # <<<<<<<<<<<<<< @@ -75148,9 +78176,9 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __pyx_t_16 = 0; __pyx_t_17 = NULL; } else { - __pyx_t_16 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_ps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2252, __pyx_L1_error) + __pyx_t_16 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_ps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_17 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2252, __pyx_L1_error) + __pyx_t_17 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2338, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_17)) { @@ -75158,28 +78186,28 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2252, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2338, __pyx_L1_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_12 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_16); __Pyx_INCREF(__pyx_t_12); __pyx_t_16++; if (unlikely((0 < 0))) __PYX_ERR(0, 2252, __pyx_L1_error) + __pyx_t_12 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_16); __Pyx_INCREF(__pyx_t_12); __pyx_t_16++; if (unlikely((0 < 0))) __PYX_ERR(0, 2338, __pyx_L1_error) #else - __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2252, __pyx_L1_error) + __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2252, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2338, __pyx_L1_error) #endif if (__pyx_t_16 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_16); __Pyx_INCREF(__pyx_t_12); __pyx_t_16++; if (unlikely((0 < 0))) __PYX_ERR(0, 2252, __pyx_L1_error) + __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_16); __Pyx_INCREF(__pyx_t_12); __pyx_t_16++; if (unlikely((0 < 0))) __PYX_ERR(0, 2338, __pyx_L1_error) #else - __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2252, __pyx_L1_error) + __pyx_t_12 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); #endif } @@ -75189,7 +78217,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2252, __pyx_L1_error) + else __PYX_ERR(0, 2338, __pyx_L1_error) } break; } @@ -75198,20 +78226,20 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":2253 + /* "collisions.py":2339 * ps = o.whereCollides(mvement) + [i for i in o.closestPointTo(oldLine, True) if mvement.collides(Point(*i))] * for p in ps: * if oldShp.collides(Point(*p)): # <<<<<<<<<<<<<< * continue * # The rotation is making sure the line crosses the oldLine */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldShp, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2253, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldShp, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_Point); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2253, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_Point); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_p); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2253, __pyx_L1_error) + __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_p); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_6, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2253, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_6, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -75234,15 +78262,15 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2253, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2253, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2339, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; if (__pyx_t_5) { - /* "collisions.py":2254 + /* "collisions.py":2340 * for p in ps: * if oldShp.collides(Point(*p)): * continue # <<<<<<<<<<<<<< @@ -75251,7 +78279,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ goto __pyx_L22_continue; - /* "collisions.py":2253 + /* "collisions.py":2339 * ps = o.whereCollides(mvement) + [i for i in o.closestPointTo(oldLine, True) if mvement.collides(Point(*i))] * for p in ps: * if oldShp.collides(Point(*p)): # <<<<<<<<<<<<<< @@ -75260,39 +78288,39 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ } - /* "collisions.py":2256 + /* "collisions.py":2342 * continue * # The rotation is making sure the line crosses the oldLine * cPoint = oldLine.closestPointTo(Line(p, (p[0]-vel[0],p[1]-vel[1]))) # <<<<<<<<<<<<<< * pdists = (oldLine.p1[0]-p[0])**2+(oldLine.p1[1]-p[1])**2 + (oldLine.p2[0]-p[0])**2+(oldLine.p2[1]-p[1])**2 * points.append([p, o, cPoint, round((p[0]-cPoint[0])**2+(p[1]-cPoint[1])**2, precision), round(pdists, precision), oldLine, newLine]) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2256, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Line); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2256, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Line); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2256, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_18 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 2256, __pyx_L1_error) + __pyx_t_18 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 2342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); - __pyx_t_13 = PyNumber_Subtract(__pyx_t_11, __pyx_t_18); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2256, __pyx_L1_error) + __pyx_t_13 = PyNumber_Subtract(__pyx_t_11, __pyx_t_18); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; - __pyx_t_18 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 2256, __pyx_L1_error) + __pyx_t_18 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 2342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_18); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2256, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_20 = PyNumber_Subtract(__pyx_t_18, __pyx_t_11); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 2256, __pyx_L1_error) + __pyx_t_20 = PyNumber_Subtract(__pyx_t_18, __pyx_t_11); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 2342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2256, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_13); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13)) __PYX_ERR(0, 2256, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_13)) __PYX_ERR(0, 2342, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_20); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_20)) __PYX_ERR(0, 2256, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_20)) __PYX_ERR(0, 2342, __pyx_L1_error); __pyx_t_13 = 0; __pyx_t_20 = 0; __pyx_t_20 = NULL; @@ -75314,7 +78342,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __pyx_t_19 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2256, __pyx_L1_error) + if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -75337,173 +78365,173 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2256, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_XDECREF_SET(__pyx_v_cPoint, __pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":2257 + /* "collisions.py":2343 * # The rotation is making sure the line crosses the oldLine * cPoint = oldLine.closestPointTo(Line(p, (p[0]-vel[0],p[1]-vel[1]))) * pdists = (oldLine.p1[0]-p[0])**2+(oldLine.p1[1]-p[1])**2 + (oldLine.p2[0]-p[0])**2+(oldLine.p2[1]-p[1])**2 # <<<<<<<<<<<<<< * points.append([p, o, cPoint, round((p[0]-cPoint[0])**2+(p[1]-cPoint[1])**2, precision), round(pdists, precision), oldLine, newLine]) * #points.extend(list(zip(cs, [o for _ in range(len(cs))]))) */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2257, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_12, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2257, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_12, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2257, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_19 = PyNumber_Subtract(__pyx_t_3, __pyx_t_12); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2257, __pyx_L1_error) + __pyx_t_19 = PyNumber_Subtract(__pyx_t_3, __pyx_t_12); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyNumber_Power(__pyx_t_19, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2257, __pyx_L1_error) + __pyx_t_12 = PyNumber_Power(__pyx_t_19, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2257, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_19, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2257, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_19, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2257, __pyx_L1_error) + __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_6 = PyNumber_Subtract(__pyx_t_3, __pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2257, __pyx_L1_error) + __pyx_t_6 = PyNumber_Subtract(__pyx_t_3, __pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_19 = PyNumber_Power(__pyx_t_6, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2257, __pyx_L1_error) + __pyx_t_19 = PyNumber_Power(__pyx_t_6, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Add(__pyx_t_12, __pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2257, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_12, __pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2257, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_19, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2257, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_19, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2257, __pyx_L1_error) + __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_12, __pyx_t_19); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2257, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_12, __pyx_t_19); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_19 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2257, __pyx_L1_error) + __pyx_t_19 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_t_6, __pyx_t_19); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2257, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_6, __pyx_t_19); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2257, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_19, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2257, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_19, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2257, __pyx_L1_error) + __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_12 = PyNumber_Subtract(__pyx_t_6, __pyx_t_19); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2257, __pyx_L1_error) + __pyx_t_12 = PyNumber_Subtract(__pyx_t_6, __pyx_t_19); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_19 = PyNumber_Power(__pyx_t_12, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2257, __pyx_L1_error) + __pyx_t_19 = PyNumber_Power(__pyx_t_12, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyNumber_Add(__pyx_t_3, __pyx_t_19); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2257, __pyx_L1_error) + __pyx_t_12 = PyNumber_Add(__pyx_t_3, __pyx_t_19); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_XDECREF_SET(__pyx_v_pdists, __pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":2258 + /* "collisions.py":2344 * cPoint = oldLine.closestPointTo(Line(p, (p[0]-vel[0],p[1]-vel[1]))) * pdists = (oldLine.p1[0]-p[0])**2+(oldLine.p1[1]-p[1])**2 + (oldLine.p2[0]-p[0])**2+(oldLine.p2[1]-p[1])**2 * points.append([p, o, cPoint, round((p[0]-cPoint[0])**2+(p[1]-cPoint[1])**2, precision), round(pdists, precision), oldLine, newLine]) # <<<<<<<<<<<<<< * #points.extend(list(zip(cs, [o for _ in range(len(cs))]))) * if not hit: */ - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2258, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_cPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2258, __pyx_L1_error) + __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_cPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_12, __pyx_t_19); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2258, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_12, __pyx_t_19); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_19 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2258, __pyx_L1_error) + __pyx_t_19 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2258, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_cPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2258, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_cPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_6 = PyNumber_Subtract(__pyx_t_3, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2258, __pyx_L1_error) + __pyx_t_6 = PyNumber_Subtract(__pyx_t_3, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyNumber_Power(__pyx_t_6, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2258, __pyx_L1_error) + __pyx_t_12 = PyNumber_Power(__pyx_t_6, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Add(__pyx_t_19, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2258, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_19, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2258, __pyx_L1_error) + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_6)) __PYX_ERR(0, 2258, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_6)) __PYX_ERR(0, 2344, __pyx_L1_error); __Pyx_INCREF(__pyx_v_precision); __Pyx_GIVEREF(__pyx_v_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_precision)) __PYX_ERR(0, 2258, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_precision)) __PYX_ERR(0, 2344, __pyx_L1_error); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2258, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2258, __pyx_L1_error) + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_pdists); __Pyx_GIVEREF(__pyx_v_pdists); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_pdists)) __PYX_ERR(0, 2258, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_pdists)) __PYX_ERR(0, 2344, __pyx_L1_error); __Pyx_INCREF(__pyx_v_precision); __Pyx_GIVEREF(__pyx_v_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_precision)) __PYX_ERR(0, 2258, __pyx_L1_error); - __pyx_t_19 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_12, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2258, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_v_precision)) __PYX_ERR(0, 2344, __pyx_L1_error); + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_12, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyList_New(7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2258, __pyx_L1_error) + __pyx_t_12 = PyList_New(7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_p); __Pyx_GIVEREF(__pyx_v_p); - if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 0, __pyx_v_p)) __PYX_ERR(0, 2258, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 0, __pyx_v_p)) __PYX_ERR(0, 2344, __pyx_L1_error); __Pyx_INCREF(__pyx_v_o); __Pyx_GIVEREF(__pyx_v_o); - if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 1, __pyx_v_o)) __PYX_ERR(0, 2258, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 1, __pyx_v_o)) __PYX_ERR(0, 2344, __pyx_L1_error); __Pyx_INCREF(__pyx_v_cPoint); __Pyx_GIVEREF(__pyx_v_cPoint); - if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 2, __pyx_v_cPoint)) __PYX_ERR(0, 2258, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 2, __pyx_v_cPoint)) __PYX_ERR(0, 2344, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 3, __pyx_t_6)) __PYX_ERR(0, 2258, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 3, __pyx_t_6)) __PYX_ERR(0, 2344, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_19); - if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 4, __pyx_t_19)) __PYX_ERR(0, 2258, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 4, __pyx_t_19)) __PYX_ERR(0, 2344, __pyx_L1_error); __Pyx_INCREF(__pyx_v_oldLine); __Pyx_GIVEREF(__pyx_v_oldLine); - if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 5, __pyx_v_oldLine)) __PYX_ERR(0, 2258, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 5, __pyx_v_oldLine)) __PYX_ERR(0, 2344, __pyx_L1_error); __Pyx_INCREF(__pyx_v_newLine); __Pyx_GIVEREF(__pyx_v_newLine); - if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 6, __pyx_v_newLine)) __PYX_ERR(0, 2258, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 6, __pyx_v_newLine)) __PYX_ERR(0, 2344, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_19 = 0; - __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_points, __pyx_t_12); if (unlikely(__pyx_t_21 == ((int)-1))) __PYX_ERR(0, 2258, __pyx_L1_error) + __pyx_t_21 = __Pyx_PyList_Append(__pyx_v_points, __pyx_t_12); if (unlikely(__pyx_t_21 == ((int)-1))) __PYX_ERR(0, 2344, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":2252 + /* "collisions.py":2338 * hit = True * ps = o.whereCollides(mvement) + [i for i in o.closestPointTo(oldLine, True) if mvement.collides(Point(*i))] * for p in ps: # <<<<<<<<<<<<<< @@ -75514,7 +78542,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2249 + /* "collisions.py":2335 * mvement = Polygon(oldLine.p1, oldLine.p2, newLine.p2, newLine.p1) * for o in objs: * if o.collides(mvement): # <<<<<<<<<<<<<< @@ -75523,7 +78551,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ } - /* "collisions.py":2248 + /* "collisions.py":2334 * newLine = Line(*sorted([newLine.p1, newLine.p2], key=lambda x: x[0])) * mvement = Polygon(oldLine.p1, oldLine.p2, newLine.p2, newLine.p1) * for o in objs: # <<<<<<<<<<<<<< @@ -75533,7 +78561,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "collisions.py":2244 + /* "collisions.py":2330 * points = [] * hit = False * for oldLine, newLine in zip(oldShp.toLines(), newShp.toLines()): # <<<<<<<<<<<<<< @@ -75543,7 +78571,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2260 + /* "collisions.py":2346 * points.append([p, o, cPoint, round((p[0]-cPoint[0])**2+(p[1]-cPoint[1])**2, precision), round(pdists, precision), oldLine, newLine]) * #points.extend(list(zip(cs, [o for _ in range(len(cs))]))) * if not hit: # <<<<<<<<<<<<<< @@ -75553,17 +78581,17 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __pyx_t_5 = (!__pyx_v_hit); if (__pyx_t_5) { - /* "collisions.py":2261 + /* "collisions.py":2347 * #points.extend(list(zip(cs, [o for _ in range(len(cs))]))) * if not hit: * if verbose: # <<<<<<<<<<<<<< * return newShp, vel, [None, False] * return newShp, vel */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2261, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2347, __pyx_L1_error) if (__pyx_t_5) { - /* "collisions.py":2262 + /* "collisions.py":2348 * if not hit: * if verbose: * return newShp, vel, [None, False] # <<<<<<<<<<<<<< @@ -75571,30 +78599,30 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON * # Don't let you move when you're in a wall */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2262, __pyx_L1_error) + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, Py_None)) __PYX_ERR(0, 2262, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, Py_None)) __PYX_ERR(0, 2348, __pyx_L1_error); __Pyx_INCREF(Py_False); __Pyx_GIVEREF(Py_False); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, Py_False)) __PYX_ERR(0, 2262, __pyx_L1_error); - __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2262, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, Py_False)) __PYX_ERR(0, 2348, __pyx_L1_error); + __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2348, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_newShp); __Pyx_GIVEREF(__pyx_v_newShp); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_newShp)) __PYX_ERR(0, 2262, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_newShp)) __PYX_ERR(0, 2348, __pyx_L1_error); __Pyx_INCREF(__pyx_v_vel); __Pyx_GIVEREF(__pyx_v_vel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_vel)) __PYX_ERR(0, 2262, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_vel)) __PYX_ERR(0, 2348, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_1)) __PYX_ERR(0, 2262, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_t_1)) __PYX_ERR(0, 2348, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = ((PyObject*)__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L0; - /* "collisions.py":2261 + /* "collisions.py":2347 * #points.extend(list(zip(cs, [o for _ in range(len(cs))]))) * if not hit: * if verbose: # <<<<<<<<<<<<<< @@ -75603,7 +78631,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ } - /* "collisions.py":2263 + /* "collisions.py":2349 * if verbose: * return newShp, vel, [None, False] * return newShp, vel # <<<<<<<<<<<<<< @@ -75611,19 +78639,19 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON * if points == []: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2263, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_newShp); __Pyx_GIVEREF(__pyx_v_newShp); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_newShp)) __PYX_ERR(0, 2263, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_newShp)) __PYX_ERR(0, 2349, __pyx_L1_error); __Pyx_INCREF(__pyx_v_vel); __Pyx_GIVEREF(__pyx_v_vel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_vel)) __PYX_ERR(0, 2263, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_vel)) __PYX_ERR(0, 2349, __pyx_L1_error); __pyx_r = ((PyObject*)__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L0; - /* "collisions.py":2260 + /* "collisions.py":2346 * points.append([p, o, cPoint, round((p[0]-cPoint[0])**2+(p[1]-cPoint[1])**2, precision), round(pdists, precision), oldLine, newLine]) * #points.extend(list(zip(cs, [o for _ in range(len(cs))]))) * if not hit: # <<<<<<<<<<<<<< @@ -75632,32 +78660,32 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ } - /* "collisions.py":2265 + /* "collisions.py":2351 * return newShp, vel * # Don't let you move when you're in a wall * if points == []: # <<<<<<<<<<<<<< * if verbose: * return oldShp, [0, 0], [None, True] */ - __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2265, __pyx_L1_error) + __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = PyObject_RichCompare(__pyx_v_points, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2265, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_points, __pyx_t_9, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2351, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2265, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2351, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - /* "collisions.py":2266 + /* "collisions.py":2352 * # Don't let you move when you're in a wall * if points == []: * if verbose: # <<<<<<<<<<<<<< * return oldShp, [0, 0], [None, True] * return oldShp, [0, 0] */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2266, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2352, __pyx_L1_error) if (__pyx_t_5) { - /* "collisions.py":2267 + /* "collisions.py":2353 * if points == []: * if verbose: * return oldShp, [0, 0], [None, True] # <<<<<<<<<<<<<< @@ -75665,38 +78693,38 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2267, __pyx_L1_error) + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0)) __PYX_ERR(0, 2267, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0)) __PYX_ERR(0, 2353, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_0)) __PYX_ERR(0, 2267, __pyx_L1_error); - __pyx_t_9 = PyList_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2267, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_0)) __PYX_ERR(0, 2353, __pyx_L1_error); + __pyx_t_9 = PyList_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 0, Py_None)) __PYX_ERR(0, 2267, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 0, Py_None)) __PYX_ERR(0, 2353, __pyx_L1_error); __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); - if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 1, Py_True)) __PYX_ERR(0, 2267, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2267, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 1, Py_True)) __PYX_ERR(0, 2353, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_oldShp); __Pyx_GIVEREF(__pyx_v_oldShp); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_oldShp)) __PYX_ERR(0, 2267, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_oldShp)) __PYX_ERR(0, 2353, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 2267, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 2353, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_9)) __PYX_ERR(0, 2267, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_9)) __PYX_ERR(0, 2353, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_9 = 0; __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":2266 + /* "collisions.py":2352 * # Don't let you move when you're in a wall * if points == []: * if verbose: # <<<<<<<<<<<<<< @@ -75705,7 +78733,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ } - /* "collisions.py":2268 + /* "collisions.py":2354 * if verbose: * return oldShp, [0, 0], [None, True] * return oldShp, [0, 0] # <<<<<<<<<<<<<< @@ -75713,27 +78741,27 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON * points.sort(key=lambda x: (x[3], x[4])) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2268, __pyx_L1_error) + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_0)) __PYX_ERR(0, 2268, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_0)) __PYX_ERR(0, 2354, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_int_0)) __PYX_ERR(0, 2268, __pyx_L1_error); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2268, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_int_0)) __PYX_ERR(0, 2354, __pyx_L1_error); + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_oldShp); __Pyx_GIVEREF(__pyx_v_oldShp); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_oldShp)) __PYX_ERR(0, 2268, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_oldShp)) __PYX_ERR(0, 2354, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2)) __PYX_ERR(0, 2268, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_2)) __PYX_ERR(0, 2354, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = ((PyObject*)__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L0; - /* "collisions.py":2265 + /* "collisions.py":2351 * return newShp, vel * # Don't let you move when you're in a wall * if points == []: # <<<<<<<<<<<<<< @@ -75742,42 +78770,42 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ } - /* "collisions.py":2270 + /* "collisions.py":2356 * return oldShp, [0, 0] * * points.sort(key=lambda x: (x[3], x[4])) # <<<<<<<<<<<<<< * oldLine, newLine = points[0][5], points[0][6] * closestP = points[0][0] # Closest point on the OTHER object */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_points, __pyx_n_s_sort); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2270, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_points, __pyx_n_s_sort); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2270, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_19handleCollisionsPos_2lambda27, 0, __pyx_n_s_ClosedShape_handleCollisionsPos, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2270, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_19handleCollisionsPos_2lambda27, 0, __pyx_n_s_ClosedShape_handleCollisionsPos, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_t_1) < 0) __PYX_ERR(0, 2270, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_key, __pyx_t_1) < 0) __PYX_ERR(0, 2356, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2270, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2356, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2271 + /* "collisions.py":2357 * * points.sort(key=lambda x: (x[3], x[4])) * oldLine, newLine = points[0][5], points[0][6] # <<<<<<<<<<<<<< * closestP = points[0][0] # Closest point on the OTHER object * cPoint = points[0][2] # closestP projected onto the oldLine */ - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_points, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2271, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_points, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2271, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_points, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2271, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_points, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_1, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2271, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_1, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_oldLine, __pyx_t_2); @@ -75785,84 +78813,84 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_XDECREF_SET(__pyx_v_newLine, __pyx_t_9); __pyx_t_9 = 0; - /* "collisions.py":2272 + /* "collisions.py":2358 * points.sort(key=lambda x: (x[3], x[4])) * oldLine, newLine = points[0][5], points[0][6] * closestP = points[0][0] # Closest point on the OTHER object # <<<<<<<<<<<<<< * cPoint = points[0][2] # closestP projected onto the oldLine * closestObj = points[0][1] */ - __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_points, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2272, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_points, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_9, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2272, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_9, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_closestP = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":2273 + /* "collisions.py":2359 * oldLine, newLine = points[0][5], points[0][6] * closestP = points[0][0] # Closest point on the OTHER object * cPoint = points[0][2] # closestP projected onto the oldLine # <<<<<<<<<<<<<< * closestObj = points[0][1] * newPoint = newLine.closestPointTo(Line(closestP, (closestP[0]+vel[0],closestP[1]+vel[1]))) # closestP projected onto the newLine */ - __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_points, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2273, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_points, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_2, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2273, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_2, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2359, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_cPoint, __pyx_t_9); __pyx_t_9 = 0; - /* "collisions.py":2274 + /* "collisions.py":2360 * closestP = points[0][0] # Closest point on the OTHER object * cPoint = points[0][2] # closestP projected onto the oldLine * closestObj = points[0][1] # <<<<<<<<<<<<<< * newPoint = newLine.closestPointTo(Line(closestP, (closestP[0]+vel[0],closestP[1]+vel[1]))) # closestP projected onto the newLine * */ - __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_points, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2274, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_points, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_9, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2274, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_9, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_closestObj = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":2275 + /* "collisions.py":2361 * cPoint = points[0][2] # closestP projected onto the oldLine * closestObj = points[0][1] * newPoint = newLine.closestPointTo(Line(closestP, (closestP[0]+vel[0],closestP[1]+vel[1]))) # closestP projected onto the newLine # <<<<<<<<<<<<<< * * thisNormal = math.degrees(math.atan2(oldLine[0][1]-oldLine[1][1], oldLine[0][0]-oldLine[1][0])) */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2275, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_newLine, __pyx_n_s_closestPointTo); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_Line); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2275, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_Line); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2275, __pyx_L1_error) + __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2275, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyNumber_Add(__pyx_t_19, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2275, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_19, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2275, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2275, __pyx_L1_error) + __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_11 = PyNumber_Add(__pyx_t_6, __pyx_t_19); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2275, __pyx_L1_error) + __pyx_t_11 = PyNumber_Add(__pyx_t_6, __pyx_t_19); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2275, __pyx_L1_error) + __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_3)) __PYX_ERR(0, 2275, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_3)) __PYX_ERR(0, 2361, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_11)) __PYX_ERR(0, 2275, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_11)) __PYX_ERR(0, 2361, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_11 = 0; __pyx_t_11 = NULL; @@ -75884,7 +78912,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2275, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } @@ -75907,55 +78935,55 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2275, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __pyx_v_newPoint = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":2277 + /* "collisions.py":2363 * newPoint = newLine.closestPointTo(Line(closestP, (closestP[0]+vel[0],closestP[1]+vel[1]))) # closestP projected onto the newLine * * thisNormal = math.degrees(math.atan2(oldLine[0][1]-oldLine[1][1], oldLine[0][0]-oldLine[1][0])) # <<<<<<<<<<<<<< * paralell = False * thisIsOnP = oldLine.isCorner(cPoint, precision) */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_math); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2277, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_math); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_degrees); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2277, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_degrees); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_math); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2277, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_math); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_atan2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2277, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_atan2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_oldLine, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2277, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_oldLine, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_12, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2277, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_12, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_oldLine, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2277, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_oldLine, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_12, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2277, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_12, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyNumber_Subtract(__pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2277, __pyx_L1_error) + __pyx_t_12 = PyNumber_Subtract(__pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_oldLine, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2277, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_oldLine, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2277, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_oldLine, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2277, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_oldLine, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2277, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Subtract(__pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2277, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -75979,7 +79007,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2277, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; } @@ -76002,14 +79030,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2277, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_v_thisNormal = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":2278 + /* "collisions.py":2364 * * thisNormal = math.degrees(math.atan2(oldLine[0][1]-oldLine[1][1], oldLine[0][0]-oldLine[1][0])) * paralell = False # <<<<<<<<<<<<<< @@ -76019,14 +79047,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_INCREF(Py_False); __pyx_v_paralell = Py_False; - /* "collisions.py":2279 + /* "collisions.py":2365 * thisNormal = math.degrees(math.atan2(oldLine[0][1]-oldLine[1][1], oldLine[0][0]-oldLine[1][0])) * paralell = False * thisIsOnP = oldLine.isCorner(cPoint, precision) # <<<<<<<<<<<<<< * if checkShpType(closestObj, ShpGroups.NOTSTRAIGHT): * paralell = not thisIsOnP */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_isCorner); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2279, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldLine, __pyx_n_s_isCorner); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = NULL; __pyx_t_4 = 0; @@ -76046,25 +79074,25 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_v_cPoint, __pyx_v_precision}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2279, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2365, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __pyx_v_thisIsOnP = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":2280 + /* "collisions.py":2366 * paralell = False * thisIsOnP = oldLine.isCorner(cPoint, precision) * if checkShpType(closestObj, ShpGroups.NOTSTRAIGHT): # <<<<<<<<<<<<<< * paralell = not thisIsOnP * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2280, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2280, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_NOTSTRAIGHT); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2280, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_NOTSTRAIGHT); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -76086,28 +79114,28 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2280, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2280, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2366, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { - /* "collisions.py":2281 + /* "collisions.py":2367 * thisIsOnP = oldLine.isCorner(cPoint, precision) * if checkShpType(closestObj, ShpGroups.NOTSTRAIGHT): * paralell = not thisIsOnP # <<<<<<<<<<<<<< * else: * cLines = [] */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2281, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyBool_FromLong((!__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2281, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2367, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyBool_FromLong((!__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_paralell, __pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2280 + /* "collisions.py":2366 * paralell = False * thisIsOnP = oldLine.isCorner(cPoint, precision) * if checkShpType(closestObj, ShpGroups.NOTSTRAIGHT): # <<<<<<<<<<<<<< @@ -76117,7 +79145,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON goto __pyx_L32; } - /* "collisions.py":2283 + /* "collisions.py":2369 * paralell = not thisIsOnP * else: * cLines = [] # <<<<<<<<<<<<<< @@ -76125,23 +79153,23 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON * cLines = [closestObj] */ /*else*/ { - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2283, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_cLines = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2284 + /* "collisions.py":2370 * else: * cLines = [] * if checkShpType(closestObj, ShpTyps.Line): # <<<<<<<<<<<<<< * cLines = [closestObj] * elif checkShpType(closestObj, ShpGroups.CLOSED): */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2284, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2284, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_Line); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2284, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_Line); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __pyx_t_19 = NULL; @@ -76163,30 +79191,30 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2284, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2284, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2370, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { - /* "collisions.py":2285 + /* "collisions.py":2371 * cLines = [] * if checkShpType(closestObj, ShpTyps.Line): * cLines = [closestObj] # <<<<<<<<<<<<<< * elif checkShpType(closestObj, ShpGroups.CLOSED): * cLines = [i for i in closestObj.toLines() if i.collides(Point(*closestP))] */ - __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2285, __pyx_L1_error) + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_closestObj); __Pyx_GIVEREF(__pyx_v_closestObj); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_closestObj)) __PYX_ERR(0, 2285, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_closestObj)) __PYX_ERR(0, 2371, __pyx_L1_error); __Pyx_DECREF_SET(__pyx_v_cLines, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "collisions.py":2284 + /* "collisions.py":2370 * else: * cLines = [] * if checkShpType(closestObj, ShpTyps.Line): # <<<<<<<<<<<<<< @@ -76196,18 +79224,18 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON goto __pyx_L33; } - /* "collisions.py":2286 + /* "collisions.py":2372 * if checkShpType(closestObj, ShpTyps.Line): * cLines = [closestObj] * elif checkShpType(closestObj, ShpGroups.CLOSED): # <<<<<<<<<<<<<< * cLines = [i for i in closestObj.toLines() if i.collides(Point(*closestP))] * elif checkShpType(closestObj, ShpTyps.Circle) and (not thisIsOnP): */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2286, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2286, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_CLOSED); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2286, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_CLOSED); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -76229,15 +79257,15 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2286, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2286, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2372, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { - /* "collisions.py":2287 + /* "collisions.py":2373 * cLines = [closestObj] * elif checkShpType(closestObj, ShpGroups.CLOSED): * cLines = [i for i in closestObj.toLines() if i.collides(Point(*closestP))] # <<<<<<<<<<<<<< @@ -76245,9 +79273,9 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON * paralell = True */ { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2287, __pyx_L36_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2373, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_toLines); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2287, __pyx_L36_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_toLines); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2373, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_9 = NULL; __pyx_t_4 = 0; @@ -76267,7 +79295,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_19, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2287, __pyx_L36_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2373, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; } @@ -76276,9 +79304,9 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2287, __pyx_L36_error) + __pyx_t_7 = -1; __pyx_t_19 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2373, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_19); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2287, __pyx_L36_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_19); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2373, __pyx_L36_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -76287,28 +79315,28 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_19); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2287, __pyx_L36_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2373, __pyx_L36_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_19, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2287, __pyx_L36_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_19, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2373, __pyx_L36_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_19, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2287, __pyx_L36_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_19, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2373, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_19); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2287, __pyx_L36_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2373, __pyx_L36_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_19, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2287, __pyx_L36_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_19, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2373, __pyx_L36_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_19, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2287, __pyx_L36_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_19, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2373, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -76318,7 +79346,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2287, __pyx_L36_error) + else __PYX_ERR(0, 2373, __pyx_L36_error) } break; } @@ -76326,13 +79354,13 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON } __Pyx_XDECREF_SET(__pyx_9genexpr47__pyx_v_i, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr47__pyx_v_i, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2287, __pyx_L36_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr47__pyx_v_i, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2373, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2287, __pyx_L36_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2373, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = __Pyx_PySequence_Tuple(__pyx_v_closestP); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2287, __pyx_L36_error) + __pyx_t_12 = __Pyx_PySequence_Tuple(__pyx_v_closestP); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2373, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2287, __pyx_L36_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2373, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; @@ -76355,14 +79383,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2287, __pyx_L36_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2373, __pyx_L36_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2287, __pyx_L36_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2373, __pyx_L36_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_5) { - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr47__pyx_v_i))) __PYX_ERR(0, 2287, __pyx_L36_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_9genexpr47__pyx_v_i))) __PYX_ERR(0, 2373, __pyx_L36_error) } } __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; @@ -76376,7 +79404,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_DECREF_SET(__pyx_v_cLines, ((PyObject*)__pyx_t_2)); __pyx_t_2 = 0; - /* "collisions.py":2286 + /* "collisions.py":2372 * if checkShpType(closestObj, ShpTyps.Line): * cLines = [closestObj] * elif checkShpType(closestObj, ShpGroups.CLOSED): # <<<<<<<<<<<<<< @@ -76386,18 +79414,18 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON goto __pyx_L33; } - /* "collisions.py":2288 + /* "collisions.py":2374 * elif checkShpType(closestObj, ShpGroups.CLOSED): * cLines = [i for i in closestObj.toLines() if i.collides(Point(*closestP))] * elif checkShpType(closestObj, ShpTyps.Circle) and (not thisIsOnP): # <<<<<<<<<<<<<< * paralell = True * if cLines != []: */ - __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2288, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2288, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Circle); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2288, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Circle); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -76419,24 +79447,24 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_19, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2288, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2374, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; } - __pyx_t_22 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_22 < 0))) __PYX_ERR(0, 2288, __pyx_L1_error) + __pyx_t_22 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_22 < 0))) __PYX_ERR(0, 2374, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_22) { } else { __pyx_t_5 = __pyx_t_22; goto __pyx_L42_bool_binop_done; } - __pyx_t_22 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_22 < 0))) __PYX_ERR(0, 2288, __pyx_L1_error) + __pyx_t_22 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_22 < 0))) __PYX_ERR(0, 2374, __pyx_L1_error) __pyx_t_23 = (!__pyx_t_22); __pyx_t_5 = __pyx_t_23; __pyx_L42_bool_binop_done:; if (__pyx_t_5) { - /* "collisions.py":2289 + /* "collisions.py":2375 * cLines = [i for i in closestObj.toLines() if i.collides(Point(*closestP))] * elif checkShpType(closestObj, ShpTyps.Circle) and (not thisIsOnP): * paralell = True # <<<<<<<<<<<<<< @@ -76446,7 +79474,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_INCREF(Py_True); __Pyx_DECREF_SET(__pyx_v_paralell, Py_True); - /* "collisions.py":2288 + /* "collisions.py":2374 * elif checkShpType(closestObj, ShpGroups.CLOSED): * cLines = [i for i in closestObj.toLines() if i.collides(Point(*closestP))] * elif checkShpType(closestObj, ShpTyps.Circle) and (not thisIsOnP): # <<<<<<<<<<<<<< @@ -76456,22 +79484,22 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON } __pyx_L33:; - /* "collisions.py":2290 + /* "collisions.py":2376 * elif checkShpType(closestObj, ShpTyps.Circle) and (not thisIsOnP): * paralell = True * if cLines != []: # <<<<<<<<<<<<<< * for cLine in cLines: * sortedOtherLn = Line(*sorted([cLine.p1, cLine.p2], key=lambda x: x[0])) */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2290, __pyx_L1_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2376, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_19 = PyObject_RichCompare(__pyx_v_cLines, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_19); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2290, __pyx_L1_error) + __pyx_t_19 = PyObject_RichCompare(__pyx_v_cLines, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_19); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2376, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_19); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2290, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_19); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2376, __pyx_L1_error) __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; if (__pyx_t_5) { - /* "collisions.py":2291 + /* "collisions.py":2377 * paralell = True * if cLines != []: * for cLine in cLines: # <<<<<<<<<<<<<< @@ -76484,107 +79512,107 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_19); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2291, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2377, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_19, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2291, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_19, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2377, __pyx_L1_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_19, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2291, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_19, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif __Pyx_XDECREF_SET(__pyx_v_cLine, __pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2292 + /* "collisions.py":2378 * if cLines != []: * for cLine in cLines: * sortedOtherLn = Line(*sorted([cLine.p1, cLine.p2], key=lambda x: x[0])) # <<<<<<<<<<<<<< * otherLnNormal = math.degrees(math.atan2(sortedOtherLn[0][1]-sortedOtherLn[1][1], sortedOtherLn[0][0]-sortedOtherLn[1][0])) * paralell = abs(otherLnNormal%360 - thisNormal%360) < precision or abs((otherLnNormal-180)%360 - thisNormal%360) < precision */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2292, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_cLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2292, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_cLine, __pyx_n_s_p1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2292, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cLine, __pyx_n_s_p2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2292, __pyx_L1_error) + __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_9)) __PYX_ERR(0, 2292, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_9)) __PYX_ERR(0, 2378, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_1)) __PYX_ERR(0, 2292, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_1)) __PYX_ERR(0, 2378, __pyx_L1_error); __pyx_t_9 = 0; __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2292, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6)) __PYX_ERR(0, 2292, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6)) __PYX_ERR(0, 2378, __pyx_L1_error); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2292, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_19handleCollisionsPos_3lambda28, 0, __pyx_n_s_ClosedShape_handleCollisionsPos, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2292, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_19handleCollisionsPos_3lambda28, 0, __pyx_n_s_ClosedShape_handleCollisionsPos, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_key, __pyx_t_9) < 0) __PYX_ERR(0, 2292, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_key, __pyx_t_9) < 0) __PYX_ERR(0, 2378, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2292, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2292, __pyx_L1_error) + __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2292, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_sortedOtherLn, __pyx_t_9); __pyx_t_9 = 0; - /* "collisions.py":2293 + /* "collisions.py":2379 * for cLine in cLines: * sortedOtherLn = Line(*sorted([cLine.p1, cLine.p2], key=lambda x: x[0])) * otherLnNormal = math.degrees(math.atan2(sortedOtherLn[0][1]-sortedOtherLn[1][1], sortedOtherLn[0][0]-sortedOtherLn[1][0])) # <<<<<<<<<<<<<< * paralell = abs(otherLnNormal%360 - thisNormal%360) < precision or abs((otherLnNormal-180)%360 - thisNormal%360) < precision * if paralell: */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_math); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2293, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_math); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_degrees); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2293, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_degrees); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2293, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_math); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_atan2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2293, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_atan2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_sortedOtherLn, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2293, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_sortedOtherLn, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2293, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_sortedOtherLn, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2293, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_sortedOtherLn, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2293, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2293, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_sortedOtherLn, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2293, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_sortedOtherLn, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_11, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2293, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_11, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_sortedOtherLn, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2293, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_sortedOtherLn, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_20 = __Pyx_GetItemInt(__pyx_t_11, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 2293, __pyx_L1_error) + __pyx_t_20 = __Pyx_GetItemInt(__pyx_t_11, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 2379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyNumber_Subtract(__pyx_t_3, __pyx_t_20); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2293, __pyx_L1_error) + __pyx_t_11 = PyNumber_Subtract(__pyx_t_3, __pyx_t_20); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; @@ -76608,7 +79636,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2293, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } @@ -76631,34 +79659,34 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2293, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_XDECREF_SET(__pyx_v_otherLnNormal, __pyx_t_9); __pyx_t_9 = 0; - /* "collisions.py":2294 + /* "collisions.py":2380 * sortedOtherLn = Line(*sorted([cLine.p1, cLine.p2], key=lambda x: x[0])) * otherLnNormal = math.degrees(math.atan2(sortedOtherLn[0][1]-sortedOtherLn[1][1], sortedOtherLn[0][0]-sortedOtherLn[1][0])) * paralell = abs(otherLnNormal%360 - thisNormal%360) < precision or abs((otherLnNormal-180)%360 - thisNormal%360) < precision # <<<<<<<<<<<<<< * if paralell: * break */ - __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_v_otherLnNormal, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2294, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_v_otherLnNormal, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyInt_RemainderObjC(__pyx_v_thisNormal, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2294, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_RemainderObjC(__pyx_v_thisNormal, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_12 = PyNumber_Subtract(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2294, __pyx_L1_error) + __pyx_t_12 = PyNumber_Subtract(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyNumber_Absolute(__pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2294, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyNumber_Absolute(__pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyObject_RichCompare(__pyx_t_6, __pyx_v_precision, Py_LT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2294, __pyx_L1_error) + __pyx_t_12 = PyObject_RichCompare(__pyx_t_6, __pyx_v_precision, Py_LT); __Pyx_XGOTREF(__pyx_t_12); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2294, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2380, __pyx_L1_error) if (!__pyx_t_5) { __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } else { @@ -76667,21 +79695,21 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; goto __pyx_L47_bool_binop_done; } - __pyx_t_12 = __Pyx_PyInt_SubtractObjC(__pyx_v_otherLnNormal, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2294, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyInt_SubtractObjC(__pyx_v_otherLnNormal, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_6 = __Pyx_PyInt_RemainderObjC(__pyx_t_12, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2294, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_RemainderObjC(__pyx_t_12, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyInt_RemainderObjC(__pyx_v_thisNormal, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2294, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyInt_RemainderObjC(__pyx_v_thisNormal, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_6, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2294, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_t_6, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyNumber_Absolute(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2294, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyNumber_Absolute(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_12, __pyx_v_precision, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2294, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_12, __pyx_v_precision, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_INCREF(__pyx_t_2); __pyx_t_9 = __pyx_t_2; @@ -76690,17 +79718,17 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_DECREF_SET(__pyx_v_paralell, __pyx_t_9); __pyx_t_9 = 0; - /* "collisions.py":2295 + /* "collisions.py":2381 * otherLnNormal = math.degrees(math.atan2(sortedOtherLn[0][1]-sortedOtherLn[1][1], sortedOtherLn[0][0]-sortedOtherLn[1][0])) * paralell = abs(otherLnNormal%360 - thisNormal%360) < precision or abs((otherLnNormal-180)%360 - thisNormal%360) < precision * if paralell: # <<<<<<<<<<<<<< * break * velDiff = 180 */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_paralell); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2295, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_paralell); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2381, __pyx_L1_error) if (__pyx_t_5) { - /* "collisions.py":2296 + /* "collisions.py":2382 * paralell = abs(otherLnNormal%360 - thisNormal%360) < precision or abs((otherLnNormal-180)%360 - thisNormal%360) < precision * if paralell: * break # <<<<<<<<<<<<<< @@ -76709,7 +79737,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ goto __pyx_L46_break; - /* "collisions.py":2295 + /* "collisions.py":2381 * otherLnNormal = math.degrees(math.atan2(sortedOtherLn[0][1]-sortedOtherLn[1][1], sortedOtherLn[0][0]-sortedOtherLn[1][0])) * paralell = abs(otherLnNormal%360 - thisNormal%360) < precision or abs((otherLnNormal-180)%360 - thisNormal%360) < precision * if paralell: # <<<<<<<<<<<<<< @@ -76718,7 +79746,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ } - /* "collisions.py":2291 + /* "collisions.py":2377 * paralell = True * if cLines != []: * for cLine in cLines: # <<<<<<<<<<<<<< @@ -76733,7 +79761,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON goto __pyx_L50_for_end; __pyx_L50_for_end:; - /* "collisions.py":2290 + /* "collisions.py":2376 * elif checkShpType(closestObj, ShpTyps.Circle) and (not thisIsOnP): * paralell = True * if cLines != []: # <<<<<<<<<<<<<< @@ -76744,7 +79772,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON } __pyx_L32:; - /* "collisions.py":2297 + /* "collisions.py":2383 * if paralell: * break * velDiff = 180 # <<<<<<<<<<<<<< @@ -76754,17 +79782,17 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_INCREF(__pyx_int_180); __pyx_v_velDiff = __pyx_int_180; - /* "collisions.py":2298 + /* "collisions.py":2384 * break * velDiff = 180 * if paralell: # Line off line # <<<<<<<<<<<<<< * collTyp = 3 * # Reflect off the object's normal to the point (but really could be either point; the tangents *should* be the same) */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_paralell); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2298, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_paralell); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2384, __pyx_L1_error) if (__pyx_t_5) { - /* "collisions.py":2299 + /* "collisions.py":2385 * velDiff = 180 * if paralell: # Line off line * collTyp = 3 # <<<<<<<<<<<<<< @@ -76774,7 +79802,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_INCREF(__pyx_int_3); __pyx_v_collTyp = __pyx_int_3; - /* "collisions.py":2301 + /* "collisions.py":2387 * collTyp = 3 * # Reflect off the object's normal to the point (but really could be either point; the tangents *should* be the same) * normal = thisNormal # <<<<<<<<<<<<<< @@ -76784,36 +79812,36 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_INCREF(__pyx_v_thisNormal); __pyx_v_normal = __pyx_v_thisNormal; - /* "collisions.py":2302 + /* "collisions.py":2388 * # Reflect off the object's normal to the point (but really could be either point; the tangents *should* be the same) * normal = thisNormal * phi = math.degrees(math.atan2(newPoint[1] - closestP[1], newPoint[0] - closestP[0]))-90 # <<<<<<<<<<<<<< * else: * otherIsOnP = closestObj.isCorner(closestP, precision) */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_math); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2302, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_math); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_degrees); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2302, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_degrees); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_math); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2302, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_math); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_atan2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2302, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_atan2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_newPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2302, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_newPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2302, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_1 = PyNumber_Subtract(__pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2302, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_newPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2302, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_newPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2302, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_20 = PyNumber_Subtract(__pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 2302, __pyx_L1_error) + __pyx_t_20 = PyNumber_Subtract(__pyx_t_11, __pyx_t_12); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 2388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; @@ -76837,7 +79865,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2302, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -76860,17 +79888,17 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __pyx_t_19 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2302, __pyx_L1_error) + if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_19, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2302, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_19, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2388, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __pyx_v_phi = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":2298 + /* "collisions.py":2384 * break * velDiff = 180 * if paralell: # Line off line # <<<<<<<<<<<<<< @@ -76880,7 +79908,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON goto __pyx_L51; } - /* "collisions.py":2304 + /* "collisions.py":2390 * phi = math.degrees(math.atan2(newPoint[1] - closestP[1], newPoint[0] - closestP[0]))-90 * else: * otherIsOnP = closestObj.isCorner(closestP, precision) # <<<<<<<<<<<<<< @@ -76888,7 +79916,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON * collTyp = 0 */ /*else*/ { - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_isCorner); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2304, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_isCorner); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_9 = NULL; __pyx_t_4 = 0; @@ -76908,32 +79936,32 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_v_closestP, __pyx_v_precision}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_19, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2304, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; } __pyx_v_otherIsOnP = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":2305 + /* "collisions.py":2391 * else: * otherIsOnP = closestObj.isCorner(closestP, precision) * if thisIsOnP and otherIsOnP: # Point off point collision # <<<<<<<<<<<<<< * collTyp = 0 * # Reflect off the same way as you came in (as if you can land an infintesimally small point on another infintesimally small point anyway) */ - __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_23 < 0))) __PYX_ERR(0, 2305, __pyx_L1_error) + __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_23 < 0))) __PYX_ERR(0, 2391, __pyx_L1_error) if (__pyx_t_23) { } else { __pyx_t_5 = __pyx_t_23; goto __pyx_L53_bool_binop_done; } - __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_v_otherIsOnP); if (unlikely((__pyx_t_23 < 0))) __PYX_ERR(0, 2305, __pyx_L1_error) + __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_v_otherIsOnP); if (unlikely((__pyx_t_23 < 0))) __PYX_ERR(0, 2391, __pyx_L1_error) __pyx_t_5 = __pyx_t_23; __pyx_L53_bool_binop_done:; if (__pyx_t_5) { - /* "collisions.py":2306 + /* "collisions.py":2392 * otherIsOnP = closestObj.isCorner(closestP, precision) * if thisIsOnP and otherIsOnP: # Point off point collision * collTyp = 0 # <<<<<<<<<<<<<< @@ -76943,7 +79971,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_INCREF(__pyx_int_0); __pyx_v_collTyp = __pyx_int_0; - /* "collisions.py":2308 + /* "collisions.py":2394 * collTyp = 0 * # Reflect off the same way as you came in (as if you can land an infintesimally small point on another infintesimally small point anyway) * normal, phi = 0, 0 # <<<<<<<<<<<<<< @@ -76959,7 +79987,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __pyx_v_phi = __pyx_t_19; __pyx_t_19 = 0; - /* "collisions.py":2305 + /* "collisions.py":2391 * else: * otherIsOnP = closestObj.isCorner(closestP, precision) * if thisIsOnP and otherIsOnP: # Point off point collision # <<<<<<<<<<<<<< @@ -76969,26 +79997,26 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON goto __pyx_L52; } - /* "collisions.py":2309 + /* "collisions.py":2395 * # Reflect off the same way as you came in (as if you can land an infintesimally small point on another infintesimally small point anyway) * normal, phi = 0, 0 * elif thisIsOnP and (not otherIsOnP): # Point off line # <<<<<<<<<<<<<< * collTyp = 1 * # Reflect off the other object's normal to the point */ - __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_23 < 0))) __PYX_ERR(0, 2309, __pyx_L1_error) + __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_23 < 0))) __PYX_ERR(0, 2395, __pyx_L1_error) if (__pyx_t_23) { } else { __pyx_t_5 = __pyx_t_23; goto __pyx_L55_bool_binop_done; } - __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_v_otherIsOnP); if (unlikely((__pyx_t_23 < 0))) __PYX_ERR(0, 2309, __pyx_L1_error) + __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_v_otherIsOnP); if (unlikely((__pyx_t_23 < 0))) __PYX_ERR(0, 2395, __pyx_L1_error) __pyx_t_22 = (!__pyx_t_23); __pyx_t_5 = __pyx_t_22; __pyx_L55_bool_binop_done:; if (__pyx_t_5) { - /* "collisions.py":2310 + /* "collisions.py":2396 * normal, phi = 0, 0 * elif thisIsOnP and (not otherIsOnP): # Point off line * collTyp = 1 # <<<<<<<<<<<<<< @@ -76998,14 +80026,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_INCREF(__pyx_int_1); __pyx_v_collTyp = __pyx_int_1; - /* "collisions.py":2312 + /* "collisions.py":2398 * collTyp = 1 * # Reflect off the other object's normal to the point * normal = closestObj.tangent(closestP, vel)-90 # <<<<<<<<<<<<<< * phi = math.degrees(math.atan2(newPoint[1] - closestP[1], newPoint[0] - closestP[0]))-90 # The angle of incidence * elif (not thisIsOnP) and otherIsOnP: # Line off point */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_tangent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2312, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_tangent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = NULL; __pyx_t_4 = 0; @@ -77025,46 +80053,46 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_v_closestP, __pyx_v_vel}; __pyx_t_19 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2312, __pyx_L1_error) + if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_19, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2312, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_19, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __pyx_v_normal = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":2313 + /* "collisions.py":2399 * # Reflect off the other object's normal to the point * normal = closestObj.tangent(closestP, vel)-90 * phi = math.degrees(math.atan2(newPoint[1] - closestP[1], newPoint[0] - closestP[0]))-90 # The angle of incidence # <<<<<<<<<<<<<< * elif (not thisIsOnP) and otherIsOnP: # Line off point * collTyp = 2 */ - __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_math); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2313, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_math); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_degrees); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2313, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_degrees); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_math); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2313, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_math); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_atan2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 2313, __pyx_L1_error) + __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_atan2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 2399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_newPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2313, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_newPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2313, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = PyNumber_Subtract(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2313, __pyx_L1_error) + __pyx_t_12 = PyNumber_Subtract(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_newPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2313, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_newPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2313, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_11 = PyNumber_Subtract(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2313, __pyx_L1_error) + __pyx_t_11 = PyNumber_Subtract(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -77088,7 +80116,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2313, __pyx_L1_error) + if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; } @@ -77111,17 +80139,17 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2313, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } - __pyx_t_9 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2313, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2399, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_phi = __pyx_t_9; __pyx_t_9 = 0; - /* "collisions.py":2309 + /* "collisions.py":2395 * # Reflect off the same way as you came in (as if you can land an infintesimally small point on another infintesimally small point anyway) * normal, phi = 0, 0 * elif thisIsOnP and (not otherIsOnP): # Point off line # <<<<<<<<<<<<<< @@ -77131,26 +80159,26 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON goto __pyx_L52; } - /* "collisions.py":2314 + /* "collisions.py":2400 * normal = closestObj.tangent(closestP, vel)-90 * phi = math.degrees(math.atan2(newPoint[1] - closestP[1], newPoint[0] - closestP[0]))-90 # The angle of incidence * elif (not thisIsOnP) and otherIsOnP: # Line off point # <<<<<<<<<<<<<< * collTyp = 2 * # Reflect off this line's normal */ - __pyx_t_22 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_22 < 0))) __PYX_ERR(0, 2314, __pyx_L1_error) + __pyx_t_22 = __Pyx_PyObject_IsTrue(__pyx_v_thisIsOnP); if (unlikely((__pyx_t_22 < 0))) __PYX_ERR(0, 2400, __pyx_L1_error) __pyx_t_23 = (!__pyx_t_22); if (__pyx_t_23) { } else { __pyx_t_5 = __pyx_t_23; goto __pyx_L57_bool_binop_done; } - __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_v_otherIsOnP); if (unlikely((__pyx_t_23 < 0))) __PYX_ERR(0, 2314, __pyx_L1_error) + __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_v_otherIsOnP); if (unlikely((__pyx_t_23 < 0))) __PYX_ERR(0, 2400, __pyx_L1_error) __pyx_t_5 = __pyx_t_23; __pyx_L57_bool_binop_done:; if (__pyx_t_5) { - /* "collisions.py":2315 + /* "collisions.py":2401 * phi = math.degrees(math.atan2(newPoint[1] - closestP[1], newPoint[0] - closestP[0]))-90 # The angle of incidence * elif (not thisIsOnP) and otherIsOnP: # Line off point * collTyp = 2 # <<<<<<<<<<<<<< @@ -77160,48 +80188,48 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_INCREF(__pyx_int_2); __pyx_v_collTyp = __pyx_int_2; - /* "collisions.py":2317 + /* "collisions.py":2403 * collTyp = 2 * # Reflect off this line's normal * normal = thisNormal-90 # The normal off the line # <<<<<<<<<<<<<< * phi = math.degrees(math.atan2(closestP[1] - newPoint[1], closestP[0] - newPoint[0]))-90 # The angle of incidence * velDiff = 0 */ - __pyx_t_9 = __Pyx_PyInt_SubtractObjC(__pyx_v_thisNormal, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2317, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_SubtractObjC(__pyx_v_thisNormal, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_v_normal = __pyx_t_9; __pyx_t_9 = 0; - /* "collisions.py":2318 + /* "collisions.py":2404 * # Reflect off this line's normal * normal = thisNormal-90 # The normal off the line * phi = math.degrees(math.atan2(closestP[1] - newPoint[1], closestP[0] - newPoint[0]))-90 # The angle of incidence # <<<<<<<<<<<<<< * velDiff = 0 * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2318, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_degrees); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2318, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_degrees); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_math); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 2318, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_20, __pyx_n_s_math); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 2404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_atan2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2318, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_20, __pyx_n_s_atan2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; - __pyx_t_20 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 2318, __pyx_L1_error) + __pyx_t_20 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 2404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_newPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2318, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_newPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_6 = PyNumber_Subtract(__pyx_t_20, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2318, __pyx_L1_error) + __pyx_t_6 = PyNumber_Subtract(__pyx_t_20, __pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2318, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_20 = __Pyx_GetItemInt(__pyx_v_newPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 2318, __pyx_L1_error) + __pyx_t_20 = __Pyx_GetItemInt(__pyx_v_newPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 2404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_20); - __pyx_t_1 = PyNumber_Subtract(__pyx_t_12, __pyx_t_20); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2318, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_12, __pyx_t_20); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0; @@ -77225,7 +80253,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2318, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } @@ -77248,17 +80276,17 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_19, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2318, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; } - __pyx_t_19 = __Pyx_PyInt_SubtractObjC(__pyx_t_9, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2318, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyInt_SubtractObjC(__pyx_t_9, __pyx_int_90, 90, 0, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_phi = __pyx_t_19; __pyx_t_19 = 0; - /* "collisions.py":2319 + /* "collisions.py":2405 * normal = thisNormal-90 # The normal off the line * phi = math.degrees(math.atan2(closestP[1] - newPoint[1], closestP[0] - newPoint[0]))-90 # The angle of incidence * velDiff = 0 # <<<<<<<<<<<<<< @@ -77268,7 +80296,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_INCREF(__pyx_int_0); __Pyx_DECREF_SET(__pyx_v_velDiff, __pyx_int_0); - /* "collisions.py":2314 + /* "collisions.py":2400 * normal = closestObj.tangent(closestP, vel)-90 * phi = math.degrees(math.atan2(newPoint[1] - closestP[1], newPoint[0] - closestP[0]))-90 # The angle of incidence * elif (not thisIsOnP) and otherIsOnP: # Line off point # <<<<<<<<<<<<<< @@ -77278,7 +80306,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON goto __pyx_L52; } - /* "collisions.py":2324 + /* "collisions.py":2410 * # 'Cannot have a line reflecting off of another line when they aren\'t paralell; something bad must have occured!' * #) * collTyp = None # <<<<<<<<<<<<<< @@ -77289,7 +80317,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_INCREF(Py_None); __pyx_v_collTyp = Py_None; - /* "collisions.py":2325 + /* "collisions.py":2411 * #) * collTyp = None * normal, phi = 0, 0 # <<<<<<<<<<<<<< @@ -77309,97 +80337,97 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON } __pyx_L51:; - /* "collisions.py":2327 + /* "collisions.py":2413 * normal, phi = 0, 0 * * if round(newPoint[0], precision) == round(closestP[0], precision) and round(newPoint[1], precision) == round(closestP[1], precision): # <<<<<<<<<<<<<< * phi = normal+180 * */ - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_newPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2327, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_newPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2327, __pyx_L1_error) + __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_9)) __PYX_ERR(0, 2327, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_9)) __PYX_ERR(0, 2413, __pyx_L1_error); __Pyx_INCREF(__pyx_v_precision); __Pyx_GIVEREF(__pyx_v_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_v_precision)) __PYX_ERR(0, 2327, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_v_precision)) __PYX_ERR(0, 2413, __pyx_L1_error); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_19, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2327, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_19, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2327, __pyx_L1_error) + __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2327, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_19); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_19)) __PYX_ERR(0, 2327, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_19)) __PYX_ERR(0, 2413, __pyx_L1_error); __Pyx_INCREF(__pyx_v_precision); __Pyx_GIVEREF(__pyx_v_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_precision)) __PYX_ERR(0, 2327, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_precision)) __PYX_ERR(0, 2413, __pyx_L1_error); __pyx_t_19 = 0; - __pyx_t_19 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_2, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2327, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_2, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_9, __pyx_t_19, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2327, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_9, __pyx_t_19, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2413, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_23 < 0))) __PYX_ERR(0, 2327, __pyx_L1_error) + __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_23 < 0))) __PYX_ERR(0, 2413, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_23) { } else { __pyx_t_5 = __pyx_t_23; goto __pyx_L60_bool_binop_done; } - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_newPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2327, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_newPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2327, __pyx_L1_error) + __pyx_t_19 = PyTuple_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_2)) __PYX_ERR(0, 2327, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_2)) __PYX_ERR(0, 2413, __pyx_L1_error); __Pyx_INCREF(__pyx_v_precision); __Pyx_GIVEREF(__pyx_v_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_v_precision)) __PYX_ERR(0, 2327, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_v_precision)) __PYX_ERR(0, 2413, __pyx_L1_error); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_19, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2327, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_19, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2327, __pyx_L1_error) + __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2327, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_19); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_19)) __PYX_ERR(0, 2327, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_19)) __PYX_ERR(0, 2413, __pyx_L1_error); __Pyx_INCREF(__pyx_v_precision); __Pyx_GIVEREF(__pyx_v_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_precision)) __PYX_ERR(0, 2327, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_precision)) __PYX_ERR(0, 2413, __pyx_L1_error); __pyx_t_19 = 0; - __pyx_t_19 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_9, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2327, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_9, NULL); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyObject_RichCompare(__pyx_t_2, __pyx_t_19, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2327, __pyx_L1_error) + __pyx_t_9 = PyObject_RichCompare(__pyx_t_2, __pyx_t_19, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2413, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_23 < 0))) __PYX_ERR(0, 2327, __pyx_L1_error) + __pyx_t_23 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_23 < 0))) __PYX_ERR(0, 2413, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_5 = __pyx_t_23; __pyx_L60_bool_binop_done:; if (__pyx_t_5) { - /* "collisions.py":2328 + /* "collisions.py":2414 * * if round(newPoint[0], precision) == round(closestP[0], precision) and round(newPoint[1], precision) == round(closestP[1], precision): * phi = normal+180 # <<<<<<<<<<<<<< * * # the distance between the closest point on the other object and the corresponding point on the newLine */ - __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_v_normal, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2328, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_AddObjC(__pyx_v_normal, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF_SET(__pyx_v_phi, __pyx_t_9); __pyx_t_9 = 0; - /* "collisions.py":2327 + /* "collisions.py":2413 * normal, phi = 0, 0 * * if round(newPoint[0], precision) == round(closestP[0], precision) and round(newPoint[1], precision) == round(closestP[1], precision): # <<<<<<<<<<<<<< @@ -77408,31 +80436,31 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ } - /* "collisions.py":2331 + /* "collisions.py":2417 * * # the distance between the closest point on the other object and the corresponding point on the newLine * dist_left = math.hypot(newPoint[0]-closestP[0], newPoint[1]-closestP[1]) * closestObj.bounciness # <<<<<<<<<<<<<< * diff = (phi-normal) % 360 # The difference between the angle of incidence and the normal * if diff > 180: # Do we even need this? */ - __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_math); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2331, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_19, __pyx_n_s_math); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_hypot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2331, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_19, __pyx_n_s_hypot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_newPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2331, __pyx_L1_error) + __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_newPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2331, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_1 = PyNumber_Subtract(__pyx_t_19, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2331, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_19, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_newPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2331, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_newPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2331, __pyx_L1_error) + __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_6 = PyNumber_Subtract(__pyx_t_11, __pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2331, __pyx_L1_error) + __pyx_t_6 = PyNumber_Subtract(__pyx_t_11, __pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; @@ -77456,59 +80484,59 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2331, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2331, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyNumber_Multiply(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2331, __pyx_L1_error) + __pyx_t_6 = PyNumber_Multiply(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_dist_left = __pyx_t_6; __pyx_t_6 = 0; - /* "collisions.py":2332 + /* "collisions.py":2418 * # the distance between the closest point on the other object and the corresponding point on the newLine * dist_left = math.hypot(newPoint[0]-closestP[0], newPoint[1]-closestP[1]) * closestObj.bounciness * diff = (phi-normal) % 360 # The difference between the angle of incidence and the normal # <<<<<<<<<<<<<< * if diff > 180: # Do we even need this? * diff -= 360 */ - __pyx_t_6 = PyNumber_Subtract(__pyx_v_phi, __pyx_v_normal); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2332, __pyx_L1_error) + __pyx_t_6 = PyNumber_Subtract(__pyx_v_phi, __pyx_v_normal); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_t_6, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2332, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_RemainderObjC(__pyx_t_6, __pyx_int_360, 0x168, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_diff = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":2333 + /* "collisions.py":2419 * dist_left = math.hypot(newPoint[0]-closestP[0], newPoint[1]-closestP[1]) * closestObj.bounciness * diff = (phi-normal) % 360 # The difference between the angle of incidence and the normal * if diff > 180: # Do we even need this? # <<<<<<<<<<<<<< * diff -= 360 * pos = rotate(closestP, [closestP[0], closestP[1] + dist_left], phi-180-diff*2) */ - __pyx_t_2 = PyObject_RichCompare(__pyx_v_diff, __pyx_int_180, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2333, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2333, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_v_diff, __pyx_int_180, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2419, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2419, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { - /* "collisions.py":2334 + /* "collisions.py":2420 * diff = (phi-normal) % 360 # The difference between the angle of incidence and the normal * if diff > 180: # Do we even need this? * diff -= 360 # <<<<<<<<<<<<<< * pos = rotate(closestP, [closestP[0], closestP[1] + dist_left], phi-180-diff*2) * vel = list(rotateBy0(vel, velDiff-diff*2)) */ - __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_diff, __pyx_int_360, 0x168, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2334, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_diff, __pyx_int_360, 0x168, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF_SET(__pyx_v_diff, __pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2333 + /* "collisions.py":2419 * dist_left = math.hypot(newPoint[0]-closestP[0], newPoint[1]-closestP[1]) * closestObj.bounciness * diff = (phi-normal) % 360 # The difference between the angle of incidence and the normal * if diff > 180: # Do we even need this? # <<<<<<<<<<<<<< @@ -77517,35 +80545,35 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ } - /* "collisions.py":2335 + /* "collisions.py":2421 * if diff > 180: # Do we even need this? * diff -= 360 * pos = rotate(closestP, [closestP[0], closestP[1] + dist_left], phi-180-diff*2) # <<<<<<<<<<<<<< * vel = list(rotateBy0(vel, velDiff-diff*2)) * vel = [vel[0]*closestObj.bounciness, vel[1]*closestObj.bounciness] */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_rotate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2335, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_rotate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2335, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2335, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_19 = PyNumber_Add(__pyx_t_1, __pyx_v_dist_left); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2335, __pyx_L1_error) + __pyx_t_19 = PyNumber_Add(__pyx_t_1, __pyx_v_dist_left); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2335, __pyx_L1_error) + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_9)) __PYX_ERR(0, 2335, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_9)) __PYX_ERR(0, 2421, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_19); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_19)) __PYX_ERR(0, 2335, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_19)) __PYX_ERR(0, 2421, __pyx_L1_error); __pyx_t_9 = 0; __pyx_t_19 = 0; - __pyx_t_19 = __Pyx_PyInt_SubtractObjC(__pyx_v_phi, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2335, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyInt_SubtractObjC(__pyx_v_phi, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_9 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2335, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_11 = PyNumber_Subtract(__pyx_t_19, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2335, __pyx_L1_error) + __pyx_t_11 = PyNumber_Subtract(__pyx_t_19, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -77569,25 +80597,25 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2335, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __pyx_v_pos = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":2336 + /* "collisions.py":2422 * diff -= 360 * pos = rotate(closestP, [closestP[0], closestP[1] + dist_left], phi-180-diff*2) * vel = list(rotateBy0(vel, velDiff-diff*2)) # <<<<<<<<<<<<<< * vel = [vel[0]*closestObj.bounciness, vel[1]*closestObj.bounciness] * diff2Point = (closestP[0]-cPoint[0], closestP[1]-cPoint[1]) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_rotateBy0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2336, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_rotateBy0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_11 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2336, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_1 = PyNumber_Subtract(__pyx_v_velDiff, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2336, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_v_velDiff, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; @@ -77609,142 +80637,142 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2336, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_6 = __Pyx_PySequence_ListKeepNew(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2336, __pyx_L1_error) + __pyx_t_6 = __Pyx_PySequence_ListKeepNew(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_vel, __pyx_t_6); __pyx_t_6 = 0; - /* "collisions.py":2337 + /* "collisions.py":2423 * pos = rotate(closestP, [closestP[0], closestP[1] + dist_left], phi-180-diff*2) * vel = list(rotateBy0(vel, velDiff-diff*2)) * vel = [vel[0]*closestObj.bounciness, vel[1]*closestObj.bounciness] # <<<<<<<<<<<<<< * diff2Point = (closestP[0]-cPoint[0], closestP[1]-cPoint[1]) * odiff = (pos[0]-cPoint[0], pos[1]-cPoint[1]) */ - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2337, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2337, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Multiply(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2337, __pyx_L1_error) + __pyx_t_1 = PyNumber_Multiply(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2423, __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; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2337, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2337, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_closestObj, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_11 = PyNumber_Multiply(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2337, __pyx_L1_error) + __pyx_t_11 = PyNumber_Multiply(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2337, __pyx_L1_error) + __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(0, 2337, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(0, 2423, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_11)) __PYX_ERR(0, 2337, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_11)) __PYX_ERR(0, 2423, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_11 = 0; __Pyx_DECREF_SET(__pyx_v_vel, __pyx_t_6); __pyx_t_6 = 0; - /* "collisions.py":2338 + /* "collisions.py":2424 * vel = list(rotateBy0(vel, velDiff-diff*2)) * vel = [vel[0]*closestObj.bounciness, vel[1]*closestObj.bounciness] * diff2Point = (closestP[0]-cPoint[0], closestP[1]-cPoint[1]) # <<<<<<<<<<<<<< * odiff = (pos[0]-cPoint[0], pos[1]-cPoint[1]) * smallness = rotateBy0([0, AVERYSMALLNUMBER], phi-180-diff*2) # HACK */ - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2338, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_closestP, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_cPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2338, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_cPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_1 = PyNumber_Subtract(__pyx_t_6, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2338, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_6, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2338, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_closestP, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_cPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2338, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_cPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyNumber_Subtract(__pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2338, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2338, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(0, 2338, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(0, 2424, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2)) __PYX_ERR(0, 2338, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2)) __PYX_ERR(0, 2424, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_v_diff2Point = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; - /* "collisions.py":2339 + /* "collisions.py":2425 * vel = [vel[0]*closestObj.bounciness, vel[1]*closestObj.bounciness] * diff2Point = (closestP[0]-cPoint[0], closestP[1]-cPoint[1]) * odiff = (pos[0]-cPoint[0], pos[1]-cPoint[1]) # <<<<<<<<<<<<<< * smallness = rotateBy0([0, AVERYSMALLNUMBER], phi-180-diff*2) # HACK * newobj = self.copy() */ - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2339, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_pos, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_cPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2339, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_cPoint, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyNumber_Subtract(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2339, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2425, __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; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2339, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pos, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_cPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2339, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_cPoint, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_11 = PyNumber_Subtract(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2339, __pyx_L1_error) + __pyx_t_11 = PyNumber_Subtract(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2339, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(0, 2339, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(0, 2425, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_11)) __PYX_ERR(0, 2339, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_11)) __PYX_ERR(0, 2425, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_11 = 0; __pyx_v_odiff = ((PyObject*)__pyx_t_6); __pyx_t_6 = 0; - /* "collisions.py":2340 + /* "collisions.py":2426 * diff2Point = (closestP[0]-cPoint[0], closestP[1]-cPoint[1]) * odiff = (pos[0]-cPoint[0], pos[1]-cPoint[1]) * smallness = rotateBy0([0, AVERYSMALLNUMBER], phi-180-diff*2) # HACK # <<<<<<<<<<<<<< * newobj = self.copy() * newobj.x, newobj.y = newobj.x+odiff[0], newobj.y+odiff[1] */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_rotateBy0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2340, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_rotateBy0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_AVERYSMALLNUMBER); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2340, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_AVERYSMALLNUMBER); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2340, __pyx_L1_error) + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_0)) __PYX_ERR(0, 2340, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_int_0)) __PYX_ERR(0, 2426, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 2340, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 2426, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_phi, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2340, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_phi, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2340, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyInt_MultiplyObjC(__pyx_v_diff, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_19 = PyNumber_Subtract(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2340, __pyx_L1_error) + __pyx_t_19 = PyNumber_Subtract(__pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -77768,21 +80796,21 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2340, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __pyx_v_smallness = __pyx_t_6; __pyx_t_6 = 0; - /* "collisions.py":2341 + /* "collisions.py":2427 * odiff = (pos[0]-cPoint[0], pos[1]-cPoint[1]) * smallness = rotateBy0([0, AVERYSMALLNUMBER], phi-180-diff*2) # HACK * newobj = self.copy() # <<<<<<<<<<<<<< * newobj.x, newobj.y = newobj.x+odiff[0], newobj.y+odiff[1] * intermediateObj = self.copy() */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_copy); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2341, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_copy); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_19 = NULL; __pyx_t_4 = 0; @@ -77802,49 +80830,49 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON PyObject *__pyx_callargs[2] = {__pyx_t_19, NULL}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2341, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2427, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __pyx_v_newobj = __pyx_t_6; __pyx_t_6 = 0; - /* "collisions.py":2342 + /* "collisions.py":2428 * smallness = rotateBy0([0, AVERYSMALLNUMBER], phi-180-diff*2) # HACK * newobj = self.copy() * newobj.x, newobj.y = newobj.x+odiff[0], newobj.y+odiff[1] # <<<<<<<<<<<<<< * intermediateObj = self.copy() * intermediateObj.x, intermediateObj.y = oldShp.x+diff2Point[0]+smallness[0], oldShp.y+diff2Point[1]+smallness[1] */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_newobj, __pyx_n_s_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2342, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_newobj, __pyx_n_s_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_11 = __Pyx_GetItemInt_Tuple(__pyx_v_odiff, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2342, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt_Tuple(__pyx_v_odiff, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_19 = PyNumber_Add(__pyx_t_6, __pyx_t_11); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2342, __pyx_L1_error) + __pyx_t_19 = PyNumber_Add(__pyx_t_6, __pyx_t_11); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_newobj, __pyx_n_s_y); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2342, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_newobj, __pyx_n_s_y); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_odiff, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2342, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_odiff, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyNumber_Add(__pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2342, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_newobj, __pyx_n_s_x, __pyx_t_19) < 0) __PYX_ERR(0, 2342, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_newobj, __pyx_n_s_x, __pyx_t_19) < 0) __PYX_ERR(0, 2428, __pyx_L1_error) __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_newobj, __pyx_n_s_y, __pyx_t_2) < 0) __PYX_ERR(0, 2342, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_newobj, __pyx_n_s_y, __pyx_t_2) < 0) __PYX_ERR(0, 2428, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2343 + /* "collisions.py":2429 * newobj = self.copy() * newobj.x, newobj.y = newobj.x+odiff[0], newobj.y+odiff[1] * intermediateObj = self.copy() # <<<<<<<<<<<<<< * intermediateObj.x, intermediateObj.y = oldShp.x+diff2Point[0]+smallness[0], oldShp.y+diff2Point[1]+smallness[1] * o = self.handleCollisionsPos(intermediateObj, newobj, objs, vel, False, precision, verbose) */ - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_copy); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2343, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_copy); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __pyx_t_6 = NULL; __pyx_t_4 = 0; @@ -77864,61 +80892,61 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_19, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2343, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; } __pyx_v_intermediateObj = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":2344 + /* "collisions.py":2430 * newobj.x, newobj.y = newobj.x+odiff[0], newobj.y+odiff[1] * intermediateObj = self.copy() * intermediateObj.x, intermediateObj.y = oldShp.x+diff2Point[0]+smallness[0], oldShp.y+diff2Point[1]+smallness[1] # <<<<<<<<<<<<<< * o = self.handleCollisionsPos(intermediateObj, newobj, objs, vel, False, precision, verbose) * out, outvel = o[0], o[1] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldShp, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2344, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldShp, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_19 = __Pyx_GetItemInt_Tuple(__pyx_v_diff2Point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2344, __pyx_L1_error) + __pyx_t_19 = __Pyx_GetItemInt_Tuple(__pyx_v_diff2Point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2344, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_19); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_smallness, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2344, __pyx_L1_error) + __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_smallness, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_19); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2344, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_19); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldShp, __pyx_n_s_y); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2344, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_oldShp, __pyx_n_s_y); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_diff2Point, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2344, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_diff2Point, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_11 = PyNumber_Add(__pyx_t_19, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2344, __pyx_L1_error) + __pyx_t_11 = PyNumber_Add(__pyx_t_19, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_smallness, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2344, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_smallness, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_19 = PyNumber_Add(__pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2344, __pyx_L1_error) + __pyx_t_19 = PyNumber_Add(__pyx_t_11, __pyx_t_6); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_intermediateObj, __pyx_n_s_x, __pyx_t_2) < 0) __PYX_ERR(0, 2344, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_intermediateObj, __pyx_n_s_x, __pyx_t_2) < 0) __PYX_ERR(0, 2430, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_intermediateObj, __pyx_n_s_y, __pyx_t_19) < 0) __PYX_ERR(0, 2344, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_intermediateObj, __pyx_n_s_y, __pyx_t_19) < 0) __PYX_ERR(0, 2430, __pyx_L1_error) __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - /* "collisions.py":2345 + /* "collisions.py":2431 * intermediateObj = self.copy() * intermediateObj.x, intermediateObj.y = oldShp.x+diff2Point[0]+smallness[0], oldShp.y+diff2Point[1]+smallness[1] * o = self.handleCollisionsPos(intermediateObj, newobj, objs, vel, False, precision, verbose) # <<<<<<<<<<<<<< * out, outvel = o[0], o[1] * if replaceSelf: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handleCollisionsPos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2345, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handleCollisionsPos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_4 = 0; @@ -77938,56 +80966,56 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON PyObject *__pyx_callargs[8] = {__pyx_t_6, __pyx_v_intermediateObj, __pyx_v_newobj, __pyx_v_objs, __pyx_v_vel, Py_False, __pyx_v_precision, __pyx_v_verbose}; __pyx_t_19 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 7+__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2345, __pyx_L1_error) + if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2431, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_XDECREF_SET(__pyx_v_o, __pyx_t_19); __pyx_t_19 = 0; - /* "collisions.py":2346 + /* "collisions.py":2432 * intermediateObj.x, intermediateObj.y = oldShp.x+diff2Point[0]+smallness[0], oldShp.y+diff2Point[1]+smallness[1] * o = self.handleCollisionsPos(intermediateObj, newobj, objs, vel, False, precision, verbose) * out, outvel = o[0], o[1] # <<<<<<<<<<<<<< * if replaceSelf: * self.x, self.y = out.x, out.y */ - __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_o, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2346, __pyx_L1_error) + __pyx_t_19 = __Pyx_GetItemInt(__pyx_v_o, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_o, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2346, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_o, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2432, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_out = __pyx_t_19; __pyx_t_19 = 0; __pyx_v_outvel = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":2347 + /* "collisions.py":2433 * o = self.handleCollisionsPos(intermediateObj, newobj, objs, vel, False, precision, verbose) * out, outvel = o[0], o[1] * if replaceSelf: # <<<<<<<<<<<<<< * self.x, self.y = out.x, out.y * if verbose: */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_replaceSelf); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2347, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_replaceSelf); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2433, __pyx_L1_error) if (__pyx_t_5) { - /* "collisions.py":2348 + /* "collisions.py":2434 * out, outvel = o[0], o[1] * if replaceSelf: * self.x, self.y = out.x, out.y # <<<<<<<<<<<<<< * if verbose: * return out, outvel, [collTyp, True] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2348, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_y); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2348, __pyx_L1_error) + __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_y); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_2) < 0) __PYX_ERR(0, 2348, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_2) < 0) __PYX_ERR(0, 2434, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_19) < 0) __PYX_ERR(0, 2348, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_19) < 0) __PYX_ERR(0, 2434, __pyx_L1_error) __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0; - /* "collisions.py":2347 + /* "collisions.py":2433 * o = self.handleCollisionsPos(intermediateObj, newobj, objs, vel, False, precision, verbose) * out, outvel = o[0], o[1] * if replaceSelf: # <<<<<<<<<<<<<< @@ -77996,17 +81024,17 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ } - /* "collisions.py":2349 + /* "collisions.py":2435 * if replaceSelf: * self.x, self.y = out.x, out.y * if verbose: # <<<<<<<<<<<<<< * return out, outvel, [collTyp, True] * return out, outvel */ - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2349, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2435, __pyx_L1_error) if (__pyx_t_5) { - /* "collisions.py":2350 + /* "collisions.py":2436 * self.x, self.y = out.x, out.y * if verbose: * return out, outvel, [collTyp, True] # <<<<<<<<<<<<<< @@ -78014,30 +81042,30 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_19 = PyList_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2350, __pyx_L1_error) + __pyx_t_19 = PyList_New(2); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 2436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_19); __Pyx_INCREF(__pyx_v_collTyp); __Pyx_GIVEREF(__pyx_v_collTyp); - if (__Pyx_PyList_SET_ITEM(__pyx_t_19, 0, __pyx_v_collTyp)) __PYX_ERR(0, 2350, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_19, 0, __pyx_v_collTyp)) __PYX_ERR(0, 2436, __pyx_L1_error); __Pyx_INCREF(Py_True); __Pyx_GIVEREF(Py_True); - if (__Pyx_PyList_SET_ITEM(__pyx_t_19, 1, Py_True)) __PYX_ERR(0, 2350, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2350, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_19, 1, Py_True)) __PYX_ERR(0, 2436, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_out); __Pyx_GIVEREF(__pyx_v_out); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_out)) __PYX_ERR(0, 2350, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_out)) __PYX_ERR(0, 2436, __pyx_L1_error); __Pyx_INCREF(__pyx_v_outvel); __Pyx_GIVEREF(__pyx_v_outvel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_outvel)) __PYX_ERR(0, 2350, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_outvel)) __PYX_ERR(0, 2436, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_19); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_19)) __PYX_ERR(0, 2350, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_19)) __PYX_ERR(0, 2436, __pyx_L1_error); __pyx_t_19 = 0; __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":2349 + /* "collisions.py":2435 * if replaceSelf: * self.x, self.y = out.x, out.y * if verbose: # <<<<<<<<<<<<<< @@ -78046,7 +81074,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON */ } - /* "collisions.py":2351 + /* "collisions.py":2437 * if verbose: * return out, outvel, [collTyp, True] * return out, outvel # <<<<<<<<<<<<<< @@ -78054,19 +81082,19 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON * def handleCollisionsVel(self, */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2351, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_out); __Pyx_GIVEREF(__pyx_v_out); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_out)) __PYX_ERR(0, 2351, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_out)) __PYX_ERR(0, 2437, __pyx_L1_error); __Pyx_INCREF(__pyx_v_outvel); __Pyx_GIVEREF(__pyx_v_outvel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_outvel)) __PYX_ERR(0, 2351, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_outvel)) __PYX_ERR(0, 2437, __pyx_L1_error); __pyx_r = ((PyObject*)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":2200 + /* "collisions.py":2286 * return tries[0][0] * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< @@ -78132,7 +81160,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON return __pyx_r; } -/* "collisions.py":2353 +/* "collisions.py":2439 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< @@ -78140,7 +81168,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_6handleCollisionsPos(CYTHON * objs: Union[Shapes, Iterable[Shape]], */ -static PyObject *__pyx_pf_10collisions_56__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { +static PyObject *__pyx_pf_10collisions_58__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -78151,39 +81179,39 @@ static PyObject *__pyx_pf_10collisions_56__defaults__(CYTHON_UNUSED PyObject *__ __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - /* "collisions.py":2358 + /* "collisions.py":2444 * replaceSelf: bool = True, * precision: Number = BASEPRECISION, * verbose: bool = False # <<<<<<<<<<<<<< * ) -> tuple['ClosedShape', pointLike, verboseOutput]: * """ */ - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2353, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(((PyObject *)Py_True)); __Pyx_GIVEREF(((PyObject *)Py_True)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_True))) __PYX_ERR(0, 2353, __pyx_L1_error); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults19, __pyx_self)->__pyx_arg_precision); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults19, __pyx_self)->__pyx_arg_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults19, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 2353, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_True))) __PYX_ERR(0, 2439, __pyx_L1_error); + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults20, __pyx_self)->__pyx_arg_precision); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults20, __pyx_self)->__pyx_arg_precision); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __Pyx_CyFunction_Defaults(__pyx_defaults20, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 2439, __pyx_L1_error); __Pyx_INCREF(((PyObject *)Py_False)); __Pyx_GIVEREF(((PyObject *)Py_False)); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)Py_False))) __PYX_ERR(0, 2353, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)Py_False))) __PYX_ERR(0, 2439, __pyx_L1_error); - /* "collisions.py":2353 + /* "collisions.py":2439 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< * vel: pointLike, * objs: Union[Shapes, Iterable[Shape]], */ - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2353, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 2353, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 2439, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 2353, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 2439, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -78245,7 +81273,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_vel,&__pyx_n_s_objs,&__pyx_n_s_replaceSelf,&__pyx_n_s_precision,&__pyx_n_s_verbose,0}; - __pyx_defaults19 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults19, __pyx_self); + __pyx_defaults20 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults20, __pyx_self); values[3] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); values[4] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_precision); values[5] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_False))); @@ -78274,7 +81302,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2353, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2439, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -78282,9 +81310,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2353, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2439, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 1); __PYX_ERR(0, 2353, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 1); __PYX_ERR(0, 2439, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -78292,35 +81320,35 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2353, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2439, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 2); __PYX_ERR(0, 2353, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, 2); __PYX_ERR(0, 2439, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_replaceSelf); if (value) { values[3] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2353, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2439, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_precision); if (value) { values[4] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2353, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2439, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_verbose); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2353, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2439, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "handleCollisionsVel") < 0)) __PYX_ERR(0, 2353, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "handleCollisionsVel") < 0)) __PYX_ERR(0, 2439, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -78346,7 +81374,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, __pyx_nargs); __PYX_ERR(0, 2353, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("handleCollisionsVel", 0, 3, 6, __pyx_nargs); __PYX_ERR(0, 2439, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -78391,14 +81419,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_8handleCollisionsVel(CYTHON int __pyx_clineno = 0; __Pyx_RefNannySetupContext("handleCollisionsVel", 1); - /* "collisions.py":2377 + /* "collisions.py":2463 * DidReflect (bool): Whether the line reflected off of something * """ * n = self.copy() # <<<<<<<<<<<<<< * n.x, n.y = n.x+vel[0], n.y+vel[1] * o = self.handleCollisionsPos(self, n, objs, vel, False, precision, verbose) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2377, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -78418,49 +81446,49 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_8handleCollisionsVel(CYTHON PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2377, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_n = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":2378 + /* "collisions.py":2464 * """ * n = self.copy() * n.x, n.y = n.x+vel[0], n.y+vel[1] # <<<<<<<<<<<<<< * o = self.handleCollisionsPos(self, n, objs, vel, False, precision, verbose) * out, outvel = o[0], o[1] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2378, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2378, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_vel, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2378, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2378, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2378, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_vel, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2378, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_n, __pyx_n_s_x, __pyx_t_3) < 0) __PYX_ERR(0, 2378, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_n, __pyx_n_s_x, __pyx_t_3) < 0) __PYX_ERR(0, 2464, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_n, __pyx_n_s_y, __pyx_t_5) < 0) __PYX_ERR(0, 2378, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_n, __pyx_n_s_y, __pyx_t_5) < 0) __PYX_ERR(0, 2464, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "collisions.py":2379 + /* "collisions.py":2465 * n = self.copy() * n.x, n.y = n.x+vel[0], n.y+vel[1] * o = self.handleCollisionsPos(self, n, objs, vel, False, precision, verbose) # <<<<<<<<<<<<<< * out, outvel = o[0], o[1] * if replaceSelf: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handleCollisionsPos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2379, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_handleCollisionsPos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_1 = NULL; __pyx_t_4 = 0; @@ -78480,56 +81508,56 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_8handleCollisionsVel(CYTHON PyObject *__pyx_callargs[8] = {__pyx_t_1, __pyx_v_self, __pyx_v_n, __pyx_v_objs, __pyx_v_vel, Py_False, __pyx_v_precision, __pyx_v_verbose}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 7+__pyx_t_4); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2379, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __pyx_v_o = __pyx_t_5; __pyx_t_5 = 0; - /* "collisions.py":2380 + /* "collisions.py":2466 * n.x, n.y = n.x+vel[0], n.y+vel[1] * o = self.handleCollisionsPos(self, n, objs, vel, False, precision, verbose) * out, outvel = o[0], o[1] # <<<<<<<<<<<<<< * if replaceSelf: * self.x, self.y = out.x, out.y */ - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_o, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2380, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_o, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_o, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2380, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_o, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_out = __pyx_t_5; __pyx_t_5 = 0; __pyx_v_outvel = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":2381 + /* "collisions.py":2467 * o = self.handleCollisionsPos(self, n, objs, vel, False, precision, verbose) * out, outvel = o[0], o[1] * if replaceSelf: # <<<<<<<<<<<<<< * self.x, self.y = out.x, out.y * if verbose: */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_replaceSelf); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2381, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_replaceSelf); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2467, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":2382 + /* "collisions.py":2468 * out, outvel = o[0], o[1] * if replaceSelf: * self.x, self.y = out.x, out.y # <<<<<<<<<<<<<< * if verbose: * return out, outvel, o[2] */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2382, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2382, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_out, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2468, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_3) < 0) __PYX_ERR(0, 2382, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_3) < 0) __PYX_ERR(0, 2468, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_5) < 0) __PYX_ERR(0, 2382, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_5) < 0) __PYX_ERR(0, 2468, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "collisions.py":2381 + /* "collisions.py":2467 * o = self.handleCollisionsPos(self, n, objs, vel, False, precision, verbose) * out, outvel = o[0], o[1] * if replaceSelf: # <<<<<<<<<<<<<< @@ -78538,17 +81566,17 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_8handleCollisionsVel(CYTHON */ } - /* "collisions.py":2383 + /* "collisions.py":2469 * if replaceSelf: * self.x, self.y = out.x, out.y * if verbose: # <<<<<<<<<<<<<< * return out, outvel, o[2] * return out, outvel */ - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2383, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_verbose); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2469, __pyx_L1_error) if (__pyx_t_6) { - /* "collisions.py":2384 + /* "collisions.py":2470 * self.x, self.y = out.x, out.y * if verbose: * return out, outvel, o[2] # <<<<<<<<<<<<<< @@ -78556,24 +81584,24 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_8handleCollisionsVel(CYTHON * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_o, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2384, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_o, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2384, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_out); __Pyx_GIVEREF(__pyx_v_out); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_out)) __PYX_ERR(0, 2384, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_out)) __PYX_ERR(0, 2470, __pyx_L1_error); __Pyx_INCREF(__pyx_v_outvel); __Pyx_GIVEREF(__pyx_v_outvel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_outvel)) __PYX_ERR(0, 2384, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_outvel)) __PYX_ERR(0, 2470, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_5)) __PYX_ERR(0, 2384, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_5)) __PYX_ERR(0, 2470, __pyx_L1_error); __pyx_t_5 = 0; __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2383 + /* "collisions.py":2469 * if replaceSelf: * self.x, self.y = out.x, out.y * if verbose: # <<<<<<<<<<<<<< @@ -78582,7 +81610,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_8handleCollisionsVel(CYTHON */ } - /* "collisions.py":2385 + /* "collisions.py":2471 * if verbose: * return out, outvel, o[2] * return out, outvel # <<<<<<<<<<<<<< @@ -78590,19 +81618,19 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_8handleCollisionsVel(CYTHON * def _containsPoint(self, point: Point) -> bool: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2385, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_out); __Pyx_GIVEREF(__pyx_v_out); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_out)) __PYX_ERR(0, 2385, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_out)) __PYX_ERR(0, 2471, __pyx_L1_error); __Pyx_INCREF(__pyx_v_outvel); __Pyx_GIVEREF(__pyx_v_outvel); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_outvel)) __PYX_ERR(0, 2385, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_outvel)) __PYX_ERR(0, 2471, __pyx_L1_error); __pyx_r = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2353 + /* "collisions.py":2439 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< @@ -78628,7 +81656,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_8handleCollisionsVel(CYTHON return __pyx_r; } -/* "collisions.py":2387 +/* "collisions.py":2473 * return out, outvel * * def _containsPoint(self, point: Point) -> bool: # <<<<<<<<<<<<<< @@ -78692,7 +81720,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2387, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2473, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -78700,14 +81728,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2387, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2473, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_containsPoint", 1, 2, 2, 1); __PYX_ERR(0, 2387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_containsPoint", 1, 2, 2, 1); __PYX_ERR(0, 2473, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_containsPoint") < 0)) __PYX_ERR(0, 2387, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_containsPoint") < 0)) __PYX_ERR(0, 2473, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -78720,7 +81748,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_containsPoint", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2387, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_containsPoint", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2473, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -78761,7 +81789,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_10_containsPoint(CYTHON_UNU int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_containsPoint", 1); - /* "collisions.py":2388 + /* "collisions.py":2474 * * def _containsPoint(self, point: Point) -> bool: * return self._collides(point) and self.whereCollides(point) == [] # <<<<<<<<<<<<<< @@ -78769,7 +81797,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_10_containsPoint(CYTHON_UNU * def _contains(self, othershape: Shape) -> bool: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2388, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -78789,11 +81817,11 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_10_containsPoint(CYTHON_UNU PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_point}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2388, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2388, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2474, __pyx_L1_error) if (__pyx_t_6) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { @@ -78802,7 +81830,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_10_containsPoint(CYTHON_UNU __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L3_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2388, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -78822,13 +81850,13 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_10_containsPoint(CYTHON_UNU PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_point}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2388, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2388, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2388, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2474, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_INCREF(__pyx_t_4); @@ -78839,7 +81867,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_10_containsPoint(CYTHON_UNU __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2387 + /* "collisions.py":2473 * return out, outvel * * def _containsPoint(self, point: Point) -> bool: # <<<<<<<<<<<<<< @@ -78861,7 +81889,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_10_containsPoint(CYTHON_UNU return __pyx_r; } -/* "collisions.py":2390 +/* "collisions.py":2476 * return self._collides(point) and self.whereCollides(point) == [] * * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< @@ -78925,7 +81953,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2390, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2476, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -78933,14 +81961,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2390, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2476, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, 1); __PYX_ERR(0, 2390, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, 1); __PYX_ERR(0, 2476, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_contains") < 0)) __PYX_ERR(0, 2390, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_contains") < 0)) __PYX_ERR(0, 2476, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -78953,7 +81981,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2390, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_contains", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2476, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -78981,7 +82009,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10collisions_11ClosedShape_9_contains_2generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "collisions.py":2398 +/* "collisions.py":2484 * return self._collides(othershape) and self.whereCollides(othershape) == [] * if checkShpType(othershape, ShpGroups.CLOSED): * return all(self._contains(Point(*p)) for p in othershape.toPoints()) # <<<<<<<<<<<<<< @@ -78990,29 +82018,29 @@ static PyObject *__pyx_gb_10collisions_11ClosedShape_9_contains_2generator8(__py */ static PyObject *__pyx_pf_10collisions_11ClosedShape_9_contains_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10collisions___pyx_scope_struct_19_genexpr *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_20_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_19_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_19_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_19_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_20_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_20_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_20_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_19_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_20_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2398, __pyx_L1_error) + __PYX_ERR(0, 2484, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_18__contains *) __pyx_self; + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_19__contains *) __pyx_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_11ClosedShape_9_contains_2generator8, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ClosedShape__contains_locals_gen, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 2398, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_11ClosedShape_9_contains_2generator8, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ClosedShape__contains_locals_gen, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 2484, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -79030,7 +82058,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_9_contains_genexpr(PyObject static PyObject *__pyx_gb_10collisions_11ClosedShape_9_contains_2generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10collisions___pyx_scope_struct_19_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_19_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10collisions___pyx_scope_struct_20_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_20_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -79055,16 +82083,16 @@ static PyObject *__pyx_gb_10collisions_11ClosedShape_9_contains_2generator8(__py return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2398, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2398, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2484, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2484, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2398, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2398, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2484, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -79072,28 +82100,28 @@ static PyObject *__pyx_gb_10collisions_11ClosedShape_9_contains_2generator8(__py { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2398, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2484, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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_ERR(0, 2398, __pyx_L1_error) + __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_ERR(0, 2484, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2398, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2398, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2484, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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_ERR(0, 2398, __pyx_L1_error) + __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_ERR(0, 2484, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2398, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -79103,7 +82131,7 @@ static PyObject *__pyx_gb_10collisions_11ClosedShape_9_contains_2generator8(__py PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2398, __pyx_L1_error) + else __PYX_ERR(0, 2484, __pyx_L1_error) } break; } @@ -79113,14 +82141,14 @@ static PyObject *__pyx_gb_10collisions_11ClosedShape_9_contains_2generator8(__py __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_p, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2398, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_contains); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2398, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2484, __pyx_L1_error) } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_contains); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Point); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2398, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Point); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_p); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2398, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_p); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2398, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -79143,11 +82171,11 @@ static PyObject *__pyx_gb_10collisions_11ClosedShape_9_contains_2generator8(__py __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2398, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 2398, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 2484, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_11 = (!__pyx_t_10); if (__pyx_t_11) { @@ -79189,7 +82217,7 @@ static PyObject *__pyx_gb_10collisions_11ClosedShape_9_contains_2generator8(__py return __pyx_r; } -/* "collisions.py":2390 +/* "collisions.py":2476 * return self._collides(point) and self.whereCollides(point) == [] * * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< @@ -79198,7 +82226,7 @@ static PyObject *__pyx_gb_10collisions_11ClosedShape_9_contains_2generator8(__py */ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { - struct __pyx_obj_10collisions___pyx_scope_struct_18__contains *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_19__contains *__pyx_cur_scope; PyObject *__pyx_gb_10collisions_11ClosedShape_9_contains_2generator8 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -79215,11 +82243,11 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED P const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_contains", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_18__contains *)__pyx_tp_new_10collisions___pyx_scope_struct_18__contains(__pyx_ptype_10collisions___pyx_scope_struct_18__contains, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_19__contains *)__pyx_tp_new_10collisions___pyx_scope_struct_19__contains(__pyx_ptype_10collisions___pyx_scope_struct_19__contains, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_18__contains *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_19__contains *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2390, __pyx_L1_error) + __PYX_ERR(0, 2476, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -79227,18 +82255,18 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED P __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); - /* "collisions.py":2391 + /* "collisions.py":2477 * * def _contains(self, othershape: Shape) -> bool: * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< * return self._containsPoint(othershape) * if checkShpType(othershape, ShpTyps.Line): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2391, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2391, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2391, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -79260,15 +82288,15 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED P __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2391, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2477, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2391, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2477, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2392 + /* "collisions.py":2478 * def _contains(self, othershape: Shape) -> bool: * if checkShpType(othershape, ShpTyps.Point): * return self._containsPoint(othershape) # <<<<<<<<<<<<<< @@ -79276,7 +82304,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED P * return self._contains(Point(*othershape.p1)) and self._contains(Point(*othershape.p2)) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_containsPoint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2392, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_containsPoint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -79296,7 +82324,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED P PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_othershape}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2392, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -79304,7 +82332,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED P __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2391 + /* "collisions.py":2477 * * def _contains(self, othershape: Shape) -> bool: * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< @@ -79313,18 +82341,18 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED P */ } - /* "collisions.py":2393 + /* "collisions.py":2479 * if checkShpType(othershape, ShpTyps.Point): * return self._containsPoint(othershape) * if checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< * return self._contains(Point(*othershape.p1)) and self._contains(Point(*othershape.p2)) * if checkShpType(othershape, ShpTyps.Circle) or checkShpType(othershape, ShpTyps.Arc): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2393, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2393, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2393, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -79346,15 +82374,15 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED P __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2393, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2393, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2479, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2394 + /* "collisions.py":2480 * return self._containsPoint(othershape) * if checkShpType(othershape, ShpTyps.Line): * return self._contains(Point(*othershape.p1)) and self._contains(Point(*othershape.p2)) # <<<<<<<<<<<<<< @@ -79362,16 +82390,16 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED P * return self._collides(othershape) and self.whereCollides(othershape) == [] */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_contains); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2394, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_contains); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2394, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Point); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2394, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2394, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2394, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -79394,11 +82422,11 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED P __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2394, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2394, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2480, __pyx_L1_error) if (__pyx_t_6) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { @@ -79407,16 +82435,16 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED P __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L5_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_contains); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2394, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_contains); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2394, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2394, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2394, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2394, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -79439,7 +82467,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED P __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2394, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -79451,7 +82479,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED P __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2393 + /* "collisions.py":2479 * if checkShpType(othershape, ShpTyps.Point): * return self._containsPoint(othershape) * if checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< @@ -79460,18 +82488,18 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED P */ } - /* "collisions.py":2395 + /* "collisions.py":2481 * if checkShpType(othershape, ShpTyps.Line): * return self._contains(Point(*othershape.p1)) and self._contains(Point(*othershape.p2)) * if checkShpType(othershape, ShpTyps.Circle) or checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< * return self._collides(othershape) and self.whereCollides(othershape) == [] * if checkShpType(othershape, ShpGroups.CLOSED): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2395, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2395, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Circle); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2395, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Circle); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -79493,22 +82521,22 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED P __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2395, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2395, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2481, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (!__pyx_t_9) { } else { __pyx_t_6 = __pyx_t_9; goto __pyx_L8_bool_binop_done; } - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2395, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2395, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_Arc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2395, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_Arc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -79530,17 +82558,17 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED P __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2395, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2395, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2481, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = __pyx_t_9; __pyx_L8_bool_binop_done:; if (__pyx_t_6) { - /* "collisions.py":2396 + /* "collisions.py":2482 * return self._contains(Point(*othershape.p1)) and self._contains(Point(*othershape.p2)) * if checkShpType(othershape, ShpTyps.Circle) or checkShpType(othershape, ShpTyps.Arc): * return self._collides(othershape) and self.whereCollides(othershape) == [] # <<<<<<<<<<<<<< @@ -79548,7 +82576,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED P * return all(self._contains(Point(*p)) for p in othershape.toPoints()) */ __Pyx_XDECREF(__pyx_r); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2396, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; __pyx_t_5 = 0; @@ -79568,11 +82596,11 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED P PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_othershape}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2396, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2396, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2482, __pyx_L1_error) if (__pyx_t_6) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { @@ -79581,7 +82609,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED P __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L10_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2396, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; __pyx_t_5 = 0; @@ -79601,13 +82629,13 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED P PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_othershape}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2396, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2396, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2482, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2396, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2482, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_INCREF(__pyx_t_8); @@ -79618,7 +82646,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED P __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2395 + /* "collisions.py":2481 * if checkShpType(othershape, ShpTyps.Line): * return self._contains(Point(*othershape.p1)) and self._contains(Point(*othershape.p2)) * if checkShpType(othershape, ShpTyps.Circle) or checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< @@ -79627,18 +82655,18 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED P */ } - /* "collisions.py":2397 + /* "collisions.py":2483 * if checkShpType(othershape, ShpTyps.Circle) or checkShpType(othershape, ShpTyps.Arc): * return self._collides(othershape) and self.whereCollides(othershape) == [] * if checkShpType(othershape, ShpGroups.CLOSED): # <<<<<<<<<<<<<< * return all(self._contains(Point(*p)) for p in othershape.toPoints()) * */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2397, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2397, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CLOSED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2397, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CLOSED); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -79660,15 +82688,15 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED P __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2397, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2483, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2397, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2483, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2398 + /* "collisions.py":2484 * return self._collides(othershape) and self.whereCollides(othershape) == [] * if checkShpType(othershape, ShpGroups.CLOSED): * return all(self._contains(Point(*p)) for p in othershape.toPoints()) # <<<<<<<<<<<<<< @@ -79676,7 +82704,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED P * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2398, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_2 = NULL; __pyx_t_5 = 0; @@ -79696,21 +82724,21 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED P PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2398, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __pyx_t_8 = __pyx_pf_10collisions_11ClosedShape_9_contains_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2398, __pyx_L1_error) + __pyx_t_8 = __pyx_pf_10collisions_11ClosedShape_9_contains_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2398, __pyx_L1_error) + __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2397 + /* "collisions.py":2483 * if checkShpType(othershape, ShpTyps.Circle) or checkShpType(othershape, ShpTyps.Arc): * return self._collides(othershape) and self.whereCollides(othershape) == [] * if checkShpType(othershape, ShpGroups.CLOSED): # <<<<<<<<<<<<<< @@ -79719,7 +82747,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED P */ } - /* "collisions.py":2390 + /* "collisions.py":2476 * return self._collides(point) and self.whereCollides(point) == [] * * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< @@ -79747,7 +82775,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED P return __pyx_r; } -/* "collisions.py":2400 +/* "collisions.py":2486 * return all(self._contains(Point(*p)) for p in othershape.toPoints()) * * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< @@ -79755,7 +82783,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_12_contains(CYTHON_UNUSED P * Finds whether a point is on a corner of this shape. */ -static PyObject *__pyx_pf_10collisions_58__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { +static PyObject *__pyx_pf_10collisions_60__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -79765,18 +82793,18 @@ static PyObject *__pyx_pf_10collisions_58__defaults__(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2400, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults20, __pyx_self)->__pyx_arg_precision); - __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults20, __pyx_self)->__pyx_arg_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults20, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 2400, __pyx_L1_error); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2400, __pyx_L1_error) + __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults21, __pyx_self)->__pyx_arg_precision); + __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults21, __pyx_self)->__pyx_arg_precision); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults21, __pyx_self)->__pyx_arg_precision)) __PYX_ERR(0, 2486, __pyx_L1_error); + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 2400, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 2486, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 2400, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None)) __PYX_ERR(0, 2486, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -79835,7 +82863,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_point,&__pyx_n_s_precision,0}; - __pyx_defaults20 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults20, __pyx_self); + __pyx_defaults21 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults21, __pyx_self); values[2] = __Pyx_Arg_NewRef_FASTCALL(__pyx_dynamic_args->__pyx_arg_precision); if (__pyx_kwds) { Py_ssize_t kw_args; @@ -79856,7 +82884,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2400, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2486, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -79864,21 +82892,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2400, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2486, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, 1); __PYX_ERR(0, 2400, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, 1); __PYX_ERR(0, 2486, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_precision); if (value) { values[2] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2400, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2486, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isCorner") < 0)) __PYX_ERR(0, 2400, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "isCorner") < 0)) __PYX_ERR(0, 2486, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -79896,7 +82924,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 2400, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("isCorner", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 2486, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -79941,14 +82969,14 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14isCorner(CYTHON_UNUSED Py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("isCorner", 1); - /* "collisions.py":2411 + /* "collisions.py":2497 * bool: Whether the point is on a corner of this shape * """ * for i in self.toPoints(): # <<<<<<<<<<<<<< * if round(i[0], precision) == round(point[0], precision) and round(i[1], precision) == round(point[1], precision): * return True */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2411, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -79968,7 +82996,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14isCorner(CYTHON_UNUSED Py PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2411, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -79977,9 +83005,9 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14isCorner(CYTHON_UNUSED Py __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2411, __pyx_L1_error) + __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2411, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2497, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -79988,28 +83016,28 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14isCorner(CYTHON_UNUSED Py { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2411, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2497, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 2411, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 2497, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2411, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2411, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2497, __pyx_L1_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 2411, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 2497, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2411, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2497, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -80019,7 +83047,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14isCorner(CYTHON_UNUSED Py PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2411, __pyx_L1_error) + else __PYX_ERR(0, 2497, __pyx_L1_error) } break; } @@ -80028,85 +83056,85 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14isCorner(CYTHON_UNUSED Py __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2412 + /* "collisions.py":2498 * """ * for i in self.toPoints(): * if round(i[0], precision) == round(point[0], precision) and round(i[1], precision) == round(point[1], precision): # <<<<<<<<<<<<<< * return True * return False */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2412, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2412, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 2412, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 2498, __pyx_L1_error); __Pyx_INCREF(__pyx_v_precision); __Pyx_GIVEREF(__pyx_v_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_precision)) __PYX_ERR(0, 2412, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_precision)) __PYX_ERR(0, 2498, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2412, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2412, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2412, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3)) __PYX_ERR(0, 2412, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3)) __PYX_ERR(0, 2498, __pyx_L1_error); __Pyx_INCREF(__pyx_v_precision); __Pyx_GIVEREF(__pyx_v_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_precision)) __PYX_ERR(0, 2412, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_precision)) __PYX_ERR(0, 2498, __pyx_L1_error); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2412, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2412, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2498, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2412, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2498, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_9) { } else { __pyx_t_7 = __pyx_t_9; goto __pyx_L6_bool_binop_done; } - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2412, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2412, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8)) __PYX_ERR(0, 2412, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8)) __PYX_ERR(0, 2498, __pyx_L1_error); __Pyx_INCREF(__pyx_v_precision); __Pyx_GIVEREF(__pyx_v_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_precision)) __PYX_ERR(0, 2412, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_precision)) __PYX_ERR(0, 2498, __pyx_L1_error); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2412, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_point, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2412, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_point, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2412, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 2412, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 2498, __pyx_L1_error); __Pyx_INCREF(__pyx_v_precision); __Pyx_GIVEREF(__pyx_v_precision); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_precision)) __PYX_ERR(0, 2412, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_precision)) __PYX_ERR(0, 2498, __pyx_L1_error); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2412, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyObject_RichCompare(__pyx_t_8, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2412, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_t_8, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2498, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2412, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2498, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_7 = __pyx_t_9; __pyx_L6_bool_binop_done:; if (__pyx_t_7) { - /* "collisions.py":2413 + /* "collisions.py":2499 * for i in self.toPoints(): * if round(i[0], precision) == round(point[0], precision) and round(i[1], precision) == round(point[1], precision): * return True # <<<<<<<<<<<<<< @@ -80119,7 +83147,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14isCorner(CYTHON_UNUSED Py __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":2412 + /* "collisions.py":2498 * """ * for i in self.toPoints(): * if round(i[0], precision) == round(point[0], precision) and round(i[1], precision) == round(point[1], precision): # <<<<<<<<<<<<<< @@ -80128,7 +83156,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14isCorner(CYTHON_UNUSED Py */ } - /* "collisions.py":2411 + /* "collisions.py":2497 * bool: Whether the point is on a corner of this shape * """ * for i in self.toPoints(): # <<<<<<<<<<<<<< @@ -80138,7 +83166,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14isCorner(CYTHON_UNUSED Py } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2414 + /* "collisions.py":2500 * if round(i[0], precision) == round(point[0], precision) and round(i[1], precision) == round(point[1], precision): * return True * return False # <<<<<<<<<<<<<< @@ -80150,7 +83178,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14isCorner(CYTHON_UNUSED Py __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":2400 + /* "collisions.py":2486 * return all(self._contains(Point(*p)) for p in othershape.toPoints()) * * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< @@ -80173,7 +83201,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_14isCorner(CYTHON_UNUSED Py return __pyx_r; } -/* "collisions.py":2416 +/* "collisions.py":2502 * return False * * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< @@ -80235,12 +83263,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2416, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2502, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toLines") < 0)) __PYX_ERR(0, 2416, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toLines") < 0)) __PYX_ERR(0, 2502, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -80251,7 +83279,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("toLines", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2416, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("toLines", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2502, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -80287,7 +83315,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_16toLines(CYTHON_UNUSED PyO int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toLines", 1); - /* "collisions.py":2421 + /* "collisions.py":2507 * Iterable[Line]: Get a list of all the Lines that make up this object * """ * return [] # <<<<<<<<<<<<<< @@ -80295,13 +83323,13 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_16toLines(CYTHON_UNUSED PyO * def toPoints(self) -> Iterable[pointLike]: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2421, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2416 + /* "collisions.py":2502 * return False * * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< @@ -80320,7 +83348,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_16toLines(CYTHON_UNUSED PyO return __pyx_r; } -/* "collisions.py":2423 +/* "collisions.py":2509 * return [] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -80382,12 +83410,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2423, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2509, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toPoints") < 0)) __PYX_ERR(0, 2423, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toPoints") < 0)) __PYX_ERR(0, 2509, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -80398,7 +83426,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("toPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2423, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("toPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2509, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -80434,7 +83462,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_18toPoints(CYTHON_UNUSED Py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toPoints", 1); - /* "collisions.py":2428 + /* "collisions.py":2514 * Iterable[pointLike]: Get a list of all the Points that make up this object * """ * return [] # <<<<<<<<<<<<<< @@ -80442,13 +83470,13 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_18toPoints(CYTHON_UNUSED Py * def __getitem__(self, item: int) -> pointLike: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2428, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2423 + /* "collisions.py":2509 * return [] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -80467,7 +83495,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_18toPoints(CYTHON_UNUSED Py return __pyx_r; } -/* "collisions.py":2430 +/* "collisions.py":2516 * return [] * * def __getitem__(self, item: int) -> pointLike: # <<<<<<<<<<<<<< @@ -80531,7 +83559,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2430, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2516, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -80539,14 +83567,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2430, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2516, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 2430, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 2516, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__getitem__") < 0)) __PYX_ERR(0, 2430, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__getitem__") < 0)) __PYX_ERR(0, 2516, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -80559,7 +83587,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2430, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2516, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -80573,7 +83601,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_item), (&PyInt_Type), 0, "item", 1))) __PYX_ERR(0, 2430, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_item), (&PyInt_Type), 0, "item", 1))) __PYX_ERR(0, 2516, __pyx_L1_error) __pyx_r = __pyx_pf_10collisions_11ClosedShape_20__getitem__(__pyx_self, __pyx_v_self, __pyx_v_item); /* function exit code */ @@ -80603,7 +83631,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_20__getitem__(CYTHON_UNUSED int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__getitem__", 1); - /* "collisions.py":2431 + /* "collisions.py":2517 * * def __getitem__(self, item: int) -> pointLike: * return self.toPoints()[item] # <<<<<<<<<<<<<< @@ -80611,7 +83639,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_20__getitem__(CYTHON_UNUSED * def __iter__(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2431, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -80631,18 +83659,18 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_20__getitem__(CYTHON_UNUSED PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2431, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2431, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":2430 + /* "collisions.py":2516 * return [] * * def __getitem__(self, item: int) -> pointLike: # <<<<<<<<<<<<<< @@ -80663,7 +83691,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_20__getitem__(CYTHON_UNUSED return __pyx_r; } -/* "collisions.py":2433 +/* "collisions.py":2519 * return self.toPoints()[item] * * def __iter__(self): # <<<<<<<<<<<<<< @@ -80724,12 +83752,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2433, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2519, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__iter__") < 0)) __PYX_ERR(0, 2433, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__iter__") < 0)) __PYX_ERR(0, 2519, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -80740,7 +83768,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2433, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__iter__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2519, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -80779,7 +83807,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_22__iter__(CYTHON_UNUSED Py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__iter__", 1); - /* "collisions.py":2434 + /* "collisions.py":2520 * * def __iter__(self): * return iter(self.toPoints()) # <<<<<<<<<<<<<< @@ -80787,7 +83815,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_22__iter__(CYTHON_UNUSED Py * def __str__(self): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2434, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -80807,18 +83835,18 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_22__iter__(CYTHON_UNUSED Py PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2434, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2434, __pyx_L1_error) + __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":2433 + /* "collisions.py":2519 * return self.toPoints()[item] * * def __iter__(self): # <<<<<<<<<<<<<< @@ -80839,7 +83867,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_22__iter__(CYTHON_UNUSED Py return __pyx_r; } -/* "collisions.py":2436 +/* "collisions.py":2522 * return iter(self.toPoints()) * * def __str__(self): # <<<<<<<<<<<<<< @@ -80900,12 +83928,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2436, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2522, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 2436, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 2522, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -80916,7 +83944,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2436, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2522, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -80948,7 +83976,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_24__str__(CYTHON_UNUSED PyO __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext("__str__", 1); - /* "collisions.py":2437 + /* "collisions.py":2523 * * def __str__(self): * return '' # <<<<<<<<<<<<<< @@ -80960,7 +83988,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_24__str__(CYTHON_UNUSED PyO __pyx_r = __pyx_kp_u_Closed_Shape; goto __pyx_L0; - /* "collisions.py":2436 + /* "collisions.py":2522 * return iter(self.toPoints()) * * def __str__(self): # <<<<<<<<<<<<<< @@ -80975,7 +84003,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_24__str__(CYTHON_UNUSED PyO return __pyx_r; } -/* "collisions.py":2442 +/* "collisions.py":2528 * """A Rectangle. It is defined with an x, y, width and height.""" * TYPE = ShpTyps.Rect * def __init__(self, x: Number, y: Number, w: Number, h: Number, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< @@ -80983,7 +84011,7 @@ static PyObject *__pyx_pf_10collisions_11ClosedShape_24__str__(CYTHON_UNUSED PyO * Args: */ -static PyObject *__pyx_pf_10collisions_60__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { +static PyObject *__pyx_pf_10collisions_62__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -80993,20 +84021,20 @@ static PyObject *__pyx_pf_10collisions_60__defaults__(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults21, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2442, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults22, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2442, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 2442, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 2528, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2442, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 2442, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 2528, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None)) __PYX_ERR(0, 2442, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None)) __PYX_ERR(0, 2528, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -81068,7 +84096,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_w,&__pyx_n_s_h,&__pyx_n_s_bounciness,0}; - __pyx_defaults21 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults21, __pyx_self); + __pyx_defaults22 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults22, __pyx_self); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -81094,7 +84122,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2442, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2528, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -81102,9 +84130,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2442, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2528, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 6, 1); __PYX_ERR(0, 2442, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 6, 1); __PYX_ERR(0, 2528, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -81112,9 +84140,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2442, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2528, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 6, 2); __PYX_ERR(0, 2442, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 6, 2); __PYX_ERR(0, 2528, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: @@ -81122,9 +84150,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2442, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2528, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 6, 3); __PYX_ERR(0, 2442, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 6, 3); __PYX_ERR(0, 2528, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: @@ -81132,21 +84160,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2442, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2528, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 6, 4); __PYX_ERR(0, 2442, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 6, 4); __PYX_ERR(0, 2528, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bounciness); if (value) { values[5] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2442, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2528, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 2442, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 2528, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -81167,14 +84195,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_v_w = values[3]; __pyx_v_h = values[4]; if (values[5]) { - __pyx_v_bounciness = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_bounciness == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2442, __pyx_L3_error) + __pyx_v_bounciness = __pyx_PyFloat_AsDouble(values[5]); if (unlikely((__pyx_v_bounciness == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2528, __pyx_L3_error) } else { __pyx_v_bounciness = __pyx_dynamic_args->__pyx_arg_bounciness; } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 6, __pyx_nargs); __PYX_ERR(0, 2442, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 5, 6, __pyx_nargs); __PYX_ERR(0, 2528, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -81214,7 +84242,7 @@ static PyObject *__pyx_pf_10collisions_4Rect___init__(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); - /* "collisions.py":2451 + /* "collisions.py":2537 * bounciness (float, optional): How bouncy this object is. 1 = rebounds perfectly, <1 = eventually will stop, >1 = will bounce more each time. Defaults to 0.7. * """ * super().__init__(bounciness) # <<<<<<<<<<<<<< @@ -81222,23 +84250,23 @@ static PyObject *__pyx_pf_10collisions_4Rect___init__(CYTHON_UNUSED PyObject *__ * */ __pyx_t_2 = __Pyx_CyFunction_GetClassObj(__pyx_self); - if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 2451, __pyx_L1_error) } + if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 2537, __pyx_L1_error) } __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2451, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 2451, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 2537, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(0, 2451, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(0, 2537, __pyx_L1_error); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2451, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2451, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2451, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -81259,13 +84287,13 @@ static PyObject *__pyx_pf_10collisions_4Rect___init__(CYTHON_UNUSED PyObject *__ __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2451, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2452 + /* "collisions.py":2538 * """ * super().__init__(bounciness) * self.x, self.y, self.w, self.h = x, y, w, h # <<<<<<<<<<<<<< @@ -81280,16 +84308,16 @@ static PyObject *__pyx_pf_10collisions_4Rect___init__(CYTHON_UNUSED PyObject *__ __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = __pyx_v_h; __Pyx_INCREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_1) < 0) __PYX_ERR(0, 2452, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_1) < 0) __PYX_ERR(0, 2538, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_3) < 0) __PYX_ERR(0, 2452, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_3) < 0) __PYX_ERR(0, 2538, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_w, __pyx_t_2) < 0) __PYX_ERR(0, 2452, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_w, __pyx_t_2) < 0) __PYX_ERR(0, 2538, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_h, __pyx_t_4) < 0) __PYX_ERR(0, 2452, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_h, __pyx_t_4) < 0) __PYX_ERR(0, 2538, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2442 + /* "collisions.py":2528 * """A Rectangle. It is defined with an x, y, width and height.""" * TYPE = ShpTyps.Rect * def __init__(self, x: Number, y: Number, w: Number, h: Number, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< @@ -81313,7 +84341,7 @@ static PyObject *__pyx_pf_10collisions_4Rect___init__(CYTHON_UNUSED PyObject *__ return __pyx_r; } -/* "collisions.py":2454 +/* "collisions.py":2540 * self.x, self.y, self.w, self.h = x, y, w, h * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< @@ -81375,12 +84403,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2454, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2540, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rect") < 0)) __PYX_ERR(0, 2454, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rect") < 0)) __PYX_ERR(0, 2540, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -81391,7 +84419,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2454, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2540, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -81434,7 +84462,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_2rect(CYTHON_UNUSED PyObject *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rect", 1); - /* "collisions.py":2461 + /* "collisions.py":2547 * Iterable[Number]: (min x, min y, max x, max y) * """ * return min(self.x, self.x + self.w), min(self.y, self.y + self.h), max(self.x, self.x + self.w), max(self.y, self.y + self.h) # <<<<<<<<<<<<<< @@ -81442,18 +84470,18 @@ static PyObject *__pyx_pf_10collisions_4Rect_2rect(CYTHON_UNUSED PyObject *__pyx * def area(self) -> Number: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2461, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2461, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2461, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2461, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2461, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2461, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2547, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2547, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_5) { __Pyx_INCREF(__pyx_t_3); @@ -81464,18 +84492,18 @@ static PyObject *__pyx_pf_10collisions_4Rect_2rect(CYTHON_UNUSED PyObject *__pyx } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2461, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2461, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2461, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2461, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2461, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2461, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2547, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2547, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (__pyx_t_5) { __Pyx_INCREF(__pyx_t_4); @@ -81486,18 +84514,18 @@ static PyObject *__pyx_pf_10collisions_4Rect_2rect(CYTHON_UNUSED PyObject *__pyx } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2461, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2461, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2461, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2461, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2461, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2461, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2547, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2547, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (__pyx_t_5) { __Pyx_INCREF(__pyx_t_6); @@ -81508,18 +84536,18 @@ static PyObject *__pyx_pf_10collisions_4Rect_2rect(CYTHON_UNUSED PyObject *__pyx } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2461, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2461, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2461, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2461, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = PyObject_RichCompare(__pyx_t_7, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2461, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2461, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_t_7, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2547, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2547, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_5) { __Pyx_INCREF(__pyx_t_7); @@ -81530,20 +84558,20 @@ static PyObject *__pyx_pf_10collisions_4Rect_2rect(CYTHON_UNUSED PyObject *__pyx } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2461, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1)) __PYX_ERR(0, 2461, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1)) __PYX_ERR(0, 2547, __pyx_L1_error); __Pyx_INCREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3)) __PYX_ERR(0, 2461, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3)) __PYX_ERR(0, 2547, __pyx_L1_error); __Pyx_INCREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_4)) __PYX_ERR(0, 2461, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_4)) __PYX_ERR(0, 2547, __pyx_L1_error); __Pyx_INCREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_6)) __PYX_ERR(0, 2461, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 3, __pyx_t_6)) __PYX_ERR(0, 2547, __pyx_L1_error); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -81552,7 +84580,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_2rect(CYTHON_UNUSED PyObject *__pyx __pyx_t_7 = 0; goto __pyx_L0; - /* "collisions.py":2454 + /* "collisions.py":2540 * self.x, self.y, self.w, self.h = x, y, w, h * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< @@ -81577,7 +84605,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_2rect(CYTHON_UNUSED PyObject *__pyx return __pyx_r; } -/* "collisions.py":2463 +/* "collisions.py":2549 * return min(self.x, self.x + self.w), min(self.y, self.y + self.h), max(self.x, self.x + self.w), max(self.y, self.y + self.h) * * def area(self) -> Number: # <<<<<<<<<<<<<< @@ -81639,12 +84667,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2463, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2549, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "area") < 0)) __PYX_ERR(0, 2463, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "area") < 0)) __PYX_ERR(0, 2549, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -81655,7 +84683,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2463, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2549, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -81693,7 +84721,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_4area(CYTHON_UNUSED PyObject *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("area", 1); - /* "collisions.py":2470 + /* "collisions.py":2556 * Number: self.w * self.h * """ * return self.w * self.h # <<<<<<<<<<<<<< @@ -81701,11 +84729,11 @@ static PyObject *__pyx_pf_10collisions_4Rect_4area(CYTHON_UNUSED PyObject *__pyx * def _containsPoint(self, point: Point) -> bool: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2470, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2470, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2556, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2470, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2556, __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; @@ -81713,7 +84741,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_4area(CYTHON_UNUSED PyObject *__pyx __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2463 + /* "collisions.py":2549 * return min(self.x, self.x + self.w), min(self.y, self.y + self.h), max(self.x, self.x + self.w), max(self.y, self.y + self.h) * * def area(self) -> Number: # <<<<<<<<<<<<<< @@ -81734,7 +84762,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_4area(CYTHON_UNUSED PyObject *__pyx return __pyx_r; } -/* "collisions.py":2472 +/* "collisions.py":2558 * return self.w * self.h * * def _containsPoint(self, point: Point) -> bool: # <<<<<<<<<<<<<< @@ -81798,7 +84826,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2472, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2558, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -81806,14 +84834,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2472, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2558, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_containsPoint", 1, 2, 2, 1); __PYX_ERR(0, 2472, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_containsPoint", 1, 2, 2, 1); __PYX_ERR(0, 2558, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_containsPoint") < 0)) __PYX_ERR(0, 2472, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_containsPoint") < 0)) __PYX_ERR(0, 2558, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -81826,7 +84854,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_containsPoint", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2472, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_containsPoint", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2558, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -81874,14 +84902,14 @@ static PyObject *__pyx_pf_10collisions_4Rect_6_containsPoint(CYTHON_UNUSED PyObj int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_containsPoint", 1); - /* "collisions.py":2473 + /* "collisions.py":2559 * * def _containsPoint(self, point: Point) -> bool: * x, y, mx, my = self.rect() # <<<<<<<<<<<<<< * return x < point.x < mx and y < point.y and my > point.y * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2473, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -81901,7 +84929,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_6_containsPoint(CYTHON_UNUSED PyObj PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2473, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -81911,7 +84939,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_6_containsPoint(CYTHON_UNUSED PyObj if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 2473, __pyx_L1_error) + __PYX_ERR(0, 2559, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -81934,7 +84962,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_6_containsPoint(CYTHON_UNUSED PyObj Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_5,&__pyx_t_6}; for (i=0; i < 4; i++) { - PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 2473, __pyx_L1_error) + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 2559, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } @@ -81944,7 +84972,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_6_containsPoint(CYTHON_UNUSED PyObj } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_5,&__pyx_t_6}; - __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2473, __pyx_L1_error) + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); @@ -81953,7 +84981,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_6_containsPoint(CYTHON_UNUSED PyObj __Pyx_GOTREF(item); *(temps[index]) = item; } - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 4) < 0) __PYX_ERR(0, 2473, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 4) < 0) __PYX_ERR(0, 2559, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L4_unpacking_done; @@ -81961,7 +84989,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_6_containsPoint(CYTHON_UNUSED PyObj __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 2473, __pyx_L1_error) + __PYX_ERR(0, 2559, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_x = __pyx_t_2; @@ -81973,7 +85001,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_6_containsPoint(CYTHON_UNUSED PyObj __pyx_v_my = __pyx_t_6; __pyx_t_6 = 0; - /* "collisions.py":2474 + /* "collisions.py":2560 * def _containsPoint(self, point: Point) -> bool: * x, y, mx, my = self.rect() * return x < point.x < mx and y < point.y and my > point.y # <<<<<<<<<<<<<< @@ -81981,15 +85009,15 @@ static PyObject *__pyx_pf_10collisions_4Rect_6_containsPoint(CYTHON_UNUSED PyObj * def _collides(self, othershape: Shape) -> bool: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_point, __pyx_n_s_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2474, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_point, __pyx_n_s_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_x, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2474, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_v_x, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2560, __pyx_L1_error) if (__Pyx_PyObject_IsTrue(__pyx_t_5)) { __Pyx_DECREF(__pyx_t_5); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_v_mx, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2474, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_v_mx, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2560, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2474, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2560, __pyx_L1_error) if (__pyx_t_9) { __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { @@ -81998,11 +85026,11 @@ static PyObject *__pyx_pf_10collisions_4Rect_6_containsPoint(CYTHON_UNUSED PyObj __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L5_bool_binop_done; } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_point, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2474, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_point, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_RichCompare(__pyx_v_y, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2474, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_y, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2560, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2474, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2560, __pyx_L1_error) if (__pyx_t_9) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { @@ -82011,9 +85039,9 @@ static PyObject *__pyx_pf_10collisions_4Rect_6_containsPoint(CYTHON_UNUSED PyObj __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L5_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_point, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2474, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_point, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_my, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2474, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_v_my, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2560, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = __pyx_t_5; @@ -82023,7 +85051,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_6_containsPoint(CYTHON_UNUSED PyObj __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2472 + /* "collisions.py":2558 * return self.w * self.h * * def _containsPoint(self, point: Point) -> bool: # <<<<<<<<<<<<<< @@ -82051,7 +85079,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_6_containsPoint(CYTHON_UNUSED PyObj return __pyx_r; } -/* "collisions.py":2476 +/* "collisions.py":2562 * return x < point.x < mx and y < point.y and my > point.y * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< @@ -82115,7 +85143,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2476, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2562, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -82123,14 +85151,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2476, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2562, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 2476, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 2562, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_collides") < 0)) __PYX_ERR(0, 2476, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_collides") < 0)) __PYX_ERR(0, 2562, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -82143,7 +85171,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2476, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2562, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -82171,7 +85199,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10collisions_4Rect_9_collides_2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "collisions.py":2496 +/* "collisions.py":2582 * ) * if checkShpType(othershape, ShpTyps.Arc): * if any(self._collides(Point(*i)) for i in othershape.endPoints()): # <<<<<<<<<<<<<< @@ -82180,29 +85208,29 @@ static PyObject *__pyx_gb_10collisions_4Rect_9_collides_2generator9(__pyx_Corout */ static PyObject *__pyx_pf_10collisions_4Rect_9_collides_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10collisions___pyx_scope_struct_21_genexpr *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_22_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_21_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_21_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_21_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_22_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_22_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_22_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_21_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_22_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2496, __pyx_L1_error) + __PYX_ERR(0, 2582, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_20__collides *) __pyx_self; + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_21__collides *) __pyx_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_4Rect_9_collides_2generator9, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Rect__collides_locals_genexpr, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 2496, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_4Rect_9_collides_2generator9, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Rect__collides_locals_genexpr, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 2582, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -82220,7 +85248,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_9_collides_genexpr(PyObject *__pyx_ static PyObject *__pyx_gb_10collisions_4Rect_9_collides_2generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10collisions___pyx_scope_struct_21_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_21_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10collisions___pyx_scope_struct_22_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_22_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -82244,16 +85272,16 @@ static PyObject *__pyx_gb_10collisions_4Rect_9_collides_2generator9(__pyx_Corout return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2496, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2496, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2582, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2582, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2496, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2496, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2582, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -82261,28 +85289,28 @@ static PyObject *__pyx_gb_10collisions_4Rect_9_collides_2generator9(__pyx_Corout { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2496, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2582, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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_ERR(0, 2496, __pyx_L1_error) + __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_ERR(0, 2582, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2496, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2496, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2582, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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_ERR(0, 2496, __pyx_L1_error) + __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_ERR(0, 2582, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2496, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -82292,7 +85320,7 @@ static PyObject *__pyx_gb_10collisions_4Rect_9_collides_2generator9(__pyx_Corout PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2496, __pyx_L1_error) + else __PYX_ERR(0, 2582, __pyx_L1_error) } break; } @@ -82302,14 +85330,14 @@ static PyObject *__pyx_gb_10collisions_4Rect_9_collides_2generator9(__pyx_Corout __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2496, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2496, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2582, __pyx_L1_error) } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Point); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2496, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Point); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2496, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2496, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -82332,11 +85360,11 @@ static PyObject *__pyx_gb_10collisions_4Rect_9_collides_2generator9(__pyx_Corout __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2496, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 2496, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 2582, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_10) { __Pyx_XDECREF(__pyx_r); @@ -82377,7 +85405,7 @@ static PyObject *__pyx_gb_10collisions_4Rect_9_collides_2generator9(__pyx_Corout return __pyx_r; } -/* "collisions.py":2476 +/* "collisions.py":2562 * return x < point.x < mx and y < point.y and my > point.y * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< @@ -82386,7 +85414,7 @@ static PyObject *__pyx_gb_10collisions_4Rect_9_collides_2generator9(__pyx_Corout */ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { - struct __pyx_obj_10collisions___pyx_scope_struct_20__collides *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_21__collides *__pyx_cur_scope; PyObject *__pyx_v_x = NULL; PyObject *__pyx_v_y = NULL; PyObject *__pyx_v_mx = NULL; @@ -82415,11 +85443,11 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_collides", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_20__collides *)__pyx_tp_new_10collisions___pyx_scope_struct_20__collides(__pyx_ptype_10collisions___pyx_scope_struct_20__collides, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_21__collides *)__pyx_tp_new_10collisions___pyx_scope_struct_21__collides(__pyx_ptype_10collisions___pyx_scope_struct_21__collides, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_20__collides *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_21__collides *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2476, __pyx_L1_error) + __PYX_ERR(0, 2562, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -82427,14 +85455,14 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); - /* "collisions.py":2477 + /* "collisions.py":2563 * * def _collides(self, othershape: Shape) -> bool: * x, y, mx, my = self.rect() # <<<<<<<<<<<<<< * if checkShpType(othershape, ShpTyps.Point): * return x <= othershape.x <= mx and y <= othershape.y and my >= othershape.y */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2477, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -82454,7 +85482,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2477, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -82464,7 +85492,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 2477, __pyx_L1_error) + __PYX_ERR(0, 2563, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -82487,7 +85515,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_5,&__pyx_t_6}; for (i=0; i < 4; i++) { - PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 2477, __pyx_L1_error) + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 2563, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } @@ -82497,7 +85525,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_5,&__pyx_t_6}; - __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2477, __pyx_L1_error) + __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2563, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); @@ -82506,7 +85534,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * __Pyx_GOTREF(item); *(temps[index]) = item; } - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 4) < 0) __PYX_ERR(0, 2477, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 4) < 0) __PYX_ERR(0, 2563, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L4_unpacking_done; @@ -82514,7 +85542,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 2477, __pyx_L1_error) + __PYX_ERR(0, 2563, __pyx_L1_error) __pyx_L4_unpacking_done:; } __pyx_v_x = __pyx_t_2; @@ -82526,18 +85554,18 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * __pyx_v_my = __pyx_t_6; __pyx_t_6 = 0; - /* "collisions.py":2478 + /* "collisions.py":2564 * def _collides(self, othershape: Shape) -> bool: * x, y, mx, my = self.rect() * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< * return x <= othershape.x <= mx and y <= othershape.y and my >= othershape.y * if checkShpType(othershape, ShpTyps.Line): */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2478, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2478, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2478, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -82559,15 +85587,15 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2478, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2478, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2564, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_9) { - /* "collisions.py":2479 + /* "collisions.py":2565 * x, y, mx, my = self.rect() * if checkShpType(othershape, ShpTyps.Point): * return x <= othershape.x <= mx and y <= othershape.y and my >= othershape.y # <<<<<<<<<<<<<< @@ -82575,15 +85603,15 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * * return self.check_rects(othershape) and ( */ __Pyx_XDECREF(__pyx_r); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2479, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_x, __pyx_t_6, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2479, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_x, __pyx_t_6, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2565, __pyx_L1_error) if (__Pyx_PyObject_IsTrue(__pyx_t_3)) { __Pyx_DECREF(__pyx_t_3); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_v_mx, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2479, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_6, __pyx_v_mx, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2565, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2479, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2565, __pyx_L1_error) if (__pyx_t_9) { __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { @@ -82592,11 +85620,11 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L6_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2479, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyObject_RichCompare(__pyx_v_y, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2479, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_v_y, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2565, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2479, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2565, __pyx_L1_error) if (__pyx_t_9) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { @@ -82605,9 +85633,9 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; goto __pyx_L6_bool_binop_done; } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2479, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_my, __pyx_t_6, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2479, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_my, __pyx_t_6, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2565, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = __pyx_t_3; @@ -82617,7 +85645,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2478 + /* "collisions.py":2564 * def _collides(self, othershape: Shape) -> bool: * x, y, mx, my = self.rect() * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< @@ -82626,18 +85654,18 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * */ } - /* "collisions.py":2480 + /* "collisions.py":2566 * if checkShpType(othershape, ShpTyps.Point): * return x <= othershape.x <= mx and y <= othershape.y and my >= othershape.y * if checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< * return self.check_rects(othershape) and ( * (x < othershape.p1[0] and mx > othershape.p1[0] and y < othershape.p1[1] and my > othershape.p1[1]) or \ */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2480, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2480, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_Line); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2480, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_Line); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -82659,15 +85687,15 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2480, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2566, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2480, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2566, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_9) { - /* "collisions.py":2481 + /* "collisions.py":2567 * return x <= othershape.x <= mx and y <= othershape.y and my >= othershape.y * if checkShpType(othershape, ShpTyps.Line): * return self.check_rects(othershape) and ( # <<<<<<<<<<<<<< @@ -82675,7 +85703,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * * (x < othershape.p2[0] and mx > othershape.p2[0] and y < othershape.p2[1] and my > othershape.p2[1]) or \ */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_check_rects); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2481, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_check_rects); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_4 = 0; @@ -82695,11 +85723,11 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_othershape}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2481, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2481, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2567, __pyx_L1_error) if (__pyx_t_9) { __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { @@ -82709,60 +85737,60 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * goto __pyx_L10_bool_binop_done; } - /* "collisions.py":2482 + /* "collisions.py":2568 * if checkShpType(othershape, ShpTyps.Line): * return self.check_rects(othershape) and ( * (x < othershape.p1[0] and mx > othershape.p1[0] and y < othershape.p1[1] and my > othershape.p1[1]) or \ # <<<<<<<<<<<<<< * (x < othershape.p2[0] and mx > othershape.p2[0] and y < othershape.p2[1] and my > othershape.p2[1]) or \ * any([i.collides(othershape) for i in self.toLines()]) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2482, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2482, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_v_x, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2482, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_x, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2482, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_9) { goto __pyx_L12_next_or; } else { } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2482, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2482, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_v_mx, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2482, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_mx, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2482, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_9) { goto __pyx_L12_next_or; } else { } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2482, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2482, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_v_y, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2482, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_y, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2482, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_9) { goto __pyx_L12_next_or; } else { } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2482, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2482, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_v_my, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2482, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_my, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2568, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2482, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2568, __pyx_L1_error) if (!__pyx_t_9) { __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { @@ -82773,60 +85801,60 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * } __pyx_L12_next_or:; - /* "collisions.py":2483 + /* "collisions.py":2569 * return self.check_rects(othershape) and ( * (x < othershape.p1[0] and mx > othershape.p1[0] and y < othershape.p1[1] and my > othershape.p1[1]) or \ * (x < othershape.p2[0] and mx > othershape.p2[0] and y < othershape.p2[1] and my > othershape.p2[1]) or \ # <<<<<<<<<<<<<< * any([i.collides(othershape) for i in self.toLines()]) * ) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2483, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2483, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_v_x, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2483, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_x, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2569, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2483, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2569, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_9) { goto __pyx_L16_next_or; } else { } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2483, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2483, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_v_mx, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2483, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_mx, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2569, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2483, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2569, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_9) { goto __pyx_L16_next_or; } else { } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2483, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2483, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_v_y, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2483, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_y, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2569, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2483, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2569, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_9) { goto __pyx_L16_next_or; } else { } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2483, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2483, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_v_my, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2483, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_my, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2569, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2483, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2569, __pyx_L1_error) if (!__pyx_t_9) { __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { @@ -82837,7 +85865,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * } __pyx_L16_next_or:; - /* "collisions.py":2484 + /* "collisions.py":2570 * (x < othershape.p1[0] and mx > othershape.p1[0] and y < othershape.p1[1] and my > othershape.p1[1]) or \ * (x < othershape.p2[0] and mx > othershape.p2[0] and y < othershape.p2[1] and my > othershape.p2[1]) or \ * any([i.collides(othershape) for i in self.toLines()]) # <<<<<<<<<<<<<< @@ -82845,9 +85873,9 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * * if checkShpType(othershape, ShpTyps.Circle): */ { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2484, __pyx_L22_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2570, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2484, __pyx_L22_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2570, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_2 = NULL; __pyx_t_4 = 0; @@ -82867,7 +85895,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2484, __pyx_L22_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2570, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -82876,9 +85904,9 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2484, __pyx_L22_error) + __pyx_t_10 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2570, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2484, __pyx_L22_error) + __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2570, __pyx_L22_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; for (;;) { @@ -82887,28 +85915,28 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2484, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2570, __pyx_L22_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_5); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 2484, __pyx_L22_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_5); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 2570, __pyx_L22_error) #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2484, __pyx_L22_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2570, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2484, __pyx_L22_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2570, __pyx_L22_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_5); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 2484, __pyx_L22_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_10); __Pyx_INCREF(__pyx_t_5); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 2570, __pyx_L22_error) #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2484, __pyx_L22_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2570, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -82918,7 +85946,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2484, __pyx_L22_error) + else __PYX_ERR(0, 2570, __pyx_L22_error) } break; } @@ -82926,7 +85954,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * } __Pyx_XDECREF_SET(__pyx_9genexpr49__pyx_v_i, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr49__pyx_v_i, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2484, __pyx_L22_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr49__pyx_v_i, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2570, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = NULL; __pyx_t_4 = 0; @@ -82946,11 +85974,11 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_othershape}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2484, __pyx_L22_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2570, __pyx_L22_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 2484, __pyx_L22_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 2570, __pyx_L22_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -82961,7 +85989,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * goto __pyx_L1_error; __pyx_L26_exit_scope:; } /* exit inner scope */ - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_any, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2484, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_any, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_INCREF(__pyx_t_6); @@ -82972,7 +86000,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2480 + /* "collisions.py":2566 * if checkShpType(othershape, ShpTyps.Point): * return x <= othershape.x <= mx and y <= othershape.y and my >= othershape.y * if checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< @@ -82981,18 +86009,18 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * */ } - /* "collisions.py":2486 + /* "collisions.py":2572 * any([i.collides(othershape) for i in self.toLines()]) * ) * if checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< * return self.check_rects(othershape) and ( * (x - othershape.r < othershape.x and mx + othershape.r > othershape.x and y < othershape.y and my > othershape.y) or \ */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2486, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2486, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Circle); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2486, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Circle); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -83014,15 +86042,15 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2486, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2486, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2572, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_9) { - /* "collisions.py":2487 + /* "collisions.py":2573 * ) * if checkShpType(othershape, ShpTyps.Circle): * return self.check_rects(othershape) and ( # <<<<<<<<<<<<<< @@ -83030,7 +86058,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * * (x < othershape.x and mx > othershape.x and y - othershape.r < othershape.y and my + othershape.r > othershape.y) or \ */ __Pyx_XDECREF(__pyx_r); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_check_rects); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2487, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_check_rects); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -83050,11 +86078,11 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_othershape}; __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2487, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2487, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2573, __pyx_L1_error) if (__pyx_t_9) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { @@ -83064,60 +86092,60 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * goto __pyx_L28_bool_binop_done; } - /* "collisions.py":2488 + /* "collisions.py":2574 * if checkShpType(othershape, ShpTyps.Circle): * return self.check_rects(othershape) and ( * (x - othershape.r < othershape.x and mx + othershape.r > othershape.x and y < othershape.y and my > othershape.y) or \ # <<<<<<<<<<<<<< * (x < othershape.x and mx > othershape.x and y - othershape.r < othershape.y and my + othershape.r > othershape.y) or \ * ((x - othershape.x)**2 + (y - othershape.y)**2 < othershape.r**2) or \ */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2488, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyNumber_Subtract(__pyx_v_x, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2488, __pyx_L1_error) + __pyx_t_5 = PyNumber_Subtract(__pyx_v_x, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2488, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2488, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2574, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2488, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2574, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_9) { goto __pyx_L30_next_or; } else { } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2488, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyNumber_Add(__pyx_v_mx, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2488, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_v_mx, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2488, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2488, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2574, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2488, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2574, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_9) { goto __pyx_L30_next_or; } else { } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2488, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_y, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2488, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_y, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2574, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2488, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2574, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_9) { goto __pyx_L30_next_or; } else { } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2488, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_my, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2488, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_v_my, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2574, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2488, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2574, __pyx_L1_error) if (!__pyx_t_9) { __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { @@ -83128,60 +86156,60 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * } __pyx_L30_next_or:; - /* "collisions.py":2489 + /* "collisions.py":2575 * return self.check_rects(othershape) and ( * (x - othershape.r < othershape.x and mx + othershape.r > othershape.x and y < othershape.y and my > othershape.y) or \ * (x < othershape.x and mx > othershape.x and y - othershape.r < othershape.y and my + othershape.r > othershape.y) or \ # <<<<<<<<<<<<<< * ((x - othershape.x)**2 + (y - othershape.y)**2 < othershape.r**2) or \ * (((mx) - othershape.x)**2 + (y - othershape.y)**2 < othershape.r**2) or \ */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2489, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_x, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2489, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_x, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2575, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2489, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2575, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (!__pyx_t_9) { goto __pyx_L34_next_or; } else { } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2489, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_v_mx, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2489, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_v_mx, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2575, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2489, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2575, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (!__pyx_t_9) { goto __pyx_L34_next_or; } else { } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2489, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_y, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2489, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_v_y, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2489, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2489, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2575, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2489, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2575, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (!__pyx_t_9) { goto __pyx_L34_next_or; } else { } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2489, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyNumber_Add(__pyx_v_my, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2489, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_v_my, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2489, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2489, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2575, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2489, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2575, __pyx_L1_error) if (!__pyx_t_9) { __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { @@ -83192,42 +86220,42 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * } __pyx_L34_next_or:; - /* "collisions.py":2490 + /* "collisions.py":2576 * (x - othershape.r < othershape.x and mx + othershape.r > othershape.x and y < othershape.y and my > othershape.y) or \ * (x < othershape.x and mx > othershape.x and y - othershape.r < othershape.y and my + othershape.r > othershape.y) or \ * ((x - othershape.x)**2 + (y - othershape.y)**2 < othershape.r**2) or \ # <<<<<<<<<<<<<< * (((mx) - othershape.x)**2 + (y - othershape.y)**2 < othershape.r**2) or \ * ((x - othershape.x)**2 + ((my) - othershape.y)**2 < othershape.r**2) or \ */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2490, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyNumber_Subtract(__pyx_v_x, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2490, __pyx_L1_error) + __pyx_t_6 = PyNumber_Subtract(__pyx_v_x, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Power(__pyx_t_6, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2490, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_6, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2490, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyNumber_Subtract(__pyx_v_y, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2490, __pyx_L1_error) + __pyx_t_5 = PyNumber_Subtract(__pyx_v_y, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Power(__pyx_t_5, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2490, __pyx_L1_error) + __pyx_t_6 = PyNumber_Power(__pyx_t_5, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2490, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2490, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyNumber_Power(__pyx_t_6, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2490, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_6, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2490, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2576, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2490, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2576, __pyx_L1_error) if (!__pyx_t_9) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { @@ -83237,42 +86265,42 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * goto __pyx_L28_bool_binop_done; } - /* "collisions.py":2491 + /* "collisions.py":2577 * (x < othershape.x and mx > othershape.x and y - othershape.r < othershape.y and my + othershape.r > othershape.y) or \ * ((x - othershape.x)**2 + (y - othershape.y)**2 < othershape.r**2) or \ * (((mx) - othershape.x)**2 + (y - othershape.y)**2 < othershape.r**2) or \ # <<<<<<<<<<<<<< * ((x - othershape.x)**2 + ((my) - othershape.y)**2 < othershape.r**2) or \ * (((mx) - othershape.x)**2 + ((my) - othershape.y)**2 < othershape.r**2) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2491, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_mx, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2491, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_v_mx, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2491, __pyx_L1_error) + __pyx_t_6 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2491, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyNumber_Subtract(__pyx_v_y, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2491, __pyx_L1_error) + __pyx_t_5 = PyNumber_Subtract(__pyx_v_y, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Power(__pyx_t_5, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2491, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_5, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2491, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2491, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2491, __pyx_L1_error) + __pyx_t_6 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2491, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2577, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2491, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2577, __pyx_L1_error) if (!__pyx_t_9) { __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { @@ -83282,42 +86310,42 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * goto __pyx_L28_bool_binop_done; } - /* "collisions.py":2492 + /* "collisions.py":2578 * ((x - othershape.x)**2 + (y - othershape.y)**2 < othershape.r**2) or \ * (((mx) - othershape.x)**2 + (y - othershape.y)**2 < othershape.r**2) or \ * ((x - othershape.x)**2 + ((my) - othershape.y)**2 < othershape.r**2) or \ # <<<<<<<<<<<<<< * (((mx) - othershape.x)**2 + ((my) - othershape.y)**2 < othershape.r**2) * ) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2492, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyNumber_Subtract(__pyx_v_x, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2492, __pyx_L1_error) + __pyx_t_6 = PyNumber_Subtract(__pyx_v_x, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Power(__pyx_t_6, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2492, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_6, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2492, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyNumber_Subtract(__pyx_v_my, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2492, __pyx_L1_error) + __pyx_t_5 = PyNumber_Subtract(__pyx_v_my, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Power(__pyx_t_5, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2492, __pyx_L1_error) + __pyx_t_6 = PyNumber_Power(__pyx_t_5, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2492, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2492, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyNumber_Power(__pyx_t_6, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2492, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_6, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2578, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2492, __pyx_L1_error) + __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2578, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2492, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2578, __pyx_L1_error) if (!__pyx_t_9) { __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { @@ -83327,39 +86355,39 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * goto __pyx_L28_bool_binop_done; } - /* "collisions.py":2493 + /* "collisions.py":2579 * (((mx) - othershape.x)**2 + (y - othershape.y)**2 < othershape.r**2) or \ * ((x - othershape.x)**2 + ((my) - othershape.y)**2 < othershape.r**2) or \ * (((mx) - othershape.x)**2 + ((my) - othershape.y)**2 < othershape.r**2) # <<<<<<<<<<<<<< * ) * if checkShpType(othershape, ShpTyps.Arc): */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2493, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_mx, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2493, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_v_mx, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2493, __pyx_L1_error) + __pyx_t_6 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2493, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyNumber_Subtract(__pyx_v_my, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2493, __pyx_L1_error) + __pyx_t_5 = PyNumber_Subtract(__pyx_v_my, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Power(__pyx_t_5, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2493, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_5, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2493, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2493, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2493, __pyx_L1_error) + __pyx_t_6 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2579, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2493, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2579, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_INCREF(__pyx_t_3); @@ -83370,7 +86398,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2486 + /* "collisions.py":2572 * any([i.collides(othershape) for i in self.toLines()]) * ) * if checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< @@ -83379,18 +86407,18 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * */ } - /* "collisions.py":2495 + /* "collisions.py":2581 * (((mx) - othershape.x)**2 + ((my) - othershape.y)**2 < othershape.r**2) * ) * if checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< * if any(self._collides(Point(*i)) for i in othershape.endPoints()): * return True */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2495, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2495, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_Arc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2495, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_Arc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -83412,22 +86440,22 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2495, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2495, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2581, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_9) { - /* "collisions.py":2496 + /* "collisions.py":2582 * ) * if checkShpType(othershape, ShpTyps.Arc): * if any(self._collides(Point(*i)) for i in othershape.endPoints()): # <<<<<<<<<<<<<< * return True * for i in self.toLines(): */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_endPoints); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2496, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_endPoints); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_4 = 0; @@ -83447,21 +86475,21 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2496, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_3 = __pyx_pf_10collisions_4Rect_9_collides_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2496, __pyx_L1_error) + __pyx_t_3 = __pyx_pf_10collisions_4Rect_9_collides_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2496, __pyx_L1_error) + __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2496, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2582, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_9) { - /* "collisions.py":2497 + /* "collisions.py":2583 * if checkShpType(othershape, ShpTyps.Arc): * if any(self._collides(Point(*i)) for i in othershape.endPoints()): * return True # <<<<<<<<<<<<<< @@ -83473,7 +86501,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * __pyx_r = Py_True; goto __pyx_L0; - /* "collisions.py":2496 + /* "collisions.py":2582 * ) * if checkShpType(othershape, ShpTyps.Arc): * if any(self._collides(Point(*i)) for i in othershape.endPoints()): # <<<<<<<<<<<<<< @@ -83482,14 +86510,14 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * */ } - /* "collisions.py":2498 + /* "collisions.py":2584 * if any(self._collides(Point(*i)) for i in othershape.endPoints()): * return True * for i in self.toLines(): # <<<<<<<<<<<<<< * if othershape.collides(i): * return True */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2498, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_5 = NULL; __pyx_t_4 = 0; @@ -83509,7 +86537,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2498, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -83518,9 +86546,9 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2498, __pyx_L1_error) + __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2498, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2584, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -83529,28 +86557,28 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2498, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2584, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 2498, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 2584, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2498, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2498, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2584, __pyx_L1_error) #endif if (__pyx_t_10 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 2498, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely((0 < 0))) __PYX_ERR(0, 2584, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2498, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2584, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -83560,7 +86588,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2498, __pyx_L1_error) + else __PYX_ERR(0, 2584, __pyx_L1_error) } break; } @@ -83569,14 +86597,14 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2499 + /* "collisions.py":2585 * return True * for i in self.toLines(): * if othershape.collides(i): # <<<<<<<<<<<<<< * return True * return False */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2499, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_6 = NULL; __pyx_t_4 = 0; @@ -83596,15 +86624,15 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_v_i}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2499, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2499, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2585, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_9) { - /* "collisions.py":2500 + /* "collisions.py":2586 * for i in self.toLines(): * if othershape.collides(i): * return True # <<<<<<<<<<<<<< @@ -83617,7 +86645,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2499 + /* "collisions.py":2585 * return True * for i in self.toLines(): * if othershape.collides(i): # <<<<<<<<<<<<<< @@ -83626,7 +86654,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * */ } - /* "collisions.py":2498 + /* "collisions.py":2584 * if any(self._collides(Point(*i)) for i in othershape.endPoints()): * return True * for i in self.toLines(): # <<<<<<<<<<<<<< @@ -83636,7 +86664,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2501 + /* "collisions.py":2587 * if othershape.collides(i): * return True * return False # <<<<<<<<<<<<<< @@ -83648,7 +86676,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":2495 + /* "collisions.py":2581 * (((mx) - othershape.x)**2 + ((my) - othershape.y)**2 < othershape.r**2) * ) * if checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< @@ -83657,18 +86685,18 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * */ } - /* "collisions.py":2502 + /* "collisions.py":2588 * return True * return False * if checkShpType(othershape, ShpTyps.Rect): # <<<<<<<<<<<<<< * ox, oy, omx, omy = othershape.rect() * return x <= omx and mx >= ox and y <= omy and my >= oy */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2502, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2502, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Rect); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2502, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Rect); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -83690,22 +86718,22 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2502, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2502, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2588, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_9) { - /* "collisions.py":2503 + /* "collisions.py":2589 * return False * if checkShpType(othershape, ShpTyps.Rect): * ox, oy, omx, omy = othershape.rect() # <<<<<<<<<<<<<< * return x <= omx and mx >= ox and y <= omy and my >= oy * return othershape._collides(self) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2503, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_6 = NULL; __pyx_t_4 = 0; @@ -83725,7 +86753,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2503, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -83735,7 +86763,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * if (unlikely(size != 4)) { if (size > 4) __Pyx_RaiseTooManyValuesError(4); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 2503, __pyx_L1_error) + __PYX_ERR(0, 2589, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -83758,7 +86786,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * Py_ssize_t i; PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_6,&__pyx_t_5,&__pyx_t_2}; for (i=0; i < 4; i++) { - PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 2503, __pyx_L1_error) + PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 2589, __pyx_L1_error) __Pyx_GOTREF(item); *(temps[i]) = item; } @@ -83768,7 +86796,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * } else { Py_ssize_t index = -1; PyObject** temps[4] = {&__pyx_t_1,&__pyx_t_6,&__pyx_t_5,&__pyx_t_2}; - __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2503, __pyx_L1_error) + __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); @@ -83777,7 +86805,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * __Pyx_GOTREF(item); *(temps[index]) = item; } - if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 4) < 0) __PYX_ERR(0, 2503, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 4) < 0) __PYX_ERR(0, 2589, __pyx_L1_error) __pyx_t_8 = NULL; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; goto __pyx_L49_unpacking_done; @@ -83785,7 +86813,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_8 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 2503, __pyx_L1_error) + __PYX_ERR(0, 2589, __pyx_L1_error) __pyx_L49_unpacking_done:; } __pyx_v_ox = __pyx_t_1; @@ -83797,7 +86825,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * __pyx_v_omy = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":2504 + /* "collisions.py":2590 * if checkShpType(othershape, ShpTyps.Rect): * ox, oy, omx, omy = othershape.rect() * return x <= omx and mx >= ox and y <= omy and my >= oy # <<<<<<<<<<<<<< @@ -83805,8 +86833,8 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = PyObject_RichCompare(__pyx_v_x, __pyx_v_omx, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2504, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2504, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_v_x, __pyx_v_omx, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2590, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2590, __pyx_L1_error) if (__pyx_t_9) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { @@ -83815,8 +86843,8 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L50_bool_binop_done; } - __pyx_t_2 = PyObject_RichCompare(__pyx_v_mx, __pyx_v_ox, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2504, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2504, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_v_mx, __pyx_v_ox, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2590, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2590, __pyx_L1_error) if (__pyx_t_9) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { @@ -83825,8 +86853,8 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L50_bool_binop_done; } - __pyx_t_2 = PyObject_RichCompare(__pyx_v_y, __pyx_v_omy, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2504, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2504, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_v_y, __pyx_v_omy, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2590, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2590, __pyx_L1_error) if (__pyx_t_9) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { @@ -83835,7 +86863,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L50_bool_binop_done; } - __pyx_t_2 = PyObject_RichCompare(__pyx_v_my, __pyx_v_oy, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2504, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_v_my, __pyx_v_oy, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2590, __pyx_L1_error) __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = __pyx_t_2; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -83844,7 +86872,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2502 + /* "collisions.py":2588 * return True * return False * if checkShpType(othershape, ShpTyps.Rect): # <<<<<<<<<<<<<< @@ -83853,7 +86881,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * */ } - /* "collisions.py":2505 + /* "collisions.py":2591 * ox, oy, omx, omy = othershape.rect() * return x <= omx and mx >= ox and y <= omy and my >= oy * return othershape._collides(self) # <<<<<<<<<<<<<< @@ -83861,7 +86889,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * * def toLines(self) -> Iterable[Line]: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2505, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_5 = NULL; __pyx_t_4 = 0; @@ -83881,7 +86909,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_cur_scope->__pyx_v_self}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2505, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2591, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -83889,7 +86917,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2476 + /* "collisions.py":2562 * return x < point.x < mx and y < point.y and my > point.y * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< @@ -83925,7 +86953,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_8_collides(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "collisions.py":2507 +/* "collisions.py":2593 * return othershape._collides(self) * * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< @@ -83987,12 +87015,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2507, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2593, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toLines") < 0)) __PYX_ERR(0, 2507, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toLines") < 0)) __PYX_ERR(0, 2593, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -84003,7 +87031,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("toLines", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2507, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("toLines", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2593, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -84048,7 +87076,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_10toLines(CYTHON_UNUSED PyObject *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toLines", 1); - /* "collisions.py":2512 + /* "collisions.py":2598 * Iterable[Line]: Get a list of all the Lines that make up this object * """ * return [ # <<<<<<<<<<<<<< @@ -84057,43 +87085,43 @@ static PyObject *__pyx_pf_10collisions_4Rect_10toLines(CYTHON_UNUSED PyObject *_ */ __Pyx_XDECREF(__pyx_r); - /* "collisions.py":2513 + /* "collisions.py":2599 * """ * return [ * Line((self.x, self.y), (self.x + self.w, self.y)), # <<<<<<<<<<<<<< * Line((self.x + self.w, self.y), (self.x + self.w, self.y + self.h)), * Line((self.x + self.w, self.y + self.h), (self.x, self.y + self.h)), */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2513, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2513, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2513, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2513, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(0, 2513, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(0, 2599, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(0, 2513, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(0, 2599, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2513, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2513, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2513, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2513, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2513, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6)) __PYX_ERR(0, 2513, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6)) __PYX_ERR(0, 2599, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 2513, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 2599, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -84116,60 +87144,60 @@ static PyObject *__pyx_pf_10collisions_4Rect_10toLines(CYTHON_UNUSED PyObject *_ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2513, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2599, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - /* "collisions.py":2514 + /* "collisions.py":2600 * return [ * Line((self.x, self.y), (self.x + self.w, self.y)), * Line((self.x + self.w, self.y), (self.x + self.w, self.y + self.h)), # <<<<<<<<<<<<<< * Line((self.x + self.w, self.y + self.h), (self.x, self.y + self.h)), * Line((self.x, self.y + self.h), (self.x, self.y)) */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Line); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2514, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Line); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2514, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2514, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2514, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2514, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2514, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6)) __PYX_ERR(0, 2514, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6)) __PYX_ERR(0, 2600, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(0, 2514, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3)) __PYX_ERR(0, 2600, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2514, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2514, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2514, __pyx_L1_error) + __pyx_t_8 = PyNumber_Add(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2514, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2514, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyNumber_Add(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2514, __pyx_L1_error) + __pyx_t_9 = PyNumber_Add(__pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2514, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8)) __PYX_ERR(0, 2514, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8)) __PYX_ERR(0, 2600, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_9)) __PYX_ERR(0, 2514, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_9)) __PYX_ERR(0, 2600, __pyx_L1_error); __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -84192,60 +87220,60 @@ static PyObject *__pyx_pf_10collisions_4Rect_10toLines(CYTHON_UNUSED PyObject *_ __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2514, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - /* "collisions.py":2515 + /* "collisions.py":2601 * Line((self.x, self.y), (self.x + self.w, self.y)), * Line((self.x + self.w, self.y), (self.x + self.w, self.y + self.h)), * Line((self.x + self.w, self.y + self.h), (self.x, self.y + self.h)), # <<<<<<<<<<<<<< * Line((self.x, self.y + self.h), (self.x, self.y)) * ] */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2515, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2515, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2515, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = PyNumber_Add(__pyx_t_5, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2515, __pyx_L1_error) + __pyx_t_8 = PyNumber_Add(__pyx_t_5, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2515, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2515, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyNumber_Add(__pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2515, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_9, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2515, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8)) __PYX_ERR(0, 2515, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8)) __PYX_ERR(0, 2601, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6)) __PYX_ERR(0, 2515, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6)) __PYX_ERR(0, 2601, __pyx_L1_error); __pyx_t_8 = 0; __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2515, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2515, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2515, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyNumber_Add(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2515, __pyx_L1_error) + __pyx_t_10 = PyNumber_Add(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2515, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6)) __PYX_ERR(0, 2515, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6)) __PYX_ERR(0, 2601, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10)) __PYX_ERR(0, 2515, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_10)) __PYX_ERR(0, 2601, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_10 = 0; __pyx_t_10 = NULL; @@ -84268,48 +87296,48 @@ static PyObject *__pyx_pf_10collisions_4Rect_10toLines(CYTHON_UNUSED PyObject *_ __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2515, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2601, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - /* "collisions.py":2516 + /* "collisions.py":2602 * Line((self.x + self.w, self.y), (self.x + self.w, self.y + self.h)), * Line((self.x + self.w, self.y + self.h), (self.x, self.y + self.h)), * Line((self.x, self.y + self.h), (self.x, self.y)) # <<<<<<<<<<<<<< * ] * */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_Line); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2516, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_Line); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2516, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2516, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2516, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = PyNumber_Add(__pyx_t_10, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2516, __pyx_L1_error) + __pyx_t_8 = PyNumber_Add(__pyx_t_10, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2516, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5)) __PYX_ERR(0, 2516, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5)) __PYX_ERR(0, 2602, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_8)) __PYX_ERR(0, 2516, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_8)) __PYX_ERR(0, 2602, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2516, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2516, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2516, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8)) __PYX_ERR(0, 2516, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8)) __PYX_ERR(0, 2602, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5)) __PYX_ERR(0, 2516, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5)) __PYX_ERR(0, 2602, __pyx_L1_error); __pyx_t_8 = 0; __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -84332,28 +87360,28 @@ static PyObject *__pyx_pf_10collisions_4Rect_10toLines(CYTHON_UNUSED PyObject *_ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2516, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2602, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } - /* "collisions.py":2512 + /* "collisions.py":2598 * Iterable[Line]: Get a list of all the Lines that make up this object * """ * return [ # <<<<<<<<<<<<<< * Line((self.x, self.y), (self.x + self.w, self.y)), * Line((self.x + self.w, self.y), (self.x + self.w, self.y + self.h)), */ - __pyx_t_9 = PyList_New(4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2512, __pyx_L1_error) + __pyx_t_9 = PyList_New(4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2598, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_1)) __PYX_ERR(0, 2512, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_1)) __PYX_ERR(0, 2598, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_2)) __PYX_ERR(0, 2512, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_2)) __PYX_ERR(0, 2598, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 2, __pyx_t_4)) __PYX_ERR(0, 2512, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 2, __pyx_t_4)) __PYX_ERR(0, 2598, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 3, __pyx_t_3)) __PYX_ERR(0, 2512, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_9, 3, __pyx_t_3)) __PYX_ERR(0, 2598, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_4 = 0; @@ -84362,7 +87390,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_10toLines(CYTHON_UNUSED PyObject *_ __pyx_t_9 = 0; goto __pyx_L0; - /* "collisions.py":2507 + /* "collisions.py":2593 * return othershape._collides(self) * * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< @@ -84389,7 +87417,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_10toLines(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":2519 +/* "collisions.py":2605 * ] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -84451,12 +87479,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2519, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2605, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toPoints") < 0)) __PYX_ERR(0, 2519, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toPoints") < 0)) __PYX_ERR(0, 2605, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -84467,7 +87495,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("toPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2519, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("toPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2605, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -84509,7 +87537,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_12toPoints(CYTHON_UNUSED PyObject * int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toPoints", 1); - /* "collisions.py":2524 + /* "collisions.py":2610 * Iterable[pointLike]: Get a list of all the Points that make up this object * """ * return [ # <<<<<<<<<<<<<< @@ -84518,127 +87546,127 @@ static PyObject *__pyx_pf_10collisions_4Rect_12toPoints(CYTHON_UNUSED PyObject * */ __Pyx_XDECREF(__pyx_r); - /* "collisions.py":2525 + /* "collisions.py":2611 * """ * return [ * [self.x, self.y], # <<<<<<<<<<<<<< * [self.x + self.w, self.y], * [self.x + self.w, self.y + self.h], */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2525, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2525, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2525, __pyx_L1_error) + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2611, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 2525, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1)) __PYX_ERR(0, 2611, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 2525, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2)) __PYX_ERR(0, 2611, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; - /* "collisions.py":2526 + /* "collisions.py":2612 * return [ * [self.x, self.y], * [self.x + self.w, self.y], # <<<<<<<<<<<<<< * [self.x + self.w, self.y + self.h], * [self.x, self.y + self.h] */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2526, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2526, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2526, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2526, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2526, __pyx_L1_error) + __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2612, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 2526, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_4)) __PYX_ERR(0, 2612, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 2526, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 2612, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_1 = 0; - /* "collisions.py":2527 + /* "collisions.py":2613 * [self.x, self.y], * [self.x + self.w, self.y], * [self.x + self.w, self.y + self.h], # <<<<<<<<<<<<<< * [self.x, self.y + self.h] * ] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2527, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2527, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2527, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2527, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2527, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2527, __pyx_L1_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2527, __pyx_L1_error) + __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2613, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_5)) __PYX_ERR(0, 2527, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_5)) __PYX_ERR(0, 2613, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_6)) __PYX_ERR(0, 2527, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_6)) __PYX_ERR(0, 2613, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_6 = 0; - /* "collisions.py":2528 + /* "collisions.py":2614 * [self.x + self.w, self.y], * [self.x + self.w, self.y + self.h], * [self.x, self.y + self.h] # <<<<<<<<<<<<<< * ] * */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2528, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2528, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2528, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2528, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2528, __pyx_L1_error) + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2614, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_6)) __PYX_ERR(0, 2528, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_6)) __PYX_ERR(0, 2614, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_7)) __PYX_ERR(0, 2528, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_7)) __PYX_ERR(0, 2614, __pyx_L1_error); __pyx_t_6 = 0; __pyx_t_7 = 0; - /* "collisions.py":2524 + /* "collisions.py":2610 * Iterable[pointLike]: Get a list of all the Points that make up this object * """ * return [ # <<<<<<<<<<<<<< * [self.x, self.y], * [self.x + self.w, self.y], */ - __pyx_t_7 = PyList_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2524, __pyx_L1_error) + __pyx_t_7 = PyList_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2610, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_3)) __PYX_ERR(0, 2524, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_3)) __PYX_ERR(0, 2610, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_2)) __PYX_ERR(0, 2524, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_2)) __PYX_ERR(0, 2610, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 2, __pyx_t_1)) __PYX_ERR(0, 2524, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 2, __pyx_t_1)) __PYX_ERR(0, 2610, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 3, __pyx_t_4)) __PYX_ERR(0, 2524, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 3, __pyx_t_4)) __PYX_ERR(0, 2610, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; @@ -84647,7 +87675,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_12toPoints(CYTHON_UNUSED PyObject * __pyx_t_7 = 0; goto __pyx_L0; - /* "collisions.py":2519 + /* "collisions.py":2605 * ] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -84672,7 +87700,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_12toPoints(CYTHON_UNUSED PyObject * return __pyx_r; } -/* "collisions.py":2531 +/* "collisions.py":2617 * ] * * def copy(self) -> 'Rect': # <<<<<<<<<<<<<< @@ -84734,12 +87762,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2531, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2617, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(0, 2531, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(0, 2617, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -84750,7 +87778,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("copy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2531, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("copy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2617, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -84794,7 +87822,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_14copy(CYTHON_UNUSED PyObject *__py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 1); - /* "collisions.py":2535 + /* "collisions.py":2621 * Clone this object using the latest cloning technology. * """ * return Rect(self.x, self.y, self.w, self.h, self.bounciness) # <<<<<<<<<<<<<< @@ -84802,17 +87830,17 @@ static PyObject *__pyx_pf_10collisions_4Rect_14copy(CYTHON_UNUSED PyObject *__py * def __setitem__(self, item: int, new: pointLike) -> None: */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2535, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2535, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2535, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2535, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2535, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2535, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_9 = 0; @@ -84837,7 +87865,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_14copy(CYTHON_UNUSED PyObject *__py __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2535, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2621, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -84845,7 +87873,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_14copy(CYTHON_UNUSED PyObject *__py __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2531 + /* "collisions.py":2617 * ] * * def copy(self) -> 'Rect': # <<<<<<<<<<<<<< @@ -84871,7 +87899,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_14copy(CYTHON_UNUSED PyObject *__py return __pyx_r; } -/* "collisions.py":2537 +/* "collisions.py":2623 * return Rect(self.x, self.y, self.w, self.h, self.bounciness) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< @@ -84938,7 +87966,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2537, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2623, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -84946,9 +87974,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2537, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2623, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 2537, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 2623, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -84956,14 +87984,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2537, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2623, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 2537, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 2623, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(0, 2537, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(0, 2623, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -84978,7 +88006,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 2537, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 2623, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -84992,7 +88020,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_item), (&PyInt_Type), 0, "item", 1))) __PYX_ERR(0, 2537, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_item), (&PyInt_Type), 0, "item", 1))) __PYX_ERR(0, 2623, __pyx_L1_error) __pyx_r = __pyx_pf_10collisions_4Rect_16__setitem__(__pyx_self, __pyx_v_self, __pyx_v_item, __pyx_v_new); /* function exit code */ @@ -85023,35 +88051,35 @@ static PyObject *__pyx_pf_10collisions_4Rect_16__setitem__(CYTHON_UNUSED PyObjec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 1); - /* "collisions.py":2538 + /* "collisions.py":2624 * * def __setitem__(self, item: int, new: pointLike) -> None: * if item == 0: # <<<<<<<<<<<<<< * self.x, self.y = new[0], new[1] * elif item == 1: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2538, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2538, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2624, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2624, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":2539 + /* "collisions.py":2625 * def __setitem__(self, item: int, new: pointLike) -> None: * if item == 0: * self.x, self.y = new[0], new[1] # <<<<<<<<<<<<<< * elif item == 1: * self.x, self.y = new[0]-self.w, new[1] */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_new, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2539, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_new, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_new, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2539, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_new, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2625, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_1) < 0) __PYX_ERR(0, 2539, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_1) < 0) __PYX_ERR(0, 2625, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_3) < 0) __PYX_ERR(0, 2539, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_3) < 0) __PYX_ERR(0, 2625, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2538 + /* "collisions.py":2624 * * def __setitem__(self, item: int, new: pointLike) -> None: * if item == 0: # <<<<<<<<<<<<<< @@ -85061,41 +88089,41 @@ static PyObject *__pyx_pf_10collisions_4Rect_16__setitem__(CYTHON_UNUSED PyObjec goto __pyx_L3; } - /* "collisions.py":2540 + /* "collisions.py":2626 * if item == 0: * self.x, self.y = new[0], new[1] * elif item == 1: # <<<<<<<<<<<<<< * self.x, self.y = new[0]-self.w, new[1] * elif item == 2: */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_item, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2540, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2540, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_item, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2626, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2626, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - /* "collisions.py":2541 + /* "collisions.py":2627 * self.x, self.y = new[0], new[1] * elif item == 1: * self.x, self.y = new[0]-self.w, new[1] # <<<<<<<<<<<<<< * elif item == 2: * self.x, self.y = new[0]-self.w, new[1]-self.h */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_new, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2541, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_new, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2541, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2541, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_new, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2541, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_new, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2627, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_4) < 0) __PYX_ERR(0, 2541, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_4) < 0) __PYX_ERR(0, 2627, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_1) < 0) __PYX_ERR(0, 2541, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_1) < 0) __PYX_ERR(0, 2627, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2540 + /* "collisions.py":2626 * if item == 0: * self.x, self.y = new[0], new[1] * elif item == 1: # <<<<<<<<<<<<<< @@ -85105,47 +88133,47 @@ static PyObject *__pyx_pf_10collisions_4Rect_16__setitem__(CYTHON_UNUSED PyObjec goto __pyx_L3; } - /* "collisions.py":2542 + /* "collisions.py":2628 * elif item == 1: * self.x, self.y = new[0]-self.w, new[1] * elif item == 2: # <<<<<<<<<<<<<< * self.x, self.y = new[0]-self.w, new[1]-self.h * elif item == 3: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2542, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2542, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2628, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2628, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":2543 + /* "collisions.py":2629 * self.x, self.y = new[0]-self.w, new[1] * elif item == 2: * self.x, self.y = new[0]-self.w, new[1]-self.h # <<<<<<<<<<<<<< * elif item == 3: * self.x, self.y = new[0], new[1]-self.h */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_new, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2543, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_new, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2543, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2543, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_new, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2543, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_new, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2543, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2543, __pyx_L1_error) + __pyx_t_5 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2629, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_3) < 0) __PYX_ERR(0, 2543, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_3) < 0) __PYX_ERR(0, 2629, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_5) < 0) __PYX_ERR(0, 2543, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_5) < 0) __PYX_ERR(0, 2629, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "collisions.py":2542 + /* "collisions.py":2628 * elif item == 1: * self.x, self.y = new[0]-self.w, new[1] * elif item == 2: # <<<<<<<<<<<<<< @@ -85155,41 +88183,41 @@ static PyObject *__pyx_pf_10collisions_4Rect_16__setitem__(CYTHON_UNUSED PyObjec goto __pyx_L3; } - /* "collisions.py":2544 + /* "collisions.py":2630 * elif item == 2: * self.x, self.y = new[0]-self.w, new[1]-self.h * elif item == 3: # <<<<<<<<<<<<<< * self.x, self.y = new[0], new[1]-self.h * else: */ - __pyx_t_5 = PyObject_RichCompare(__pyx_v_item, __pyx_int_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2544, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2544, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_v_item, __pyx_int_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2630, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2630, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (likely(__pyx_t_2)) { - /* "collisions.py":2545 + /* "collisions.py":2631 * self.x, self.y = new[0]-self.w, new[1]-self.h * elif item == 3: * self.x, self.y = new[0], new[1]-self.h # <<<<<<<<<<<<<< * else: * raise IndexError( */ - __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_new, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2545, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_new, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_new, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2545, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_new, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2545, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2545, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2631, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_5) < 0) __PYX_ERR(0, 2545, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_5) < 0) __PYX_ERR(0, 2631, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_4) < 0) __PYX_ERR(0, 2545, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_4) < 0) __PYX_ERR(0, 2631, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2544 + /* "collisions.py":2630 * elif item == 2: * self.x, self.y = new[0]-self.w, new[1]-self.h * elif item == 3: # <<<<<<<<<<<<<< @@ -85199,7 +88227,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_16__setitem__(CYTHON_UNUSED PyObjec goto __pyx_L3; } - /* "collisions.py":2547 + /* "collisions.py":2633 * self.x, self.y = new[0], new[1]-self.h * else: * raise IndexError( # <<<<<<<<<<<<<< @@ -85208,36 +88236,36 @@ static PyObject *__pyx_pf_10collisions_4Rect_16__setitem__(CYTHON_UNUSED PyObjec */ /*else*/ { - /* "collisions.py":2548 + /* "collisions.py":2634 * else: * raise IndexError( * 'List index out of range! Must be 0-3, found: '+str(item) # <<<<<<<<<<<<<< * ) * */ - __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2548, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_List_index_out_of_range_Must_be_4, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2548, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_List_index_out_of_range_Must_be_4, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2634, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2547 + /* "collisions.py":2633 * self.x, self.y = new[0], new[1]-self.h * else: * raise IndexError( # <<<<<<<<<<<<<< * 'List index out of range! Must be 0-3, found: '+str(item) * ) */ - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2547, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2633, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_Raise(__pyx_t_4, 0, 0, 0); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 2547, __pyx_L1_error) + __PYX_ERR(0, 2633, __pyx_L1_error) } __pyx_L3:; - /* "collisions.py":2537 + /* "collisions.py":2623 * return Rect(self.x, self.y, self.w, self.h, self.bounciness) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< @@ -85261,7 +88289,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_16__setitem__(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "collisions.py":2551 +/* "collisions.py":2637 * ) * * def __str__(self): # <<<<<<<<<<<<<< @@ -85322,12 +88350,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2551, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2637, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 2551, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 2637, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -85338,7 +88366,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2551, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2637, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -85378,7 +88406,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_18__str__(CYTHON_UNUSED PyObject *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 1); - /* "collisions.py":2552 + /* "collisions.py":2638 * * def __str__(self): * return f'' # <<<<<<<<<<<<<< @@ -85386,7 +88414,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_18__str__(CYTHON_UNUSED PyObject *_ * class RotatedRect(ClosedShape): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2552, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 127; @@ -85394,9 +88422,9 @@ static PyObject *__pyx_pf_10collisions_4Rect_18__str__(CYTHON_UNUSED PyObject *_ __pyx_t_2 += 9; __Pyx_GIVEREF(__pyx_kp_u_Rect_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Rect_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2552, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2552, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; @@ -85404,13 +88432,13 @@ static PyObject *__pyx_pf_10collisions_4Rect_18__str__(CYTHON_UNUSED PyObject *_ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); __pyx_t_5 = 0; - __Pyx_INCREF(__pyx_kp_u__6); + __Pyx_INCREF(__pyx_kp_u__8); __pyx_t_2 += 2; - __Pyx_GIVEREF(__pyx_kp_u__6); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2552, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_kp_u__8); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__8); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2552, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; @@ -85422,9 +88450,9 @@ static PyObject *__pyx_pf_10collisions_4Rect_18__str__(CYTHON_UNUSED PyObject *_ __pyx_t_2 += 18; __Pyx_GIVEREF(__pyx_kp_u_with_dimensions); PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_with_dimensions); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2552, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2552, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; @@ -85436,9 +88464,9 @@ static PyObject *__pyx_pf_10collisions_4Rect_18__str__(CYTHON_UNUSED PyObject *_ __pyx_t_2 += 1; __Pyx_GIVEREF(__pyx_n_u_x); PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_n_u_x); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2552, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2552, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; @@ -85446,18 +88474,18 @@ static PyObject *__pyx_pf_10collisions_4Rect_18__str__(CYTHON_UNUSED PyObject *_ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_t_4); __pyx_t_4 = 0; - __Pyx_INCREF(__pyx_kp_u__5); + __Pyx_INCREF(__pyx_kp_u__7); __pyx_t_2 += 1; - __Pyx_GIVEREF(__pyx_kp_u__5); - PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_kp_u__5); - __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 9, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2552, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_kp_u__7); + PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_kp_u__7); + __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 9, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2638, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":2551 + /* "collisions.py":2637 * ) * * def __str__(self): # <<<<<<<<<<<<<< @@ -85478,7 +88506,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_18__str__(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":2559 +/* "collisions.py":2645 * Defined as an x, y, width, height and rotation.""" * TYPE = ShpTyps.RotRect * def __init__(self, x: Number, y: Number, w: Number, h: Number, rotation: Number, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< @@ -85486,7 +88514,7 @@ static PyObject *__pyx_pf_10collisions_4Rect_18__str__(CYTHON_UNUSED PyObject *_ * Args: */ -static PyObject *__pyx_pf_10collisions_62__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { +static PyObject *__pyx_pf_10collisions_64__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -85496,20 +88524,20 @@ static PyObject *__pyx_pf_10collisions_62__defaults__(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults22, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2559, __pyx_L1_error) + __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults23, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2559, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 2559, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1)) __PYX_ERR(0, 2645, __pyx_L1_error); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2559, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 2559, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 2645, __pyx_L1_error); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None)) __PYX_ERR(0, 2559, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None)) __PYX_ERR(0, 2645, __pyx_L1_error); __pyx_t_2 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -85572,7 +88600,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_w,&__pyx_n_s_h,&__pyx_n_s_rotation,&__pyx_n_s_bounciness,0}; - __pyx_defaults22 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults22, __pyx_self); + __pyx_defaults23 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults23, __pyx_self); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -85600,7 +88628,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2559, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2645, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -85608,9 +88636,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2559, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2645, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 1); __PYX_ERR(0, 2559, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 1); __PYX_ERR(0, 2645, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -85618,9 +88646,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2559, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2645, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 2); __PYX_ERR(0, 2559, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 2); __PYX_ERR(0, 2645, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 3: @@ -85628,9 +88656,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[3]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2559, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2645, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 3); __PYX_ERR(0, 2559, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 3); __PYX_ERR(0, 2645, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 4: @@ -85638,9 +88666,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[4]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2559, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2645, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 4); __PYX_ERR(0, 2559, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 4); __PYX_ERR(0, 2645, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 5: @@ -85648,21 +88676,21 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[5]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2559, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2645, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 5); __PYX_ERR(0, 2559, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, 5); __PYX_ERR(0, 2645, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 6: if (kw_args > 0) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_bounciness); if (value) { values[6] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2559, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2645, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 2559, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 2645, __pyx_L3_error) } } else { switch (__pyx_nargs) { @@ -85685,14 +88713,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_v_h = values[4]; __pyx_v_rotation = values[5]; if (values[6]) { - __pyx_v_bounciness = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_bounciness == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2559, __pyx_L3_error) + __pyx_v_bounciness = __pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_bounciness == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2645, __pyx_L3_error) } else { __pyx_v_bounciness = __pyx_dynamic_args->__pyx_arg_bounciness; } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, __pyx_nargs); __PYX_ERR(0, 2559, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 7, __pyx_nargs); __PYX_ERR(0, 2645, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -85733,7 +88761,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect___init__(CYTHON_UNUSED PyOb int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); - /* "collisions.py":2569 + /* "collisions.py":2655 * bounciness (float, optional): How bouncy this object is. 1 = rebounds perfectly, <1 = eventually will stop, >1 = will bounce more each time. Defaults to 0.7. * """ * super().__init__(bounciness) # <<<<<<<<<<<<<< @@ -85741,23 +88769,23 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect___init__(CYTHON_UNUSED PyOb * self.cachedPoints = [] */ __pyx_t_2 = __Pyx_CyFunction_GetClassObj(__pyx_self); - if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 2569, __pyx_L1_error) } + if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 2655, __pyx_L1_error) } __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2569, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 2569, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 2655, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(0, 2569, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(0, 2655, __pyx_L1_error); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2569, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2569, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2569, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -85778,13 +88806,13 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect___init__(CYTHON_UNUSED PyOb __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2569, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2655, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2570 + /* "collisions.py":2656 * """ * super().__init__(bounciness) * self.x, self.y, self.w, self.h, self.rot = x, y, w, h, rotation # <<<<<<<<<<<<<< @@ -85801,42 +88829,42 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect___init__(CYTHON_UNUSED PyOb __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = __pyx_v_rotation; __Pyx_INCREF(__pyx_t_6); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_1) < 0) __PYX_ERR(0, 2570, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_x, __pyx_t_1) < 0) __PYX_ERR(0, 2656, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_3) < 0) __PYX_ERR(0, 2570, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_y, __pyx_t_3) < 0) __PYX_ERR(0, 2656, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_w, __pyx_t_2) < 0) __PYX_ERR(0, 2570, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_w, __pyx_t_2) < 0) __PYX_ERR(0, 2656, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_h, __pyx_t_4) < 0) __PYX_ERR(0, 2570, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_h, __pyx_t_4) < 0) __PYX_ERR(0, 2656, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_rot, __pyx_t_6) < 0) __PYX_ERR(0, 2570, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_rot, __pyx_t_6) < 0) __PYX_ERR(0, 2656, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "collisions.py":2571 + /* "collisions.py":2657 * super().__init__(bounciness) * self.x, self.y, self.w, self.h, self.rot = x, y, w, h, rotation * self.cachedPoints = [] # <<<<<<<<<<<<<< * self.cacheRequirements = [] * */ - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2571, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cachedPoints, __pyx_t_6) < 0) __PYX_ERR(0, 2571, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cachedPoints, __pyx_t_6) < 0) __PYX_ERR(0, 2657, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "collisions.py":2572 + /* "collisions.py":2658 * self.x, self.y, self.w, self.h, self.rot = x, y, w, h, rotation * self.cachedPoints = [] * self.cacheRequirements = [] # <<<<<<<<<<<<<< * * def getCache(self) -> Iterable[pointLike]: */ - __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2572, __pyx_L1_error) + __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2658, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cacheRequirements, __pyx_t_6) < 0) __PYX_ERR(0, 2572, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cacheRequirements, __pyx_t_6) < 0) __PYX_ERR(0, 2658, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "collisions.py":2559 + /* "collisions.py":2645 * Defined as an x, y, width, height and rotation.""" * TYPE = ShpTyps.RotRect * def __init__(self, x: Number, y: Number, w: Number, h: Number, rotation: Number, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< @@ -85861,7 +88889,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect___init__(CYTHON_UNUSED PyOb return __pyx_r; } -/* "collisions.py":2574 +/* "collisions.py":2660 * self.cacheRequirements = [] * * def getCache(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -85923,12 +88951,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2574, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2660, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getCache") < 0)) __PYX_ERR(0, 2574, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "getCache") < 0)) __PYX_ERR(0, 2660, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -85939,7 +88967,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("getCache", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2574, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("getCache", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2660, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -85966,7 +88994,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "collisions.py":2588 +/* "collisions.py":2674 * cos = math.cos(angle) * sin = math.sin(angle) * def rot(x, y): # <<<<<<<<<<<<<< @@ -86030,7 +89058,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2588, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2674, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -86038,14 +89066,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2588, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2674, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("rot", 1, 2, 2, 1); __PYX_ERR(0, 2588, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rot", 1, 2, 2, 1); __PYX_ERR(0, 2674, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rot") < 0)) __PYX_ERR(0, 2588, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rot") < 0)) __PYX_ERR(0, 2674, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -86058,7 +89086,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rot", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2588, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rot", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2674, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -86086,8 +89114,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_pf_10collisions_11RotatedRect_8getCache_rot(PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) { - struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache *__pyx_cur_scope; - struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache *__pyx_outer_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_23_getCache *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_23_getCache *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -86098,10 +89126,10 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8getCache_rot(PyObject *__p const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rot", 1); - __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_23_getCache *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; - /* "collisions.py":2589 + /* "collisions.py":2675 * sin = math.sin(angle) * def rot(x, y): * return cos * x - sin * y, sin * x + cos * y # <<<<<<<<<<<<<< @@ -86109,39 +89137,39 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8getCache_rot(PyObject *__p * (0, 0), */ __Pyx_XDECREF(__pyx_r); - if (unlikely(!__pyx_cur_scope->__pyx_v_cos)) { __Pyx_RaiseClosureNameError("cos"); __PYX_ERR(0, 2589, __pyx_L1_error) } - __pyx_t_1 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_cos, __pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2589, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_cos)) { __Pyx_RaiseClosureNameError("cos"); __PYX_ERR(0, 2675, __pyx_L1_error) } + __pyx_t_1 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_cos, __pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(!__pyx_cur_scope->__pyx_v_sin)) { __Pyx_RaiseClosureNameError("sin"); __PYX_ERR(0, 2589, __pyx_L1_error) } - __pyx_t_2 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_sin, __pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2589, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_sin)) { __Pyx_RaiseClosureNameError("sin"); __PYX_ERR(0, 2675, __pyx_L1_error) } + __pyx_t_2 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_sin, __pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2589, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2675, __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; - if (unlikely(!__pyx_cur_scope->__pyx_v_sin)) { __Pyx_RaiseClosureNameError("sin"); __PYX_ERR(0, 2589, __pyx_L1_error) } - __pyx_t_2 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_sin, __pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2589, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_sin)) { __Pyx_RaiseClosureNameError("sin"); __PYX_ERR(0, 2675, __pyx_L1_error) } + __pyx_t_2 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_sin, __pyx_v_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_cos)) { __Pyx_RaiseClosureNameError("cos"); __PYX_ERR(0, 2589, __pyx_L1_error) } - __pyx_t_1 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_cos, __pyx_v_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2589, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_cos)) { __Pyx_RaiseClosureNameError("cos"); __PYX_ERR(0, 2675, __pyx_L1_error) } + __pyx_t_1 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_cos, __pyx_v_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2589, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2589, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2675, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 2589, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 2675, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4)) __PYX_ERR(0, 2589, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4)) __PYX_ERR(0, 2675, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2588 + /* "collisions.py":2674 * cos = math.cos(angle) * sin = math.sin(angle) * def rot(x, y): # <<<<<<<<<<<<<< @@ -86163,7 +89191,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8getCache_rot(PyObject *__p return __pyx_r; } -/* "collisions.py":2574 +/* "collisions.py":2660 * self.cacheRequirements = [] * * def getCache(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -86172,7 +89200,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8getCache_rot(PyObject *__p */ static PyObject *__pyx_pf_10collisions_11RotatedRect_2getCache(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_23_getCache *__pyx_cur_scope; PyObject *__pyx_v_check = NULL; PyObject *__pyx_v_angle = NULL; PyObject *__pyx_v_rot = 0; @@ -86193,79 +89221,79 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_2getCache(CYTHON_UNUSED PyO const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("getCache", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache *)__pyx_tp_new_10collisions___pyx_scope_struct_22_getCache(__pyx_ptype_10collisions___pyx_scope_struct_22_getCache, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_23_getCache *)__pyx_tp_new_10collisions___pyx_scope_struct_23_getCache(__pyx_ptype_10collisions___pyx_scope_struct_23_getCache, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_23_getCache *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2574, __pyx_L1_error) + __PYX_ERR(0, 2660, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - /* "collisions.py":2582 + /* "collisions.py":2668 * Iterable[pointLike]: All the points that make up this rectangle, all rotated BUT NOT TRANSLATED. You must add (self.x, self.y) to each one to get the pos. * """ * check = [self.w, self.h, self.rot] # <<<<<<<<<<<<<< * if check != self.cacheRequirements: * self.cacheRequirements = check */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2582, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2582, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2582, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyList_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2582, __pyx_L1_error) + __pyx_t_4 = PyList_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2668, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 2582, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_1)) __PYX_ERR(0, 2668, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 2582, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 2668, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(0, 2582, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 2, __pyx_t_3)) __PYX_ERR(0, 2668, __pyx_L1_error); __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_v_check = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2583 + /* "collisions.py":2669 * """ * check = [self.w, self.h, self.rot] * if check != self.cacheRequirements: # <<<<<<<<<<<<<< * self.cacheRequirements = check * angle = math.radians(self.rot) */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cacheRequirements); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2583, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cacheRequirements); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2669, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_check, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2583, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_check, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2669, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2583, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2669, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { - /* "collisions.py":2584 + /* "collisions.py":2670 * check = [self.w, self.h, self.rot] * if check != self.cacheRequirements: * self.cacheRequirements = check # <<<<<<<<<<<<<< * angle = math.radians(self.rot) * cos = math.cos(angle) */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cacheRequirements, __pyx_v_check) < 0) __PYX_ERR(0, 2584, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cacheRequirements, __pyx_v_check) < 0) __PYX_ERR(0, 2670, __pyx_L1_error) - /* "collisions.py":2585 + /* "collisions.py":2671 * if check != self.cacheRequirements: * self.cacheRequirements = check * angle = math.radians(self.rot) # <<<<<<<<<<<<<< * cos = math.cos(angle) * sin = math.sin(angle) */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2585, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_radians); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2585, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_radians); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2585, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_1 = NULL; __pyx_t_6 = 0; @@ -86286,23 +89314,23 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_2getCache(CYTHON_UNUSED PyO __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2585, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2671, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_angle = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":2586 + /* "collisions.py":2672 * self.cacheRequirements = check * angle = math.radians(self.rot) * cos = math.cos(angle) # <<<<<<<<<<<<<< * sin = math.sin(angle) * def rot(x, y): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2586, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_math); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_cos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2586, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_cos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -86323,7 +89351,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_2getCache(CYTHON_UNUSED PyO PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_angle}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2586, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2672, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -86331,16 +89359,16 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_2getCache(CYTHON_UNUSED PyO __pyx_cur_scope->__pyx_v_cos = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":2587 + /* "collisions.py":2673 * angle = math.radians(self.rot) * cos = math.cos(angle) * sin = math.sin(angle) # <<<<<<<<<<<<<< * def rot(x, y): * return cos * x - sin * y, sin * x + cos * y */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2587, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_math); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2587, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -86361,7 +89389,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_2getCache(CYTHON_UNUSED PyO PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_angle}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2587, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2673, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -86369,85 +89397,85 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_2getCache(CYTHON_UNUSED PyO __pyx_cur_scope->__pyx_v_sin = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":2588 + /* "collisions.py":2674 * cos = math.cos(angle) * sin = math.sin(angle) * def rot(x, y): # <<<<<<<<<<<<<< * return cos * x - sin * y, sin * x + cos * y * self.cache = [ */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_8getCache_1rot, 0, __pyx_n_s_RotatedRect_getCache_locals_rot, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2588, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_8getCache_1rot, 0, __pyx_n_s_RotatedRect_getCache_locals_rot, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2674, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_rot = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":2592 + /* "collisions.py":2678 * self.cache = [ * (0, 0), * rot(self.w, 0), # <<<<<<<<<<<<<< * rot(self.w, self.h), * rot(0, self.h) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2592, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __pyx_pf_10collisions_11RotatedRect_8getCache_rot(__pyx_v_rot, __pyx_t_3, __pyx_int_0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2592, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_10collisions_11RotatedRect_8getCache_rot(__pyx_v_rot, __pyx_t_3, __pyx_int_0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2678, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2593 + /* "collisions.py":2679 * (0, 0), * rot(self.w, 0), * rot(self.w, self.h), # <<<<<<<<<<<<<< * rot(0, self.h) * ] */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2593, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2593, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __pyx_pf_10collisions_11RotatedRect_8getCache_rot(__pyx_v_rot, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2593, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_10collisions_11RotatedRect_8getCache_rot(__pyx_v_rot, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2679, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2594 + /* "collisions.py":2680 * rot(self.w, 0), * rot(self.w, self.h), * rot(0, self.h) # <<<<<<<<<<<<<< * ] * return [[i[0]+self.x, i[1]+self.y] for i in self.cache] */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2594, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __pyx_pf_10collisions_11RotatedRect_8getCache_rot(__pyx_v_rot, __pyx_int_0, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2594, __pyx_L1_error) + __pyx_t_3 = __pyx_pf_10collisions_11RotatedRect_8getCache_rot(__pyx_v_rot, __pyx_int_0, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2680, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2590 + /* "collisions.py":2676 * def rot(x, y): * return cos * x - sin * y, sin * x + cos * y * self.cache = [ # <<<<<<<<<<<<<< * (0, 0), * rot(self.w, 0), */ - __pyx_t_4 = PyList_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2590, __pyx_L1_error) + __pyx_t_4 = PyList_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2676, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_tuple__2)) __PYX_ERR(0, 2590, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_tuple__2)) __PYX_ERR(0, 2676, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 2590, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_2)) __PYX_ERR(0, 2676, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 2, __pyx_t_1)) __PYX_ERR(0, 2590, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 2, __pyx_t_1)) __PYX_ERR(0, 2676, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 3, __pyx_t_3)) __PYX_ERR(0, 2590, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 3, __pyx_t_3)) __PYX_ERR(0, 2676, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_3 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cache, __pyx_t_4) < 0) __PYX_ERR(0, 2590, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cache, __pyx_t_4) < 0) __PYX_ERR(0, 2676, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2583 + /* "collisions.py":2669 * """ * check = [self.w, self.h, self.rot] * if check != self.cacheRequirements: # <<<<<<<<<<<<<< @@ -86456,7 +89484,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_2getCache(CYTHON_UNUSED PyO */ } - /* "collisions.py":2596 + /* "collisions.py":2682 * rot(0, self.h) * ] * return [[i[0]+self.x, i[1]+self.y] for i in self.cache] # <<<<<<<<<<<<<< @@ -86465,18 +89493,18 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_2getCache(CYTHON_UNUSED PyO */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2596, __pyx_L6_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2682, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cache); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2596, __pyx_L6_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cache); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2682, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2596, __pyx_L6_error) + __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2682, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2596, __pyx_L6_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2682, __pyx_L6_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -86485,28 +89513,28 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_2getCache(CYTHON_UNUSED PyO { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2596, __pyx_L6_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2682, __pyx_L6_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2596, __pyx_L6_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2682, __pyx_L6_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2596, __pyx_L6_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2682, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2596, __pyx_L6_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2682, __pyx_L6_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2596, __pyx_L6_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2682, __pyx_L6_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2596, __pyx_L6_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2682, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -86516,7 +89544,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_2getCache(CYTHON_UNUSED PyO PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2596, __pyx_L6_error) + else __PYX_ERR(0, 2682, __pyx_L6_error) } break; } @@ -86524,31 +89552,31 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_2getCache(CYTHON_UNUSED PyO } __Pyx_XDECREF_SET(__pyx_9genexpr51__pyx_v_i, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_9genexpr51__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2596, __pyx_L6_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_9genexpr51__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2682, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2596, __pyx_L6_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2682, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2596, __pyx_L6_error) + __pyx_t_9 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2682, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_9genexpr51__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2596, __pyx_L6_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_9genexpr51__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2682, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2596, __pyx_L6_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2682, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2596, __pyx_L6_error) + __pyx_t_10 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2682, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2596, __pyx_L6_error) + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2682, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_9); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_9)) __PYX_ERR(0, 2596, __pyx_L6_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_9)) __PYX_ERR(0, 2682, __pyx_L6_error); __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_10)) __PYX_ERR(0, 2596, __pyx_L6_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_10)) __PYX_ERR(0, 2682, __pyx_L6_error); __pyx_t_9 = 0; __pyx_t_10 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 2596, __pyx_L6_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 2682, __pyx_L6_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -86563,7 +89591,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_2getCache(CYTHON_UNUSED PyO __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":2574 + /* "collisions.py":2660 * self.cacheRequirements = [] * * def getCache(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -86592,7 +89620,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_2getCache(CYTHON_UNUSED PyO return __pyx_r; } -/* "collisions.py":2598 +/* "collisions.py":2684 * return [[i[0]+self.x, i[1]+self.y] for i in self.cache] * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< @@ -86654,12 +89682,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2598, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2684, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rect") < 0)) __PYX_ERR(0, 2598, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rect") < 0)) __PYX_ERR(0, 2684, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -86670,7 +89698,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2598, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2684, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -86719,14 +89747,14 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_4rect(CYTHON_UNUSED PyObjec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rect", 1); - /* "collisions.py":2605 + /* "collisions.py":2691 * Iterable[Number]: (min x, min y, max x, max y) * """ * ps = self.toPoints() # <<<<<<<<<<<<<< * return min([i[0] for i in ps]), min([i[1] for i in ps]), max([i[0] for i in ps]), max([i[1] for i in ps]) * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2605, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -86746,14 +89774,14 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_4rect(CYTHON_UNUSED PyObjec PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2605, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2691, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_ps = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":2606 + /* "collisions.py":2692 * """ * ps = self.toPoints() * return min([i[0] for i in ps]), min([i[1] for i in ps]), max([i[0] for i in ps]), max([i[1] for i in ps]) # <<<<<<<<<<<<<< @@ -86762,16 +89790,16 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_4rect(CYTHON_UNUSED PyObjec */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2606, __pyx_L5_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2692, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_v_ps)) || PyTuple_CheckExact(__pyx_v_ps)) { __pyx_t_2 = __pyx_v_ps; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_ps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2606, __pyx_L5_error) + __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_ps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2692, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2606, __pyx_L5_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2692, __pyx_L5_error) } for (;;) { if (likely(!__pyx_t_6)) { @@ -86779,28 +89807,28 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_4rect(CYTHON_UNUSED PyObjec { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2606, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2692, __pyx_L5_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 2606, __pyx_L5_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 2692, __pyx_L5_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2606, __pyx_L5_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2692, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2606, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2692, __pyx_L5_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 2606, __pyx_L5_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 2692, __pyx_L5_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2606, __pyx_L5_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2692, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -86810,7 +89838,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_4rect(CYTHON_UNUSED PyObjec PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2606, __pyx_L5_error) + else __PYX_ERR(0, 2692, __pyx_L5_error) } break; } @@ -86818,9 +89846,9 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_4rect(CYTHON_UNUSED PyObjec } __Pyx_XDECREF_SET(__pyx_9genexpr52__pyx_v_i, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_9genexpr52__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2606, __pyx_L5_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_9genexpr52__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2692, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 2606, __pyx_L5_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 2692, __pyx_L5_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -86831,20 +89859,20 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_4rect(CYTHON_UNUSED PyObjec goto __pyx_L1_error; __pyx_L9_exit_scope:; } /* exit inner scope */ - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2606, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2606, __pyx_L12_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2692, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_v_ps)) || PyTuple_CheckExact(__pyx_v_ps)) { __pyx_t_3 = __pyx_v_ps; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_ps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2606, __pyx_L12_error) + __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_ps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2692, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2606, __pyx_L12_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2692, __pyx_L12_error) } for (;;) { if (likely(!__pyx_t_6)) { @@ -86852,28 +89880,28 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_4rect(CYTHON_UNUSED PyObjec { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2606, __pyx_L12_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2692, __pyx_L12_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 2606, __pyx_L12_error) + __pyx_t_7 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 2692, __pyx_L12_error) #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2606, __pyx_L12_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2692, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_7); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2606, __pyx_L12_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2692, __pyx_L12_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 2606, __pyx_L12_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 2692, __pyx_L12_error) #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2606, __pyx_L12_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2692, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_7); #endif } @@ -86883,7 +89911,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_4rect(CYTHON_UNUSED PyObjec PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2606, __pyx_L12_error) + else __PYX_ERR(0, 2692, __pyx_L12_error) } break; } @@ -86891,9 +89919,9 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_4rect(CYTHON_UNUSED PyObjec } __Pyx_XDECREF_SET(__pyx_9genexpr53__pyx_v_i, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_GetItemInt(__pyx_9genexpr53__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2606, __pyx_L12_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_9genexpr53__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2692, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_7); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 2606, __pyx_L12_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 2692, __pyx_L12_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -86904,20 +89932,20 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_4rect(CYTHON_UNUSED PyObjec goto __pyx_L1_error; __pyx_L16_exit_scope:; } /* exit inner scope */ - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2606, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2606, __pyx_L19_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2692, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_v_ps)) || PyTuple_CheckExact(__pyx_v_ps)) { __pyx_t_7 = __pyx_v_ps; __Pyx_INCREF(__pyx_t_7); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_ps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2606, __pyx_L19_error) + __pyx_t_5 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_ps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2692, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2606, __pyx_L19_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2692, __pyx_L19_error) } for (;;) { if (likely(!__pyx_t_6)) { @@ -86925,28 +89953,28 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_4rect(CYTHON_UNUSED PyObjec { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2606, __pyx_L19_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2692, __pyx_L19_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 2606, __pyx_L19_error) + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 2692, __pyx_L19_error) #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2606, __pyx_L19_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2692, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2606, __pyx_L19_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2692, __pyx_L19_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 2606, __pyx_L19_error) + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_8); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 2692, __pyx_L19_error) #else - __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2606, __pyx_L19_error) + __pyx_t_8 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2692, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_8); #endif } @@ -86956,7 +89984,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_4rect(CYTHON_UNUSED PyObjec PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2606, __pyx_L19_error) + else __PYX_ERR(0, 2692, __pyx_L19_error) } break; } @@ -86964,9 +89992,9 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_4rect(CYTHON_UNUSED PyObjec } __Pyx_XDECREF_SET(__pyx_9genexpr54__pyx_v_i, __pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_GetItemInt(__pyx_9genexpr54__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2606, __pyx_L19_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_9genexpr54__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2692, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_8); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 2606, __pyx_L19_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 2692, __pyx_L19_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -86977,20 +90005,20 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_4rect(CYTHON_UNUSED PyObjec goto __pyx_L1_error; __pyx_L23_exit_scope:; } /* exit inner scope */ - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2606, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2606, __pyx_L26_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2692, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_v_ps)) || PyTuple_CheckExact(__pyx_v_ps)) { __pyx_t_8 = __pyx_v_ps; __Pyx_INCREF(__pyx_t_8); __pyx_t_5 = 0; __pyx_t_6 = NULL; } else { - __pyx_t_5 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_ps); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2606, __pyx_L26_error) + __pyx_t_5 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_ps); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2692, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2606, __pyx_L26_error) + __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2692, __pyx_L26_error) } for (;;) { if (likely(!__pyx_t_6)) { @@ -86998,28 +90026,28 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_4rect(CYTHON_UNUSED PyObjec { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2606, __pyx_L26_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2692, __pyx_L26_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 2606, __pyx_L26_error) + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 2692, __pyx_L26_error) #else - __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2606, __pyx_L26_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2692, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2606, __pyx_L26_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2692, __pyx_L26_error) #endif if (__pyx_t_5 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 2606, __pyx_L26_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_5); __Pyx_INCREF(__pyx_t_9); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 2692, __pyx_L26_error) #else - __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2606, __pyx_L26_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2692, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_9); #endif } @@ -87029,7 +90057,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_4rect(CYTHON_UNUSED PyObjec PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2606, __pyx_L26_error) + else __PYX_ERR(0, 2692, __pyx_L26_error) } break; } @@ -87037,9 +90065,9 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_4rect(CYTHON_UNUSED PyObjec } __Pyx_XDECREF_SET(__pyx_9genexpr55__pyx_v_i, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_GetItemInt(__pyx_9genexpr55__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2606, __pyx_L26_error) + __pyx_t_9 = __Pyx_GetItemInt(__pyx_9genexpr55__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2692, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_9); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 2606, __pyx_L26_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 2692, __pyx_L26_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -87050,19 +90078,19 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_4rect(CYTHON_UNUSED PyObjec goto __pyx_L1_error; __pyx_L30_exit_scope:; } /* exit inner scope */ - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2606, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2606, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2692, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 2606, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2)) __PYX_ERR(0, 2692, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 2606, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3)) __PYX_ERR(0, 2692, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7)) __PYX_ERR(0, 2606, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7)) __PYX_ERR(0, 2692, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_8)) __PYX_ERR(0, 2606, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_8)) __PYX_ERR(0, 2692, __pyx_L1_error); __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_7 = 0; @@ -87071,7 +90099,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_4rect(CYTHON_UNUSED PyObjec __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2598 + /* "collisions.py":2684 * return [[i[0]+self.x, i[1]+self.y] for i in self.cache] * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< @@ -87100,7 +90128,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_4rect(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "collisions.py":2608 +/* "collisions.py":2694 * return min([i[0] for i in ps]), min([i[1] for i in ps]), max([i[0] for i in ps]), max([i[1] for i in ps]) * * def area(self) -> Number: # <<<<<<<<<<<<<< @@ -87162,12 +90190,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2608, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2694, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "area") < 0)) __PYX_ERR(0, 2608, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "area") < 0)) __PYX_ERR(0, 2694, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -87178,7 +90206,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2608, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2694, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -87216,7 +90244,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_6area(CYTHON_UNUSED PyObjec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("area", 1); - /* "collisions.py":2615 + /* "collisions.py":2701 * Number: self.w * self.h * """ * return self.w * self.h # <<<<<<<<<<<<<< @@ -87224,11 +90252,11 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_6area(CYTHON_UNUSED PyObjec * def _containsPoint(self, point: Point) -> bool: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2615, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2615, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2701, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2615, __pyx_L1_error) + __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2701, __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; @@ -87236,7 +90264,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_6area(CYTHON_UNUSED PyObjec __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2608 + /* "collisions.py":2694 * return min([i[0] for i in ps]), min([i[1] for i in ps]), max([i[0] for i in ps]), max([i[1] for i in ps]) * * def area(self) -> Number: # <<<<<<<<<<<<<< @@ -87257,7 +90285,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_6area(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "collisions.py":2617 +/* "collisions.py":2703 * return self.w * self.h * * def _containsPoint(self, point: Point) -> bool: # <<<<<<<<<<<<<< @@ -87321,7 +90349,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2617, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2703, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -87329,14 +90357,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2617, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2703, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_containsPoint", 1, 2, 2, 1); __PYX_ERR(0, 2617, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_containsPoint", 1, 2, 2, 1); __PYX_ERR(0, 2703, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_containsPoint") < 0)) __PYX_ERR(0, 2617, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_containsPoint") < 0)) __PYX_ERR(0, 2703, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -87349,7 +90377,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_containsPoint", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2617, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_containsPoint", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2703, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -87394,30 +90422,30 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_containsPoint(CYTHON_UNUS int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_containsPoint", 1); - /* "collisions.py":2618 + /* "collisions.py":2704 * * def _containsPoint(self, point: Point) -> bool: * newp = rotate((self.x, self.y), point, -self.rot) # <<<<<<<<<<<<<< * return self.x < newp[0] < (self.x+self.w) and self.y < newp[1] < (self.y+self.h) * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_rotate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2618, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_rotate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2618, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2618, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2618, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(0, 2618, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(0, 2704, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(0, 2618, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(0, 2704, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2618, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Negative(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2618, __pyx_L1_error) + __pyx_t_3 = PyNumber_Negative(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -87440,14 +90468,14 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_containsPoint(CYTHON_UNUS __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2618, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_newp = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":2619 + /* "collisions.py":2705 * def _containsPoint(self, point: Point) -> bool: * newp = rotate((self.x, self.y), point, -self.rot) * return self.x < newp[0] < (self.x+self.w) and self.y < newp[1] < (self.y+self.h) # <<<<<<<<<<<<<< @@ -87455,27 +90483,27 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_containsPoint(CYTHON_UNUS * def _collides(self, othershape: Shape) -> bool: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2619, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_newp, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2619, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_newp, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2619, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2705, __pyx_L1_error) if (__Pyx_PyObject_IsTrue(__pyx_t_5)) { __Pyx_DECREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2619, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2619, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyNumber_Add(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2619, __pyx_L1_error) + __pyx_t_8 = PyNumber_Add(__pyx_t_4, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2619, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_8, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2705, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2619, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 2705, __pyx_L1_error) if (__pyx_t_9) { __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else { @@ -87484,22 +90512,22 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_containsPoint(CYTHON_UNUS __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L3_bool_binop_done; } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2619, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_newp, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2619, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_newp, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2619, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2705, __pyx_L1_error) if (__Pyx_PyObject_IsTrue(__pyx_t_2)) { __Pyx_DECREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2619, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2619, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PyNumber_Add(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2619, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2705, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2619, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2705, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -87512,7 +90540,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_containsPoint(CYTHON_UNUS __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2617 + /* "collisions.py":2703 * return self.w * self.h * * def _containsPoint(self, point: Point) -> bool: # <<<<<<<<<<<<<< @@ -87538,7 +90566,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_8_containsPoint(CYTHON_UNUS return __pyx_r; } -/* "collisions.py":2621 +/* "collisions.py":2707 * return self.x < newp[0] < (self.x+self.w) and self.y < newp[1] < (self.y+self.h) * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< @@ -87602,7 +90630,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2621, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2707, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -87610,14 +90638,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2621, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2707, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 2621, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 2707, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_collides") < 0)) __PYX_ERR(0, 2621, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_collides") < 0)) __PYX_ERR(0, 2707, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -87630,7 +90658,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2621, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2707, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -87658,7 +90686,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10collisions_11RotatedRect_9_collides_2generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "collisions.py":2642 +/* "collisions.py":2728 * return False * if checkShpType(othershape, ShpTyps.Arc): * if any(self._collides(Point(*i)) for i in othershape.endPoints()): # <<<<<<<<<<<<<< @@ -87667,29 +90695,29 @@ static PyObject *__pyx_gb_10collisions_11RotatedRect_9_collides_2generator10(__p */ static PyObject *__pyx_pf_10collisions_11RotatedRect_9_collides_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10collisions___pyx_scope_struct_24_genexpr *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_25_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_24_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_24_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_24_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_25_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_25_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_25_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_24_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_25_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2642, __pyx_L1_error) + __PYX_ERR(0, 2728, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_23__collides *) __pyx_self; + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_24__collides *) __pyx_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_11RotatedRect_9_collides_2generator10, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_RotatedRect__collides_locals_gen, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 2642, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_11RotatedRect_9_collides_2generator10, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_RotatedRect__collides_locals_gen, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 2728, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -87707,7 +90735,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_9_collides_genexpr(PyObject static PyObject *__pyx_gb_10collisions_11RotatedRect_9_collides_2generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10collisions___pyx_scope_struct_24_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_24_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10collisions___pyx_scope_struct_25_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_25_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -87731,16 +90759,16 @@ static PyObject *__pyx_gb_10collisions_11RotatedRect_9_collides_2generator10(__p return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2642, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2642, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2728, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2728, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2642, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2642, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2728, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -87748,28 +90776,28 @@ static PyObject *__pyx_gb_10collisions_11RotatedRect_9_collides_2generator10(__p { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2642, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2728, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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_ERR(0, 2642, __pyx_L1_error) + __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_ERR(0, 2728, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2642, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2642, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2728, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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_ERR(0, 2642, __pyx_L1_error) + __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_ERR(0, 2728, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2642, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -87779,7 +90807,7 @@ static PyObject *__pyx_gb_10collisions_11RotatedRect_9_collides_2generator10(__p PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2642, __pyx_L1_error) + else __PYX_ERR(0, 2728, __pyx_L1_error) } break; } @@ -87789,14 +90817,14 @@ static PyObject *__pyx_gb_10collisions_11RotatedRect_9_collides_2generator10(__p __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2642, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2642, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2728, __pyx_L1_error) } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Point); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2642, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Point); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2642, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2642, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -87819,11 +90847,11 @@ static PyObject *__pyx_gb_10collisions_11RotatedRect_9_collides_2generator10(__p __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2642, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 2642, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 2728, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_10) { __Pyx_XDECREF(__pyx_r); @@ -87864,7 +90892,7 @@ static PyObject *__pyx_gb_10collisions_11RotatedRect_9_collides_2generator10(__p return __pyx_r; } -/* "collisions.py":2621 +/* "collisions.py":2707 * return self.x < newp[0] < (self.x+self.w) and self.y < newp[1] < (self.y+self.h) * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< @@ -87873,7 +90901,7 @@ static PyObject *__pyx_gb_10collisions_11RotatedRect_9_collides_2generator10(__p */ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { - struct __pyx_obj_10collisions___pyx_scope_struct_23__collides *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_24__collides *__pyx_cur_scope; PyObject *__pyx_v_newp = NULL; PyObject *__pyx_v_li = NULL; PyObject *__pyx_v_i = NULL; @@ -87897,11 +90925,11 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_collides", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_23__collides *)__pyx_tp_new_10collisions___pyx_scope_struct_23__collides(__pyx_ptype_10collisions___pyx_scope_struct_23__collides, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_24__collides *)__pyx_tp_new_10collisions___pyx_scope_struct_24__collides(__pyx_ptype_10collisions___pyx_scope_struct_24__collides, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_23__collides *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_24__collides *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2621, __pyx_L1_error) + __PYX_ERR(0, 2707, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -87909,14 +90937,14 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); - /* "collisions.py":2622 + /* "collisions.py":2708 * * def _collides(self, othershape: Shape) -> bool: * if not self.check_rects(othershape): # <<<<<<<<<<<<<< * return False * if checkShpType(othershape, ShpTyps.Point): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_check_rects); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2622, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_check_rects); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -87936,16 +90964,16 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_othershape}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2622, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2708, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2622, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2708, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { - /* "collisions.py":2623 + /* "collisions.py":2709 * def _collides(self, othershape: Shape) -> bool: * if not self.check_rects(othershape): * return False # <<<<<<<<<<<<<< @@ -87957,7 +90985,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":2622 + /* "collisions.py":2708 * * def _collides(self, othershape: Shape) -> bool: * if not self.check_rects(othershape): # <<<<<<<<<<<<<< @@ -87966,18 +90994,18 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P */ } - /* "collisions.py":2624 + /* "collisions.py":2710 * if not self.check_rects(othershape): * return False * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< * newp = rotate((self.x, self.y), othershape, -self.rot) * return self.x <= newp[0] <= (self.x+self.w) and self.y <= newp[1] <= (self.y+self.h) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2624, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2624, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2624, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -87999,38 +91027,38 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2624, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2710, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2624, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2710, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2625 + /* "collisions.py":2711 * return False * if checkShpType(othershape, ShpTyps.Point): * newp = rotate((self.x, self.y), othershape, -self.rot) # <<<<<<<<<<<<<< * return self.x <= newp[0] <= (self.x+self.w) and self.y <= newp[1] <= (self.y+self.h) * if checkShpType(othershape, ShpTyps.Line): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_rotate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2625, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_rotate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2625, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2625, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2625, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7)) __PYX_ERR(0, 2625, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7)) __PYX_ERR(0, 2711, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3)) __PYX_ERR(0, 2625, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_3)) __PYX_ERR(0, 2711, __pyx_L1_error); __pyx_t_7 = 0; __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_rot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2625, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_rot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2625, __pyx_L1_error) + __pyx_t_7 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -88053,14 +91081,14 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2625, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2711, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_newp = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":2626 + /* "collisions.py":2712 * if checkShpType(othershape, ShpTyps.Point): * newp = rotate((self.x, self.y), othershape, -self.rot) * return self.x <= newp[0] <= (self.x+self.w) and self.y <= newp[1] <= (self.y+self.h) # <<<<<<<<<<<<<< @@ -88068,27 +91096,27 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P * for li in self.toLines(): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2626, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_newp, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2626, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_newp, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_t_7, Py_LE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2626, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_t_2, __pyx_t_7, Py_LE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2712, __pyx_L1_error) if (__Pyx_PyObject_IsTrue(__pyx_t_8)) { __Pyx_DECREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2626, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2626, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = PyNumber_Add(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2626, __pyx_L1_error) + __pyx_t_10 = PyNumber_Add(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_8 = PyObject_RichCompare(__pyx_t_7, __pyx_t_10, Py_LE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2626, __pyx_L1_error) + __pyx_t_8 = PyObject_RichCompare(__pyx_t_7, __pyx_t_10, Py_LE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2712, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2626, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2712, __pyx_L1_error) if (__pyx_t_6) { __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { @@ -88097,22 +91125,22 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L5_bool_binop_done; } - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2626, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_newp, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2626, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_newp, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = PyObject_RichCompare(__pyx_t_8, __pyx_t_7, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2626, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_8, __pyx_t_7, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2712, __pyx_L1_error) if (__Pyx_PyObject_IsTrue(__pyx_t_2)) { __Pyx_DECREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2626, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2626, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_3 = PyNumber_Add(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2626, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2712, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2626, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_7, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2712, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -88125,7 +91153,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2624 + /* "collisions.py":2710 * if not self.check_rects(othershape): * return False * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< @@ -88134,18 +91162,18 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P */ } - /* "collisions.py":2627 + /* "collisions.py":2713 * newp = rotate((self.x, self.y), othershape, -self.rot) * return self.x <= newp[0] <= (self.x+self.w) and self.y <= newp[1] <= (self.y+self.h) * if checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< * for li in self.toLines(): * if li.collides(othershape): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2627, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2627, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Line); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2627, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Line); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; @@ -88167,22 +91195,22 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2627, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2713, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2627, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2713, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2628 + /* "collisions.py":2714 * return self.x <= newp[0] <= (self.x+self.w) and self.y <= newp[1] <= (self.y+self.h) * if checkShpType(othershape, ShpTyps.Line): * for li in self.toLines(): # <<<<<<<<<<<<<< * if li.collides(othershape): * return True */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2628, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = NULL; __pyx_t_4 = 0; @@ -88202,7 +91230,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2628, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -88211,9 +91239,9 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2628, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2628, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2714, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -88222,28 +91250,28 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2628, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2714, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 2628, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 2714, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2628, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2628, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2714, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 2628, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 2714, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2628, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -88253,7 +91281,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2628, __pyx_L1_error) + else __PYX_ERR(0, 2714, __pyx_L1_error) } break; } @@ -88262,14 +91290,14 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __Pyx_XDECREF_SET(__pyx_v_li, __pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2629 + /* "collisions.py":2715 * if checkShpType(othershape, ShpTyps.Line): * for li in self.toLines(): * if li.collides(othershape): # <<<<<<<<<<<<<< * return True * if self._collides(Point(*othershape.p1)) or self._collides(Point(*othershape.p2)): */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_li, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2629, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_li, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_7 = NULL; __pyx_t_4 = 0; @@ -88289,15 +91317,15 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_othershape}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2629, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2715, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2629, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2715, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2630 + /* "collisions.py":2716 * for li in self.toLines(): * if li.collides(othershape): * return True # <<<<<<<<<<<<<< @@ -88310,7 +91338,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":2629 + /* "collisions.py":2715 * if checkShpType(othershape, ShpTyps.Line): * for li in self.toLines(): * if li.collides(othershape): # <<<<<<<<<<<<<< @@ -88319,7 +91347,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P */ } - /* "collisions.py":2628 + /* "collisions.py":2714 * return self.x <= newp[0] <= (self.x+self.w) and self.y <= newp[1] <= (self.y+self.h) * if checkShpType(othershape, ShpTyps.Line): * for li in self.toLines(): # <<<<<<<<<<<<<< @@ -88329,23 +91357,23 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2631 + /* "collisions.py":2717 * if li.collides(othershape): * return True * if self._collides(Point(*othershape.p1)) or self._collides(Point(*othershape.p2)): # <<<<<<<<<<<<<< * return True * return False */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2631, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Point); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2631, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Point); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2631, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2631, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2631, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -88368,27 +91396,27 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2631, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2631, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2717, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (!__pyx_t_5) { } else { __pyx_t_6 = __pyx_t_5; goto __pyx_L13_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2631, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2631, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2631, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2631, __pyx_L1_error) + __pyx_t_8 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2631, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -88411,17 +91439,17 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2631, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2717, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2631, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2717, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_6 = __pyx_t_5; __pyx_L13_bool_binop_done:; if (__pyx_t_6) { - /* "collisions.py":2632 + /* "collisions.py":2718 * return True * if self._collides(Point(*othershape.p1)) or self._collides(Point(*othershape.p2)): * return True # <<<<<<<<<<<<<< @@ -88433,7 +91461,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __pyx_r = Py_True; goto __pyx_L0; - /* "collisions.py":2631 + /* "collisions.py":2717 * if li.collides(othershape): * return True * if self._collides(Point(*othershape.p1)) or self._collides(Point(*othershape.p2)): # <<<<<<<<<<<<<< @@ -88442,7 +91470,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P */ } - /* "collisions.py":2633 + /* "collisions.py":2719 * if self._collides(Point(*othershape.p1)) or self._collides(Point(*othershape.p2)): * return True * return False # <<<<<<<<<<<<<< @@ -88454,7 +91482,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":2627 + /* "collisions.py":2713 * newp = rotate((self.x, self.y), othershape, -self.rot) * return self.x <= newp[0] <= (self.x+self.w) and self.y <= newp[1] <= (self.y+self.h) * if checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< @@ -88463,18 +91491,18 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P */ } - /* "collisions.py":2634 + /* "collisions.py":2720 * return True * return False * if checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< * if self._collides(Point(othershape.x, othershape.y)): * return True */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2634, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2634, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Circle); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2634, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Circle); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -88496,28 +91524,28 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2634, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2634, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2720, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "collisions.py":2635 + /* "collisions.py":2721 * return False * if checkShpType(othershape, ShpTyps.Circle): * if self._collides(Point(othershape.x, othershape.y)): # <<<<<<<<<<<<<< * return True * for li in self.toLines(): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2635, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2635, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2635, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2635, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_10 = NULL; __pyx_t_4 = 0; @@ -88539,7 +91567,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2635, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -88562,15 +91590,15 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2635, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2721, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2635, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2721, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "collisions.py":2636 + /* "collisions.py":2722 * if checkShpType(othershape, ShpTyps.Circle): * if self._collides(Point(othershape.x, othershape.y)): * return True # <<<<<<<<<<<<<< @@ -88582,7 +91610,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __pyx_r = Py_True; goto __pyx_L0; - /* "collisions.py":2635 + /* "collisions.py":2721 * return False * if checkShpType(othershape, ShpTyps.Circle): * if self._collides(Point(othershape.x, othershape.y)): # <<<<<<<<<<<<<< @@ -88591,14 +91619,14 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P */ } - /* "collisions.py":2637 + /* "collisions.py":2723 * if self._collides(Point(othershape.x, othershape.y)): * return True * for li in self.toLines(): # <<<<<<<<<<<<<< * if li.collides(othershape): * return True */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2637, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_8 = NULL; __pyx_t_4 = 0; @@ -88618,7 +91646,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P PyObject *__pyx_callargs[2] = {__pyx_t_8, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2637, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -88627,9 +91655,9 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2637, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2637, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2723, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -88638,28 +91666,28 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2637, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2723, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 2637, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 2723, __pyx_L1_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2637, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2637, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2723, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 2637, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 2723, __pyx_L1_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2637, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2723, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -88669,7 +91697,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2637, __pyx_L1_error) + else __PYX_ERR(0, 2723, __pyx_L1_error) } break; } @@ -88678,14 +91706,14 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __Pyx_XDECREF_SET(__pyx_v_li, __pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2638 + /* "collisions.py":2724 * return True * for li in self.toLines(): * if li.collides(othershape): # <<<<<<<<<<<<<< * return True * return False */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_li, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2638, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_li, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -88705,15 +91733,15 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_othershape}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2638, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2724, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2638, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2724, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "collisions.py":2639 + /* "collisions.py":2725 * for li in self.toLines(): * if li.collides(othershape): * return True # <<<<<<<<<<<<<< @@ -88726,7 +91754,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2638 + /* "collisions.py":2724 * return True * for li in self.toLines(): * if li.collides(othershape): # <<<<<<<<<<<<<< @@ -88735,7 +91763,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P */ } - /* "collisions.py":2637 + /* "collisions.py":2723 * if self._collides(Point(othershape.x, othershape.y)): * return True * for li in self.toLines(): # <<<<<<<<<<<<<< @@ -88745,7 +91773,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2640 + /* "collisions.py":2726 * if li.collides(othershape): * return True * return False # <<<<<<<<<<<<<< @@ -88757,7 +91785,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":2634 + /* "collisions.py":2720 * return True * return False * if checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< @@ -88766,18 +91794,18 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P */ } - /* "collisions.py":2641 + /* "collisions.py":2727 * return True * return False * if checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< * if any(self._collides(Point(*i)) for i in othershape.endPoints()): * return True */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2641, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2641, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_Arc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2641, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_Arc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -88799,22 +91827,22 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2641, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2727, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2641, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2727, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2642 + /* "collisions.py":2728 * return False * if checkShpType(othershape, ShpTyps.Arc): * if any(self._collides(Point(*i)) for i in othershape.endPoints()): # <<<<<<<<<<<<<< * return True * for i in self.toLines(): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_endPoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2642, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_endPoints); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -88834,21 +91862,21 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2642, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_2 = __pyx_pf_10collisions_11RotatedRect_9_collides_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2642, __pyx_L1_error) + __pyx_t_2 = __pyx_pf_10collisions_11RotatedRect_9_collides_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2642, __pyx_L1_error) + __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2728, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2642, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2728, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2643 + /* "collisions.py":2729 * if checkShpType(othershape, ShpTyps.Arc): * if any(self._collides(Point(*i)) for i in othershape.endPoints()): * return True # <<<<<<<<<<<<<< @@ -88860,7 +91888,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __pyx_r = Py_True; goto __pyx_L0; - /* "collisions.py":2642 + /* "collisions.py":2728 * return False * if checkShpType(othershape, ShpTyps.Arc): * if any(self._collides(Point(*i)) for i in othershape.endPoints()): # <<<<<<<<<<<<<< @@ -88869,14 +91897,14 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P */ } - /* "collisions.py":2644 + /* "collisions.py":2730 * if any(self._collides(Point(*i)) for i in othershape.endPoints()): * return True * for i in self.toLines(): # <<<<<<<<<<<<<< * if othershape.collides(i): * return True */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2644, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -88896,7 +91924,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2644, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -88905,9 +91933,9 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2644, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2644, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2730, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -88916,28 +91944,28 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2644, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2730, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 2644, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 2730, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2644, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2644, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2730, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 2644, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_11); __Pyx_INCREF(__pyx_t_1); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 2730, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2644, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2730, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -88947,7 +91975,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2644, __pyx_L1_error) + else __PYX_ERR(0, 2730, __pyx_L1_error) } break; } @@ -88956,14 +91984,14 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2645 + /* "collisions.py":2731 * return True * for i in self.toLines(): * if othershape.collides(i): # <<<<<<<<<<<<<< * return True * return False */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2645, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_8 = NULL; __pyx_t_4 = 0; @@ -88983,15 +92011,15 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_i}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2645, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2731, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2645, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2731, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2646 + /* "collisions.py":2732 * for i in self.toLines(): * if othershape.collides(i): * return True # <<<<<<<<<<<<<< @@ -89004,7 +92032,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":2645 + /* "collisions.py":2731 * return True * for i in self.toLines(): * if othershape.collides(i): # <<<<<<<<<<<<<< @@ -89013,7 +92041,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P */ } - /* "collisions.py":2644 + /* "collisions.py":2730 * if any(self._collides(Point(*i)) for i in othershape.endPoints()): * return True * for i in self.toLines(): # <<<<<<<<<<<<<< @@ -89023,7 +92051,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2647 + /* "collisions.py":2733 * if othershape.collides(i): * return True * return False # <<<<<<<<<<<<<< @@ -89035,7 +92063,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":2641 + /* "collisions.py":2727 * return True * return False * if checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< @@ -89044,23 +92072,23 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P */ } - /* "collisions.py":2648 + /* "collisions.py":2734 * return True * return False * if checkShpType(othershape, ShpTyps.Rect, ShpTyps.RotRect): # <<<<<<<<<<<<<< * for li in self.toLines(): * if li.collides(othershape): */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2648, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2648, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2648, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2648, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_RotRect); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2648, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_RotRect); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -89083,22 +92111,22 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2648, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2734, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2648, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2734, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "collisions.py":2649 + /* "collisions.py":2735 * return False * if checkShpType(othershape, ShpTyps.Rect, ShpTyps.RotRect): * for li in self.toLines(): # <<<<<<<<<<<<<< * if li.collides(othershape): * return True */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2649, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_9 = NULL; __pyx_t_4 = 0; @@ -89118,7 +92146,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2649, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -89127,9 +92155,9 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __pyx_t_11 = 0; __pyx_t_12 = NULL; } else { - __pyx_t_11 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2649, __pyx_L1_error) + __pyx_t_11 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2649, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2735, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -89138,28 +92166,28 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2649, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2735, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 2649, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 2735, __pyx_L1_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2649, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2649, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2735, __pyx_L1_error) #endif if (__pyx_t_11 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 2649, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely((0 < 0))) __PYX_ERR(0, 2735, __pyx_L1_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2649, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -89169,7 +92197,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2649, __pyx_L1_error) + else __PYX_ERR(0, 2735, __pyx_L1_error) } break; } @@ -89178,14 +92206,14 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __Pyx_XDECREF_SET(__pyx_v_li, __pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2650 + /* "collisions.py":2736 * if checkShpType(othershape, ShpTyps.Rect, ShpTyps.RotRect): * for li in self.toLines(): * if li.collides(othershape): # <<<<<<<<<<<<<< * return True * return othershape.collides(Point(self.x, self.y)) or self.collides(Point(othershape.x, othershape.y)) */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_li, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2650, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_li, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_8 = NULL; __pyx_t_4 = 0; @@ -89205,15 +92233,15 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_v_othershape}; __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2650, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2736, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2650, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2736, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_6) { - /* "collisions.py":2651 + /* "collisions.py":2737 * for li in self.toLines(): * if li.collides(othershape): * return True # <<<<<<<<<<<<<< @@ -89226,7 +92254,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2650 + /* "collisions.py":2736 * if checkShpType(othershape, ShpTyps.Rect, ShpTyps.RotRect): * for li in self.toLines(): * if li.collides(othershape): # <<<<<<<<<<<<<< @@ -89235,7 +92263,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P */ } - /* "collisions.py":2649 + /* "collisions.py":2735 * return False * if checkShpType(othershape, ShpTyps.Rect, ShpTyps.RotRect): * for li in self.toLines(): # <<<<<<<<<<<<<< @@ -89245,7 +92273,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2652 + /* "collisions.py":2738 * if li.collides(othershape): * return True * return othershape.collides(Point(self.x, self.y)) or self.collides(Point(othershape.x, othershape.y)) # <<<<<<<<<<<<<< @@ -89253,13 +92281,13 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2652, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2652, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2652, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2652, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_13 = NULL; __pyx_t_4 = 0; @@ -89281,7 +92309,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2652, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -89304,11 +92332,11 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2652, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2652, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2738, __pyx_L1_error) if (!__pyx_t_6) { __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { @@ -89317,13 +92345,13 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L32_bool_binop_done; } - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2652, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2652, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2652, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2652, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_13 = NULL; __pyx_t_4 = 0; @@ -89345,7 +92373,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2652, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -89368,7 +92396,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2652, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -89380,7 +92408,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2648 + /* "collisions.py":2734 * return True * return False * if checkShpType(othershape, ShpTyps.Rect, ShpTyps.RotRect): # <<<<<<<<<<<<<< @@ -89389,7 +92417,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P */ } - /* "collisions.py":2653 + /* "collisions.py":2739 * return True * return othershape.collides(Point(self.x, self.y)) or self.collides(Point(othershape.x, othershape.y)) * return othershape._collides(self) # <<<<<<<<<<<<<< @@ -89397,7 +92425,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P * def toPoints(self) -> Iterable[pointLike]: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2653, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_9 = NULL; __pyx_t_4 = 0; @@ -89417,7 +92445,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_cur_scope->__pyx_v_self}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2653, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2739, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -89425,7 +92453,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2621 + /* "collisions.py":2707 * return self.x < newp[0] < (self.x+self.w) and self.y < newp[1] < (self.y+self.h) * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< @@ -89456,7 +92484,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_10_collides(CYTHON_UNUSED P return __pyx_r; } -/* "collisions.py":2655 +/* "collisions.py":2741 * return othershape._collides(self) * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -89518,12 +92546,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2655, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2741, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toPoints") < 0)) __PYX_ERR(0, 2655, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toPoints") < 0)) __PYX_ERR(0, 2741, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -89534,7 +92562,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("toPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2655, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("toPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2741, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -89573,7 +92601,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_12toPoints(CYTHON_UNUSED Py int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toPoints", 1); - /* "collisions.py":2660 + /* "collisions.py":2746 * Iterable[pointLike]: Get a list of all the Points that make up this object * """ * return self.getCache() # <<<<<<<<<<<<<< @@ -89581,7 +92609,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_12toPoints(CYTHON_UNUSED Py * def toLines(self) -> Iterable[Line]: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getCache); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2660, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getCache); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -89601,7 +92629,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_12toPoints(CYTHON_UNUSED Py PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2660, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2746, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -89609,7 +92637,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_12toPoints(CYTHON_UNUSED Py __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2655 + /* "collisions.py":2741 * return othershape._collides(self) * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -89630,7 +92658,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_12toPoints(CYTHON_UNUSED Py return __pyx_r; } -/* "collisions.py":2662 +/* "collisions.py":2748 * return self.getCache() * * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< @@ -89692,12 +92720,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2662, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2748, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toLines") < 0)) __PYX_ERR(0, 2662, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toLines") < 0)) __PYX_ERR(0, 2748, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -89708,7 +92736,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("toLines", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2662, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("toLines", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2748, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -89756,14 +92784,14 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_14toLines(CYTHON_UNUSED PyO int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toLines", 1); - /* "collisions.py":2667 + /* "collisions.py":2753 * Iterable[Line]: Get a list of all the Lines that make up this object * """ * ps = self.getCache() # <<<<<<<<<<<<<< * return [ * Line(ps[i], ps[i+1]) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getCache); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2667, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getCache); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -89783,14 +92811,14 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_14toLines(CYTHON_UNUSED PyO PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2667, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2753, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_v_ps = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":2668 + /* "collisions.py":2754 * """ * ps = self.getCache() * return [ # <<<<<<<<<<<<<< @@ -89799,35 +92827,35 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_14toLines(CYTHON_UNUSED PyO */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2668, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2754, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "collisions.py":2670 + /* "collisions.py":2756 * return [ * Line(ps[i], ps[i+1]) * for i in range(len(ps)-1) # <<<<<<<<<<<<<< * ] + [Line(ps[len(ps)-1], ps[0])] * */ - __pyx_t_5 = PyObject_Length(__pyx_v_ps); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2670, __pyx_L1_error) + __pyx_t_5 = PyObject_Length(__pyx_v_ps); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2756, __pyx_L1_error) __pyx_t_6 = (__pyx_t_5 - 1); __pyx_t_5 = __pyx_t_6; for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_5; __pyx_t_7+=1) { __pyx_9genexpr57__pyx_v_i = __pyx_t_7; - /* "collisions.py":2669 + /* "collisions.py":2755 * ps = self.getCache() * return [ * Line(ps[i], ps[i+1]) # <<<<<<<<<<<<<< * for i in range(len(ps)-1) * ] + [Line(ps[len(ps)-1], ps[0])] */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2669, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_ps, __pyx_9genexpr57__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2669, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_ps, __pyx_9genexpr57__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = (__pyx_9genexpr57__pyx_v_i + 1); - __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_ps, __pyx_t_9, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2669, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_ps, __pyx_t_9, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_11 = NULL; __pyx_t_4 = 0; @@ -89849,29 +92877,29 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_14toLines(CYTHON_UNUSED PyO __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2669, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2755, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2668, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2754, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } } /* exit inner scope */ - /* "collisions.py":2671 + /* "collisions.py":2757 * Line(ps[i], ps[i+1]) * for i in range(len(ps)-1) * ] + [Line(ps[len(ps)-1], ps[0])] # <<<<<<<<<<<<<< * * def copy(self) -> 'RotatedRect': */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2671, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2757, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyObject_Length(__pyx_v_ps); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2671, __pyx_L1_error) + __pyx_t_6 = PyObject_Length(__pyx_v_ps); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2757, __pyx_L1_error) __pyx_t_5 = (__pyx_t_6 - 1); - __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_ps, __pyx_t_5, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2671, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_ps, __pyx_t_5, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2757, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_ps, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2671, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_ps, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2757, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_11 = NULL; __pyx_t_4 = 0; @@ -89893,16 +92921,16 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_14toLines(CYTHON_UNUSED PyO __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2671, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2757, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2671, __pyx_L1_error) + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2757, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 2671, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 2757, __pyx_L1_error); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2671, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2757, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -89910,7 +92938,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_14toLines(CYTHON_UNUSED PyO __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":2662 + /* "collisions.py":2748 * return self.getCache() * * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< @@ -89935,7 +92963,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_14toLines(CYTHON_UNUSED PyO return __pyx_r; } -/* "collisions.py":2673 +/* "collisions.py":2759 * ] + [Line(ps[len(ps)-1], ps[0])] * * def copy(self) -> 'RotatedRect': # <<<<<<<<<<<<<< @@ -89997,12 +93025,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2673, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2759, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(0, 2673, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(0, 2759, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -90013,7 +93041,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("copy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2673, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("copy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2759, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -90058,7 +93086,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16copy(CYTHON_UNUSED PyObje int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 1); - /* "collisions.py":2677 + /* "collisions.py":2763 * Spawn in a duplicate object * """ * return RotatedRect(self.x, self.y, self.w, self.h, self.rot, self.bounciness) # <<<<<<<<<<<<<< @@ -90066,19 +93094,19 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16copy(CYTHON_UNUSED PyObje * def __setitem__(self, item: int, new: pointLike) -> None: */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_RotatedRect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2677, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_RotatedRect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2677, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2677, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2677, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2677, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rot); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2677, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rot); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2677, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_10 = 0; @@ -90104,7 +93132,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16copy(CYTHON_UNUSED PyObje __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2677, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2763, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -90112,7 +93140,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16copy(CYTHON_UNUSED PyObje __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2673 + /* "collisions.py":2759 * ] + [Line(ps[len(ps)-1], ps[0])] * * def copy(self) -> 'RotatedRect': # <<<<<<<<<<<<<< @@ -90139,7 +93167,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_16copy(CYTHON_UNUSED PyObje return __pyx_r; } -/* "collisions.py":2679 +/* "collisions.py":2765 * return RotatedRect(self.x, self.y, self.w, self.h, self.rot, self.bounciness) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< @@ -90206,7 +93234,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2679, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2765, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -90214,9 +93242,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2679, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2765, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 2679, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 2765, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -90224,14 +93252,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2679, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2765, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 2679, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 2765, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(0, 2679, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(0, 2765, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -90246,7 +93274,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 2679, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 2765, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -90260,7 +93288,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_item), (&PyInt_Type), 0, "item", 1))) __PYX_ERR(0, 2679, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_item), (&PyInt_Type), 0, "item", 1))) __PYX_ERR(0, 2765, __pyx_L1_error) __pyx_r = __pyx_pf_10collisions_11RotatedRect_18__setitem__(__pyx_self, __pyx_v_self, __pyx_v_item, __pyx_v_new); /* function exit code */ @@ -90278,7 +93306,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -/* "collisions.py":2680 +/* "collisions.py":2766 * * def __setitem__(self, item: int, new: pointLike) -> None: * def rot(x, y): # <<<<<<<<<<<<<< @@ -90342,7 +93370,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2680, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2766, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -90350,14 +93378,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2680, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2766, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("rot", 1, 2, 2, 1); __PYX_ERR(0, 2680, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rot", 1, 2, 2, 1); __PYX_ERR(0, 2766, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rot") < 0)) __PYX_ERR(0, 2680, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rot") < 0)) __PYX_ERR(0, 2766, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -90370,7 +93398,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rot", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2680, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rot", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2766, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -90398,8 +93426,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_pf_10collisions_11RotatedRect_11__setitem___rot(PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y) { - struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__ *__pyx_cur_scope; - struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__ *__pyx_outer_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_26___setitem__ *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_26___setitem__ *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -90413,10 +93441,10 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_11__setitem___rot(PyObject const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rot", 1); - __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__ *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_26___setitem__ *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; - /* "collisions.py":2681 + /* "collisions.py":2767 * def __setitem__(self, item: int, new: pointLike) -> None: * def rot(x, y): * return rotate([self.x, self.y], [x, y], self.rot) # <<<<<<<<<<<<<< @@ -90424,32 +93452,32 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_11__setitem___rot(PyObject * self.x, self.y = rot(new[0], new[1]) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_rotate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2681, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_rotate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2681, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2681, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2767, __pyx_L1_error) } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2681, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2681, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2767, __pyx_L1_error) } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2681, __pyx_L1_error) + __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(0, 2681, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_3)) __PYX_ERR(0, 2767, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(0, 2681, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_4)) __PYX_ERR(0, 2767, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_4 = 0; - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2681, __pyx_L1_error) + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_x); __Pyx_GIVEREF(__pyx_v_x); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_x)) __PYX_ERR(0, 2681, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_v_x)) __PYX_ERR(0, 2767, __pyx_L1_error); __Pyx_INCREF(__pyx_v_y); __Pyx_GIVEREF(__pyx_v_y); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_v_y)) __PYX_ERR(0, 2681, __pyx_L1_error); - if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2681, __pyx_L1_error) } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_rot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2681, __pyx_L1_error) + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_v_y)) __PYX_ERR(0, 2767, __pyx_L1_error); + if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2767, __pyx_L1_error) } + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_rot); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -90472,7 +93500,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_11__setitem___rot(PyObject __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2681, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2767, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -90480,7 +93508,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_11__setitem___rot(PyObject __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2680 + /* "collisions.py":2766 * * def __setitem__(self, item: int, new: pointLike) -> None: * def rot(x, y): # <<<<<<<<<<<<<< @@ -90504,7 +93532,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_11__setitem___rot(PyObject return __pyx_r; } -/* "collisions.py":2679 +/* "collisions.py":2765 * return RotatedRect(self.x, self.y, self.w, self.h, self.rot, self.bounciness) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< @@ -90513,7 +93541,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_11__setitem___rot(PyObject */ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__setitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_new) { - struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__ *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_26___setitem__ *__pyx_cur_scope; PyObject *__pyx_v_rot = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -90527,11 +93555,11 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__setitem__(CYTHON_UNUSED const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__ *)__pyx_tp_new_10collisions___pyx_scope_struct_25___setitem__(__pyx_ptype_10collisions___pyx_scope_struct_25___setitem__, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_26___setitem__ *)__pyx_tp_new_10collisions___pyx_scope_struct_26___setitem__(__pyx_ptype_10collisions___pyx_scope_struct_26___setitem__, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__ *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_26___setitem__ *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2679, __pyx_L1_error) + __PYX_ERR(0, 2765, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -90539,42 +93567,42 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__setitem__(CYTHON_UNUSED __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); - /* "collisions.py":2680 + /* "collisions.py":2766 * * def __setitem__(self, item: int, new: pointLike) -> None: * def rot(x, y): # <<<<<<<<<<<<<< * return rotate([self.x, self.y], [x, y], self.rot) * if item == 0: */ - __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_11__setitem___1rot, 0, __pyx_n_s_RotatedRect___setitem___locals_r, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2680, __pyx_L1_error) + __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_11__setitem___1rot, 0, __pyx_n_s_RotatedRect___setitem___locals_r, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2766, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_rot = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":2682 + /* "collisions.py":2768 * def rot(x, y): * return rotate([self.x, self.y], [x, y], self.rot) * if item == 0: # <<<<<<<<<<<<<< * self.x, self.y = rot(new[0], new[1]) * elif item == 1: */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2682, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2682, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2768, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2768, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":2683 + /* "collisions.py":2769 * return rotate([self.x, self.y], [x, y], self.rot) * if item == 0: * self.x, self.y = rot(new[0], new[1]) # <<<<<<<<<<<<<< * elif item == 1: * self.x, self.y = rot(new[0], new[1]) */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_new, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2683, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_new, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_new, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2683, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_new, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_pf_10collisions_11RotatedRect_11__setitem___rot(__pyx_v_rot, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2683, __pyx_L1_error) + __pyx_t_4 = __pyx_pf_10collisions_11RotatedRect_11__setitem___rot(__pyx_v_rot, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -90584,7 +93612,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__setitem__(CYTHON_UNUSED if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 2683, __pyx_L1_error) + __PYX_ERR(0, 2769, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -90597,15 +93625,15 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__setitem__(CYTHON_UNUSED __Pyx_INCREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_1); #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2683, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2683, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2683, __pyx_L1_error) + __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2769, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); @@ -90613,7 +93641,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__setitem__(CYTHON_UNUSED __Pyx_GOTREF(__pyx_t_3); index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 2683, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 2769, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L5_unpacking_done; @@ -90621,15 +93649,15 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__setitem__(CYTHON_UNUSED __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 2683, __pyx_L1_error) + __PYX_ERR(0, 2769, __pyx_L1_error) __pyx_L5_unpacking_done:; } - if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x, __pyx_t_3) < 0) __PYX_ERR(0, 2683, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x, __pyx_t_3) < 0) __PYX_ERR(0, 2769, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y, __pyx_t_1) < 0) __PYX_ERR(0, 2683, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y, __pyx_t_1) < 0) __PYX_ERR(0, 2769, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2682 + /* "collisions.py":2768 * def rot(x, y): * return rotate([self.x, self.y], [x, y], self.rot) * if item == 0: # <<<<<<<<<<<<<< @@ -90639,30 +93667,30 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__setitem__(CYTHON_UNUSED goto __pyx_L3; } - /* "collisions.py":2684 + /* "collisions.py":2770 * if item == 0: * self.x, self.y = rot(new[0], new[1]) * elif item == 1: # <<<<<<<<<<<<<< * self.x, self.y = rot(new[0], new[1]) * self.x -= self.w */ - __pyx_t_4 = PyObject_RichCompare(__pyx_v_item, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2684, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2684, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_v_item, __pyx_int_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2770, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2770, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { - /* "collisions.py":2685 + /* "collisions.py":2771 * self.x, self.y = rot(new[0], new[1]) * elif item == 1: * self.x, self.y = rot(new[0], new[1]) # <<<<<<<<<<<<<< * self.x -= self.w * elif item == 2: */ - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_new, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2685, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_new, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_new, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2685, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_new, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __pyx_pf_10collisions_11RotatedRect_11__setitem___rot(__pyx_v_rot, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2685, __pyx_L1_error) + __pyx_t_3 = __pyx_pf_10collisions_11RotatedRect_11__setitem___rot(__pyx_v_rot, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -90672,7 +93700,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__setitem__(CYTHON_UNUSED if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 2685, __pyx_L1_error) + __PYX_ERR(0, 2771, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -90685,15 +93713,15 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__setitem__(CYTHON_UNUSED __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_4); #else - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2685, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2685, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2685, __pyx_L1_error) + __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2771, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); @@ -90701,7 +93729,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__setitem__(CYTHON_UNUSED __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed; __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 2685, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 2771, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L7_unpacking_done; @@ -90709,33 +93737,33 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__setitem__(CYTHON_UNUSED __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 2685, __pyx_L1_error) + __PYX_ERR(0, 2771, __pyx_L1_error) __pyx_L7_unpacking_done:; } - if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x, __pyx_t_1) < 0) __PYX_ERR(0, 2685, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x, __pyx_t_1) < 0) __PYX_ERR(0, 2771, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y, __pyx_t_4) < 0) __PYX_ERR(0, 2685, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y, __pyx_t_4) < 0) __PYX_ERR(0, 2771, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2686 + /* "collisions.py":2772 * elif item == 1: * self.x, self.y = rot(new[0], new[1]) * self.x -= self.w # <<<<<<<<<<<<<< * elif item == 2: * self.x, self.y = rot(new[0], new[1]) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2686, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2686, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2686, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2772, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x, __pyx_t_1) < 0) __PYX_ERR(0, 2686, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x, __pyx_t_1) < 0) __PYX_ERR(0, 2772, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2684 + /* "collisions.py":2770 * if item == 0: * self.x, self.y = rot(new[0], new[1]) * elif item == 1: # <<<<<<<<<<<<<< @@ -90745,30 +93773,30 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__setitem__(CYTHON_UNUSED goto __pyx_L3; } - /* "collisions.py":2687 + /* "collisions.py":2773 * self.x, self.y = rot(new[0], new[1]) * self.x -= self.w * elif item == 2: # <<<<<<<<<<<<<< * self.x, self.y = rot(new[0], new[1]) * self.x -= self.w */ - __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2687, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2687, __pyx_L1_error) + __pyx_t_1 = PyObject_RichCompare(__pyx_v_item, __pyx_int_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2773, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2773, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_2) { - /* "collisions.py":2688 + /* "collisions.py":2774 * self.x -= self.w * elif item == 2: * self.x, self.y = rot(new[0], new[1]) # <<<<<<<<<<<<<< * self.x -= self.w * self.y -= self.h */ - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_new, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2688, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_new, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_new, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2688, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_new, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __pyx_pf_10collisions_11RotatedRect_11__setitem___rot(__pyx_v_rot, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2688, __pyx_L1_error) + __pyx_t_3 = __pyx_pf_10collisions_11RotatedRect_11__setitem___rot(__pyx_v_rot, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -90778,7 +93806,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__setitem__(CYTHON_UNUSED if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 2688, __pyx_L1_error) + __PYX_ERR(0, 2774, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -90791,15 +93819,15 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__setitem__(CYTHON_UNUSED __Pyx_INCREF(__pyx_t_4); __Pyx_INCREF(__pyx_t_1); #else - __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2688, __pyx_L1_error) + __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2688, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } else { Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2688, __pyx_L1_error) + __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2774, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); @@ -90807,7 +93835,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__setitem__(CYTHON_UNUSED __Pyx_GOTREF(__pyx_t_4); index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 2688, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 2774, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L9_unpacking_done; @@ -90815,51 +93843,51 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__setitem__(CYTHON_UNUSED __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 2688, __pyx_L1_error) + __PYX_ERR(0, 2774, __pyx_L1_error) __pyx_L9_unpacking_done:; } - if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x, __pyx_t_4) < 0) __PYX_ERR(0, 2688, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x, __pyx_t_4) < 0) __PYX_ERR(0, 2774, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y, __pyx_t_1) < 0) __PYX_ERR(0, 2688, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y, __pyx_t_1) < 0) __PYX_ERR(0, 2774, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2689 + /* "collisions.py":2775 * elif item == 2: * self.x, self.y = rot(new[0], new[1]) * self.x -= self.w # <<<<<<<<<<<<<< * self.y -= self.h * elif item == 3: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2689, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2775, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2689, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2775, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2689, __pyx_L1_error) + __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2775, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x, __pyx_t_4) < 0) __PYX_ERR(0, 2689, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x, __pyx_t_4) < 0) __PYX_ERR(0, 2775, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2690 + /* "collisions.py":2776 * self.x, self.y = rot(new[0], new[1]) * self.x -= self.w * self.y -= self.h # <<<<<<<<<<<<<< * elif item == 3: * self.x, self.y = rot(new[0], new[1]) */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2690, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2690, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2690, __pyx_L1_error) + __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2776, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y, __pyx_t_3) < 0) __PYX_ERR(0, 2690, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y, __pyx_t_3) < 0) __PYX_ERR(0, 2776, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2687 + /* "collisions.py":2773 * self.x, self.y = rot(new[0], new[1]) * self.x -= self.w * elif item == 2: # <<<<<<<<<<<<<< @@ -90869,30 +93897,30 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__setitem__(CYTHON_UNUSED goto __pyx_L3; } - /* "collisions.py":2691 + /* "collisions.py":2777 * self.x -= self.w * self.y -= self.h * elif item == 3: # <<<<<<<<<<<<<< * self.x, self.y = rot(new[0], new[1]) * self.y -= self.h */ - __pyx_t_3 = PyObject_RichCompare(__pyx_v_item, __pyx_int_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2691, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2691, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_item, __pyx_int_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2777, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2777, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (likely(__pyx_t_2)) { - /* "collisions.py":2692 + /* "collisions.py":2778 * self.y -= self.h * elif item == 3: * self.x, self.y = rot(new[0], new[1]) # <<<<<<<<<<<<<< * self.y -= self.h * else: */ - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_new, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2692, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_new, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_new, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2692, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_new, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __pyx_pf_10collisions_11RotatedRect_11__setitem___rot(__pyx_v_rot, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2692, __pyx_L1_error) + __pyx_t_4 = __pyx_pf_10collisions_11RotatedRect_11__setitem___rot(__pyx_v_rot, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -90902,7 +93930,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__setitem__(CYTHON_UNUSED if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 2692, __pyx_L1_error) + __PYX_ERR(0, 2778, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -90915,15 +93943,15 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__setitem__(CYTHON_UNUSED __Pyx_INCREF(__pyx_t_1); __Pyx_INCREF(__pyx_t_3); #else - __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2692, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2692, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else { Py_ssize_t index = -1; - __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2692, __pyx_L1_error) + __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2778, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); @@ -90931,7 +93959,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__setitem__(CYTHON_UNUSED __Pyx_GOTREF(__pyx_t_1); index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L10_unpacking_failed; __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 2692, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 2778, __pyx_L1_error) __pyx_t_6 = NULL; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; goto __pyx_L11_unpacking_done; @@ -90939,33 +93967,33 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__setitem__(CYTHON_UNUSED __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_6 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 2692, __pyx_L1_error) + __PYX_ERR(0, 2778, __pyx_L1_error) __pyx_L11_unpacking_done:; } - if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x, __pyx_t_1) < 0) __PYX_ERR(0, 2692, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_x, __pyx_t_1) < 0) __PYX_ERR(0, 2778, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y, __pyx_t_3) < 0) __PYX_ERR(0, 2692, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y, __pyx_t_3) < 0) __PYX_ERR(0, 2778, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2693 + /* "collisions.py":2779 * elif item == 3: * self.x, self.y = rot(new[0], new[1]) * self.y -= self.h # <<<<<<<<<<<<<< * else: * raise IndexError( */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2693, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2693, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2693, __pyx_L1_error) + __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y, __pyx_t_1) < 0) __PYX_ERR(0, 2693, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_y, __pyx_t_1) < 0) __PYX_ERR(0, 2779, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2691 + /* "collisions.py":2777 * self.x -= self.w * self.y -= self.h * elif item == 3: # <<<<<<<<<<<<<< @@ -90975,7 +94003,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__setitem__(CYTHON_UNUSED goto __pyx_L3; } - /* "collisions.py":2695 + /* "collisions.py":2781 * self.y -= self.h * else: * raise IndexError( # <<<<<<<<<<<<<< @@ -90984,36 +94012,36 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__setitem__(CYTHON_UNUSED */ /*else*/ { - /* "collisions.py":2696 + /* "collisions.py":2782 * else: * raise IndexError( * 'List index out of range! Must be 0-3, found: '+str(item) # <<<<<<<<<<<<<< * ) * */ - __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2696, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Unicode(__pyx_v_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_List_index_out_of_range_Must_be_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2696, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_List_index_out_of_range_Must_be_4, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2782, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2695 + /* "collisions.py":2781 * self.y -= self.h * else: * raise IndexError( # <<<<<<<<<<<<<< * 'List index out of range! Must be 0-3, found: '+str(item) * ) */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2695, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 2695, __pyx_L1_error) + __PYX_ERR(0, 2781, __pyx_L1_error) } __pyx_L3:; - /* "collisions.py":2679 + /* "collisions.py":2765 * return RotatedRect(self.x, self.y, self.w, self.h, self.rot, self.bounciness) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< @@ -91039,7 +94067,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_18__setitem__(CYTHON_UNUSED return __pyx_r; } -/* "collisions.py":2699 +/* "collisions.py":2785 * ) * * def __str__(self): # <<<<<<<<<<<<<< @@ -91100,12 +94128,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2699, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2785, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 2699, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 2785, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -91116,7 +94144,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2699, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2785, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -91158,7 +94186,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_20__str__(CYTHON_UNUSED PyO int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 1); - /* "collisions.py":2700 + /* "collisions.py":2786 * * def __str__(self): * return f'' # <<<<<<<<<<<<<< @@ -91166,7 +94194,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_20__str__(CYTHON_UNUSED PyO * class Polygon(ClosedShape): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2700, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 127; @@ -91174,9 +94202,9 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_20__str__(CYTHON_UNUSED PyO __pyx_t_2 += 16; __Pyx_GIVEREF(__pyx_kp_u_RotatedRect_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_RotatedRect_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2700, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2700, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; @@ -91184,13 +94212,13 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_20__str__(CYTHON_UNUSED PyO __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); __pyx_t_5 = 0; - __Pyx_INCREF(__pyx_kp_u__6); + __Pyx_INCREF(__pyx_kp_u__8); __pyx_t_2 += 2; - __Pyx_GIVEREF(__pyx_kp_u__6); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2700, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_kp_u__8); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__8); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2700, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; @@ -91202,9 +94230,9 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_20__str__(CYTHON_UNUSED PyO __pyx_t_2 += 19; __Pyx_GIVEREF(__pyx_kp_u_with_dimensions_2); PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_with_dimensions_2); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2700, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2700, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; @@ -91216,9 +94244,9 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_20__str__(CYTHON_UNUSED PyO __pyx_t_2 += 1; __Pyx_GIVEREF(__pyx_n_u_x); PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_n_u_x); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2700, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2700, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; @@ -91230,9 +94258,9 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_20__str__(CYTHON_UNUSED PyO __pyx_t_2 += 10; __Pyx_GIVEREF(__pyx_kp_u_rotated); PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_kp_u_rotated); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2700, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2700, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; @@ -91245,7 +94273,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_20__str__(CYTHON_UNUSED PyO __pyx_t_2 += __Pyx_PyUnicode_GET_LENGTH(__pyx_kp_u_to_have_points); __Pyx_GIVEREF(__pyx_kp_u_to_have_points); PyTuple_SET_ITEM(__pyx_t_1, 10, __pyx_kp_u_to_have_points); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2700, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_6 = NULL; __pyx_t_7 = 0; @@ -91265,11 +94293,11 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_20__str__(CYTHON_UNUSED PyO PyObject *__pyx_callargs[2] = {__pyx_t_6, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_7, 0+__pyx_t_7); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2700, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } - __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2700, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_3; @@ -91277,18 +94305,18 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_20__str__(CYTHON_UNUSED PyO __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_1, 11, __pyx_t_4); __pyx_t_4 = 0; - __Pyx_INCREF(__pyx_kp_u__5); + __Pyx_INCREF(__pyx_kp_u__7); __pyx_t_2 += 1; - __Pyx_GIVEREF(__pyx_kp_u__5); - PyTuple_SET_ITEM(__pyx_t_1, 12, __pyx_kp_u__5); - __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 13, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2700, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_kp_u__7); + PyTuple_SET_ITEM(__pyx_t_1, 12, __pyx_kp_u__7); + __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 13, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_4; __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":2699 + /* "collisions.py":2785 * ) * * def __str__(self): # <<<<<<<<<<<<<< @@ -91310,7 +94338,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_20__str__(CYTHON_UNUSED PyO return __pyx_r; } -/* "collisions.py":2705 +/* "collisions.py":2791 * """A convex or concave polygon. It is defined with a list of points.""" * TYPE = ShpTyps.Polygon * def __init__(self, *points: pointLike, errorOnLT3: bool = True, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< @@ -91318,7 +94346,7 @@ static PyObject *__pyx_pf_10collisions_11RotatedRect_20__str__(CYTHON_UNUSED PyO * Args: */ -static PyObject *__pyx_pf_10collisions_64__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { +static PyObject *__pyx_pf_10collisions_66__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -91328,20 +94356,20 @@ static PyObject *__pyx_pf_10collisions_64__defaults__(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2705, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_errorOnLT3, ((PyObject *)Py_True)) < 0) __PYX_ERR(0, 2705, __pyx_L1_error) - __pyx_t_2 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults23, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2705, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_errorOnLT3, ((PyObject *)Py_True)) < 0) __PYX_ERR(0, 2791, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults24, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_bounciness, __pyx_t_2) < 0) __PYX_ERR(0, 2705, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_bounciness, __pyx_t_2) < 0) __PYX_ERR(0, 2791, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2705, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 2705, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 2791, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 2705, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 2791, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -91407,7 +94435,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_GOTREF(__pyx_v_points); { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_errorOnLT3,&__pyx_n_s_bounciness,0}; - __pyx_defaults23 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults23, __pyx_self); + __pyx_defaults24 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults24, __pyx_self); values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)((PyObject *)Py_True))); if (__pyx_kwds) { Py_ssize_t kw_args; @@ -91424,7 +94452,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2705, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2791, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (kw_args > 0 && likely(kw_args <= 2)) { @@ -91432,13 +94460,13 @@ PyObject *__pyx_args, PyObject *__pyx_kwds for (index = 1; index < 3 && kw_args > 0; index++) { PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2705, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2791, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; const Py_ssize_t used_pos_args = (kwd_pos_args < 1) ? kwd_pos_args : 1; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 2705, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 2791, __pyx_L3_error) } } else if (unlikely(__pyx_nargs < 1)) { goto __pyx_L5_argtuple_error; @@ -91448,14 +94476,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __pyx_v_self = values[0]; __pyx_v_errorOnLT3 = values[1]; if (values[2]) { - __pyx_v_bounciness = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_bounciness == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2705, __pyx_L3_error) + __pyx_v_bounciness = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_bounciness == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2791, __pyx_L3_error) } else { __pyx_v_bounciness = __pyx_dynamic_args->__pyx_arg_bounciness; } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, __pyx_nargs); __PYX_ERR(0, 2705, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 1, __pyx_nargs); __PYX_ERR(0, 2791, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -91502,7 +94530,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon___init__(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__init__", 1); - /* "collisions.py":2716 + /* "collisions.py":2802 * ValueError: When you have a polygon with <3 points. * """ * super().__init__(bounciness) # <<<<<<<<<<<<<< @@ -91510,23 +94538,23 @@ static PyObject *__pyx_pf_10collisions_7Polygon___init__(CYTHON_UNUSED PyObject * raise ValueError( */ __pyx_t_2 = __Pyx_CyFunction_GetClassObj(__pyx_self); - if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 2716, __pyx_L1_error) } + if (!__pyx_t_2) { PyErr_SetString(PyExc_SystemError, "super(): empty __class__ cell"); __PYX_ERR(0, 2802, __pyx_L1_error) } __Pyx_INCREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2716, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 2716, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 2802, __pyx_L1_error); __Pyx_INCREF(__pyx_v_self); __Pyx_GIVEREF(__pyx_v_self); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(0, 2716, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self)) __PYX_ERR(0, 2802, __pyx_L1_error); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2716, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2716, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2716, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -91547,39 +94575,39 @@ static PyObject *__pyx_pf_10collisions_7Polygon___init__(CYTHON_UNUSED PyObject __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2716, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2717 + /* "collisions.py":2803 * """ * super().__init__(bounciness) * if len(points) < 3 and errorOnLT3: # <<<<<<<<<<<<<< * raise ValueError( * f'Cannot have a Polygon with less than 3 points! Found: {len(points)} points!' */ - __pyx_t_7 = __Pyx_PyTuple_GET_SIZE(__pyx_v_points); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2717, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyTuple_GET_SIZE(__pyx_v_points); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2803, __pyx_L1_error) __pyx_t_8 = (__pyx_t_7 < 3); if (__pyx_t_8) { } else { __pyx_t_6 = __pyx_t_8; goto __pyx_L4_bool_binop_done; } - __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_errorOnLT3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 2717, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_errorOnLT3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 2803, __pyx_L1_error) __pyx_t_6 = __pyx_t_8; __pyx_L4_bool_binop_done:; if (unlikely(__pyx_t_6)) { - /* "collisions.py":2719 + /* "collisions.py":2805 * if len(points) < 3 and errorOnLT3: * raise ValueError( * f'Cannot have a Polygon with less than 3 points! Found: {len(points)} points!' # <<<<<<<<<<<<<< * ) * self.points = list(points) */ - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2719, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = 0; __pyx_t_9 = 127; @@ -91587,8 +94615,8 @@ static PyObject *__pyx_pf_10collisions_7Polygon___init__(CYTHON_UNUSED PyObject __pyx_t_7 += 54; __Pyx_GIVEREF(__pyx_kp_u_Cannot_have_a_Polygon_with_less); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Cannot_have_a_Polygon_with_less); - __pyx_t_10 = __Pyx_PyTuple_GET_SIZE(__pyx_v_points); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2719, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_10, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2719, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyTuple_GET_SIZE(__pyx_v_points); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2805, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_t_10, 0, ' ', 'd'); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_7 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); @@ -91598,25 +94626,25 @@ static PyObject *__pyx_pf_10collisions_7Polygon___init__(CYTHON_UNUSED PyObject __pyx_t_7 += 8; __Pyx_GIVEREF(__pyx_kp_u_points); PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_points); - __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2719, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2805, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2718 + /* "collisions.py":2804 * super().__init__(bounciness) * if len(points) < 3 and errorOnLT3: * raise ValueError( # <<<<<<<<<<<<<< * f'Cannot have a Polygon with less than 3 points! Found: {len(points)} points!' * ) */ - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2718, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2804, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_Raise(__pyx_t_1, 0, 0, 0); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __PYX_ERR(0, 2718, __pyx_L1_error) + __PYX_ERR(0, 2804, __pyx_L1_error) - /* "collisions.py":2717 + /* "collisions.py":2803 * """ * super().__init__(bounciness) * if len(points) < 3 and errorOnLT3: # <<<<<<<<<<<<<< @@ -91625,19 +94653,19 @@ static PyObject *__pyx_pf_10collisions_7Polygon___init__(CYTHON_UNUSED PyObject */ } - /* "collisions.py":2721 + /* "collisions.py":2807 * f'Cannot have a Polygon with less than 3 points! Found: {len(points)} points!' * ) * self.points = list(points) # <<<<<<<<<<<<<< * * @property */ - __pyx_t_1 = PySequence_List(__pyx_v_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2721, __pyx_L1_error) + __pyx_t_1 = PySequence_List(__pyx_v_points); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2807, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_points_2, __pyx_t_1) < 0) __PYX_ERR(0, 2721, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_points_2, __pyx_t_1) < 0) __PYX_ERR(0, 2807, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2705 + /* "collisions.py":2791 * """A convex or concave polygon. It is defined with a list of points.""" * TYPE = ShpTyps.Polygon * def __init__(self, *points: pointLike, errorOnLT3: bool = True, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< @@ -91661,7 +94689,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon___init__(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":2723 +/* "collisions.py":2809 * self.points = list(points) * * @property # <<<<<<<<<<<<<< @@ -91723,12 +94751,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2723, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2809, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "x") < 0)) __PYX_ERR(0, 2723, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "x") < 0)) __PYX_ERR(0, 2809, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -91739,7 +94767,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("x", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2723, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("x", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2809, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -91780,7 +94808,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_2x(CYTHON_UNUSED PyObject *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("x", 1); - /* "collisions.py":2726 + /* "collisions.py":2812 * def x(self): * """One of this object's points' x value. Changing this will move the other points by the difference!""" * return min([i[0] for i in self.points]) # <<<<<<<<<<<<<< @@ -91789,18 +94817,18 @@ static PyObject *__pyx_pf_10collisions_7Polygon_2x(CYTHON_UNUSED PyObject *__pyx */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2726, __pyx_L5_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2812, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2726, __pyx_L5_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2812, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2726, __pyx_L5_error) + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2812, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2726, __pyx_L5_error) + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2812, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -91809,28 +94837,28 @@ static PyObject *__pyx_pf_10collisions_7Polygon_2x(CYTHON_UNUSED PyObject *__pyx { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2726, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2812, __pyx_L5_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2726, __pyx_L5_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2812, __pyx_L5_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2726, __pyx_L5_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2812, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2726, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2812, __pyx_L5_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2726, __pyx_L5_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2812, __pyx_L5_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2726, __pyx_L5_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2812, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -91840,7 +94868,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_2x(CYTHON_UNUSED PyObject *__pyx PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2726, __pyx_L5_error) + else __PYX_ERR(0, 2812, __pyx_L5_error) } break; } @@ -91848,9 +94876,9 @@ static PyObject *__pyx_pf_10collisions_7Polygon_2x(CYTHON_UNUSED PyObject *__pyx } __Pyx_XDECREF_SET(__pyx_9genexpr58__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_9genexpr58__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2726, __pyx_L5_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_9genexpr58__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2812, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2726, __pyx_L5_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2812, __pyx_L5_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -91861,14 +94889,14 @@ static PyObject *__pyx_pf_10collisions_7Polygon_2x(CYTHON_UNUSED PyObject *__pyx goto __pyx_L1_error; __pyx_L9_exit_scope:; } /* exit inner scope */ - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2726, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2812, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2723 + /* "collisions.py":2809 * self.points = list(points) * * @property # <<<<<<<<<<<<<< @@ -91890,7 +94918,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_2x(CYTHON_UNUSED PyObject *__pyx return __pyx_r; } -/* "collisions.py":2727 +/* "collisions.py":2813 * """One of this object's points' x value. Changing this will move the other points by the difference!""" * return min([i[0] for i in self.points]) * @x.setter # <<<<<<<<<<<<<< @@ -91954,7 +94982,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2727, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2813, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -91962,14 +94990,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2727, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2813, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("x", 1, 2, 2, 1); __PYX_ERR(0, 2727, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("x", 1, 2, 2, 1); __PYX_ERR(0, 2813, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "x") < 0)) __PYX_ERR(0, 2727, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "x") < 0)) __PYX_ERR(0, 2813, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -91982,7 +95010,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("x", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2727, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("x", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2813, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -92026,22 +95054,22 @@ static PyObject *__pyx_pf_10collisions_7Polygon_4x(CYTHON_UNUSED PyObject *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("x", 1); - /* "collisions.py":2729 + /* "collisions.py":2815 * @x.setter * def x(self, new): * diff = new - self.x # <<<<<<<<<<<<<< * self.points = [[i[0]+diff, i[1]] for i in self.points] * @property */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2729, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Subtract(__pyx_v_new, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2729, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_v_new, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2815, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_diff = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":2730 + /* "collisions.py":2816 * def x(self, new): * diff = new - self.x * self.points = [[i[0]+diff, i[1]] for i in self.points] # <<<<<<<<<<<<<< @@ -92049,18 +95077,18 @@ static PyObject *__pyx_pf_10collisions_7Polygon_4x(CYTHON_UNUSED PyObject *__pyx * def y(self): */ { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2730, __pyx_L5_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2816, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2730, __pyx_L5_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2816, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2730, __pyx_L5_error) + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2816, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2730, __pyx_L5_error) + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2816, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -92069,28 +95097,28 @@ static PyObject *__pyx_pf_10collisions_7Polygon_4x(CYTHON_UNUSED PyObject *__pyx { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2730, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2816, __pyx_L5_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2730, __pyx_L5_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2816, __pyx_L5_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2730, __pyx_L5_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2816, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2730, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2816, __pyx_L5_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2730, __pyx_L5_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2816, __pyx_L5_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2730, __pyx_L5_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2816, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -92100,7 +95128,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_4x(CYTHON_UNUSED PyObject *__pyx PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2730, __pyx_L5_error) + else __PYX_ERR(0, 2816, __pyx_L5_error) } break; } @@ -92108,22 +95136,22 @@ static PyObject *__pyx_pf_10collisions_7Polygon_4x(CYTHON_UNUSED PyObject *__pyx } __Pyx_XDECREF_SET(__pyx_9genexpr59__pyx_v_i, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_9genexpr59__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2730, __pyx_L5_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_9genexpr59__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2816, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_v_diff); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2730, __pyx_L5_error) + __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_v_diff); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2816, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_9genexpr59__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2730, __pyx_L5_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_9genexpr59__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2816, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2730, __pyx_L5_error) + __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2816, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_6)) __PYX_ERR(0, 2730, __pyx_L5_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_6)) __PYX_ERR(0, 2816, __pyx_L5_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_1)) __PYX_ERR(0, 2730, __pyx_L5_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_1)) __PYX_ERR(0, 2816, __pyx_L5_error); __pyx_t_6 = 0; __pyx_t_1 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 2730, __pyx_L5_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 2816, __pyx_L5_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -92134,10 +95162,10 @@ static PyObject *__pyx_pf_10collisions_7Polygon_4x(CYTHON_UNUSED PyObject *__pyx goto __pyx_L1_error; __pyx_L9_exit_scope:; } /* exit inner scope */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_points_2, __pyx_t_2) < 0) __PYX_ERR(0, 2730, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_points_2, __pyx_t_2) < 0) __PYX_ERR(0, 2816, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2727 + /* "collisions.py":2813 * """One of this object's points' x value. Changing this will move the other points by the difference!""" * return min([i[0] for i in self.points]) * @x.setter # <<<<<<<<<<<<<< @@ -92164,7 +95192,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_4x(CYTHON_UNUSED PyObject *__pyx return __pyx_r; } -/* "collisions.py":2731 +/* "collisions.py":2817 * diff = new - self.x * self.points = [[i[0]+diff, i[1]] for i in self.points] * @property # <<<<<<<<<<<<<< @@ -92226,12 +95254,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2731, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2817, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "y") < 0)) __PYX_ERR(0, 2731, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "y") < 0)) __PYX_ERR(0, 2817, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -92242,7 +95270,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("y", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2731, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("y", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2817, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -92283,7 +95311,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_6y(CYTHON_UNUSED PyObject *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("y", 1); - /* "collisions.py":2734 + /* "collisions.py":2820 * def y(self): * """One of this object's points' y value. Changing this will move the other points by the difference!""" * return min([i[1] for i in self.points]) # <<<<<<<<<<<<<< @@ -92292,18 +95320,18 @@ static PyObject *__pyx_pf_10collisions_7Polygon_6y(CYTHON_UNUSED PyObject *__pyx */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2734, __pyx_L5_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2820, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2734, __pyx_L5_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2820, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2734, __pyx_L5_error) + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2820, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2734, __pyx_L5_error) + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2820, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -92312,28 +95340,28 @@ static PyObject *__pyx_pf_10collisions_7Polygon_6y(CYTHON_UNUSED PyObject *__pyx { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2734, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2820, __pyx_L5_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2734, __pyx_L5_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2820, __pyx_L5_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2734, __pyx_L5_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2820, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2734, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2820, __pyx_L5_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2734, __pyx_L5_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2820, __pyx_L5_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2734, __pyx_L5_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2820, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -92343,7 +95371,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_6y(CYTHON_UNUSED PyObject *__pyx PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2734, __pyx_L5_error) + else __PYX_ERR(0, 2820, __pyx_L5_error) } break; } @@ -92351,9 +95379,9 @@ static PyObject *__pyx_pf_10collisions_7Polygon_6y(CYTHON_UNUSED PyObject *__pyx } __Pyx_XDECREF_SET(__pyx_9genexpr60__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_9genexpr60__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2734, __pyx_L5_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_9genexpr60__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2820, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2734, __pyx_L5_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2820, __pyx_L5_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -92364,14 +95392,14 @@ static PyObject *__pyx_pf_10collisions_7Polygon_6y(CYTHON_UNUSED PyObject *__pyx goto __pyx_L1_error; __pyx_L9_exit_scope:; } /* exit inner scope */ - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2734, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2820, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_3; __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2731 + /* "collisions.py":2817 * diff = new - self.x * self.points = [[i[0]+diff, i[1]] for i in self.points] * @property # <<<<<<<<<<<<<< @@ -92393,7 +95421,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_6y(CYTHON_UNUSED PyObject *__pyx return __pyx_r; } -/* "collisions.py":2735 +/* "collisions.py":2821 * """One of this object's points' y value. Changing this will move the other points by the difference!""" * return min([i[1] for i in self.points]) * @y.setter # <<<<<<<<<<<<<< @@ -92457,7 +95485,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2735, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2821, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -92465,14 +95493,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2735, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2821, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("y", 1, 2, 2, 1); __PYX_ERR(0, 2735, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("y", 1, 2, 2, 1); __PYX_ERR(0, 2821, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "y") < 0)) __PYX_ERR(0, 2735, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "y") < 0)) __PYX_ERR(0, 2821, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -92485,7 +95513,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("y", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2735, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("y", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2821, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -92529,22 +95557,22 @@ static PyObject *__pyx_pf_10collisions_7Polygon_8y(CYTHON_UNUSED PyObject *__pyx int __pyx_clineno = 0; __Pyx_RefNannySetupContext("y", 1); - /* "collisions.py":2737 + /* "collisions.py":2823 * @y.setter * def y(self, new): * diff = new - self.y # <<<<<<<<<<<<<< * self.points = [[i[0], i[1]+diff] for i in self.points] * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2737, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Subtract(__pyx_v_new, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2737, __pyx_L1_error) + __pyx_t_2 = PyNumber_Subtract(__pyx_v_new, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2823, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_diff = __pyx_t_2; __pyx_t_2 = 0; - /* "collisions.py":2738 + /* "collisions.py":2824 * def y(self, new): * diff = new - self.y * self.points = [[i[0], i[1]+diff] for i in self.points] # <<<<<<<<<<<<<< @@ -92552,18 +95580,18 @@ static PyObject *__pyx_pf_10collisions_7Polygon_8y(CYTHON_UNUSED PyObject *__pyx * def rect(self) -> Iterable[Number]: */ { /* enter inner scope */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2738, __pyx_L5_error) + __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2824, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2738, __pyx_L5_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2824, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2738, __pyx_L5_error) + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2824, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2738, __pyx_L5_error) + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2824, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -92572,28 +95600,28 @@ static PyObject *__pyx_pf_10collisions_7Polygon_8y(CYTHON_UNUSED PyObject *__pyx { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2738, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2824, __pyx_L5_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2738, __pyx_L5_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2824, __pyx_L5_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2738, __pyx_L5_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2824, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2738, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2824, __pyx_L5_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2738, __pyx_L5_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2824, __pyx_L5_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2738, __pyx_L5_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2824, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -92603,7 +95631,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_8y(CYTHON_UNUSED PyObject *__pyx PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2738, __pyx_L5_error) + else __PYX_ERR(0, 2824, __pyx_L5_error) } break; } @@ -92611,22 +95639,22 @@ static PyObject *__pyx_pf_10collisions_7Polygon_8y(CYTHON_UNUSED PyObject *__pyx } __Pyx_XDECREF_SET(__pyx_9genexpr61__pyx_v_i, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_9genexpr61__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2738, __pyx_L5_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_9genexpr61__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2824, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_9genexpr61__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2738, __pyx_L5_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_9genexpr61__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2824, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_v_diff); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2738, __pyx_L5_error) + __pyx_t_7 = PyNumber_Add(__pyx_t_6, __pyx_v_diff); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2824, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2738, __pyx_L5_error) + __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2824, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(0, 2738, __pyx_L5_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_1)) __PYX_ERR(0, 2824, __pyx_L5_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_7)) __PYX_ERR(0, 2738, __pyx_L5_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_7)) __PYX_ERR(0, 2824, __pyx_L5_error); __pyx_t_1 = 0; __pyx_t_7 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 2738, __pyx_L5_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 2824, __pyx_L5_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -92637,10 +95665,10 @@ static PyObject *__pyx_pf_10collisions_7Polygon_8y(CYTHON_UNUSED PyObject *__pyx goto __pyx_L1_error; __pyx_L9_exit_scope:; } /* exit inner scope */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_points_2, __pyx_t_2) < 0) __PYX_ERR(0, 2738, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_points_2, __pyx_t_2) < 0) __PYX_ERR(0, 2824, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2735 + /* "collisions.py":2821 * """One of this object's points' y value. Changing this will move the other points by the difference!""" * return min([i[1] for i in self.points]) * @y.setter # <<<<<<<<<<<<<< @@ -92667,7 +95695,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_8y(CYTHON_UNUSED PyObject *__pyx return __pyx_r; } -/* "collisions.py":2740 +/* "collisions.py":2826 * self.points = [[i[0], i[1]+diff] for i in self.points] * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< @@ -92729,12 +95757,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2740, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2826, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rect") < 0)) __PYX_ERR(0, 2740, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "rect") < 0)) __PYX_ERR(0, 2826, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -92745,7 +95773,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2740, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("rect", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2826, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -92792,7 +95820,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_10rect(CYTHON_UNUSED PyObject *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("rect", 1); - /* "collisions.py":2747 + /* "collisions.py":2833 * Iterable[Number]: (min x, min y, max x, max y) * """ * return min([i[0] for i in self.points]), min([i[1] for i in self.points]), max([i[0] for i in self.points]), max([i[1] for i in self.points]) # <<<<<<<<<<<<<< @@ -92801,18 +95829,18 @@ static PyObject *__pyx_pf_10collisions_7Polygon_10rect(CYTHON_UNUSED PyObject *_ */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2747, __pyx_L5_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2833, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2747, __pyx_L5_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2833, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2747, __pyx_L5_error) + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2833, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2747, __pyx_L5_error) + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2833, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -92821,28 +95849,28 @@ static PyObject *__pyx_pf_10collisions_7Polygon_10rect(CYTHON_UNUSED PyObject *_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2747, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2833, __pyx_L5_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2747, __pyx_L5_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2833, __pyx_L5_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2747, __pyx_L5_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2833, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2747, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2833, __pyx_L5_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2747, __pyx_L5_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2833, __pyx_L5_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2747, __pyx_L5_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2833, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -92852,7 +95880,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_10rect(CYTHON_UNUSED PyObject *_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2747, __pyx_L5_error) + else __PYX_ERR(0, 2833, __pyx_L5_error) } break; } @@ -92860,9 +95888,9 @@ static PyObject *__pyx_pf_10collisions_7Polygon_10rect(CYTHON_UNUSED PyObject *_ } __Pyx_XDECREF_SET(__pyx_9genexpr62__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_9genexpr62__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2747, __pyx_L5_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_9genexpr62__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2833, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2747, __pyx_L5_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2833, __pyx_L5_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -92873,22 +95901,22 @@ static PyObject *__pyx_pf_10collisions_7Polygon_10rect(CYTHON_UNUSED PyObject *_ goto __pyx_L1_error; __pyx_L9_exit_scope:; } /* exit inner scope */ - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2747, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2747, __pyx_L12_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2833, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2747, __pyx_L12_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2833, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_6 = __pyx_t_2; __Pyx_INCREF(__pyx_t_6); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2747, __pyx_L12_error) + __pyx_t_4 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2833, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2747, __pyx_L12_error) + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2833, __pyx_L12_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -92897,28 +95925,28 @@ static PyObject *__pyx_pf_10collisions_7Polygon_10rect(CYTHON_UNUSED PyObject *_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2747, __pyx_L12_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2833, __pyx_L12_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2747, __pyx_L12_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2833, __pyx_L12_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2747, __pyx_L12_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2833, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_6); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2747, __pyx_L12_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2833, __pyx_L12_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2747, __pyx_L12_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2833, __pyx_L12_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2747, __pyx_L12_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_6, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2833, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -92928,7 +95956,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_10rect(CYTHON_UNUSED PyObject *_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2747, __pyx_L12_error) + else __PYX_ERR(0, 2833, __pyx_L12_error) } break; } @@ -92936,9 +95964,9 @@ static PyObject *__pyx_pf_10collisions_7Polygon_10rect(CYTHON_UNUSED PyObject *_ } __Pyx_XDECREF_SET(__pyx_9genexpr63__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_9genexpr63__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2747, __pyx_L12_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_9genexpr63__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2833, __pyx_L12_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2747, __pyx_L12_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2833, __pyx_L12_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -92949,22 +95977,22 @@ static PyObject *__pyx_pf_10collisions_7Polygon_10rect(CYTHON_UNUSED PyObject *_ goto __pyx_L1_error; __pyx_L16_exit_scope:; } /* exit inner scope */ - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2747, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2747, __pyx_L19_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2833, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2747, __pyx_L19_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2833, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_7 = __pyx_t_2; __Pyx_INCREF(__pyx_t_7); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2747, __pyx_L19_error) + __pyx_t_4 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2833, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2747, __pyx_L19_error) + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2833, __pyx_L19_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -92973,28 +96001,28 @@ static PyObject *__pyx_pf_10collisions_7Polygon_10rect(CYTHON_UNUSED PyObject *_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2747, __pyx_L19_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2833, __pyx_L19_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2747, __pyx_L19_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2833, __pyx_L19_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2747, __pyx_L19_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2833, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2747, __pyx_L19_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2833, __pyx_L19_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2747, __pyx_L19_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2833, __pyx_L19_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2747, __pyx_L19_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2833, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -93004,7 +96032,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_10rect(CYTHON_UNUSED PyObject *_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2747, __pyx_L19_error) + else __PYX_ERR(0, 2833, __pyx_L19_error) } break; } @@ -93012,9 +96040,9 @@ static PyObject *__pyx_pf_10collisions_7Polygon_10rect(CYTHON_UNUSED PyObject *_ } __Pyx_XDECREF_SET(__pyx_9genexpr64__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_9genexpr64__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2747, __pyx_L19_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_9genexpr64__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2833, __pyx_L19_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2747, __pyx_L19_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2833, __pyx_L19_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -93025,22 +96053,22 @@ static PyObject *__pyx_pf_10collisions_7Polygon_10rect(CYTHON_UNUSED PyObject *_ goto __pyx_L1_error; __pyx_L23_exit_scope:; } /* exit inner scope */ - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2747, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2747, __pyx_L26_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2833, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2747, __pyx_L26_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2833, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_8 = __pyx_t_2; __Pyx_INCREF(__pyx_t_8); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2747, __pyx_L26_error) + __pyx_t_4 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2833, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2747, __pyx_L26_error) + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2833, __pyx_L26_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -93049,28 +96077,28 @@ static PyObject *__pyx_pf_10collisions_7Polygon_10rect(CYTHON_UNUSED PyObject *_ { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2747, __pyx_L26_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2833, __pyx_L26_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2747, __pyx_L26_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2833, __pyx_L26_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2747, __pyx_L26_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2833, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_8); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2747, __pyx_L26_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2833, __pyx_L26_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2747, __pyx_L26_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2833, __pyx_L26_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2747, __pyx_L26_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_8, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2833, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -93080,7 +96108,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_10rect(CYTHON_UNUSED PyObject *_ PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2747, __pyx_L26_error) + else __PYX_ERR(0, 2833, __pyx_L26_error) } break; } @@ -93088,9 +96116,9 @@ static PyObject *__pyx_pf_10collisions_7Polygon_10rect(CYTHON_UNUSED PyObject *_ } __Pyx_XDECREF_SET(__pyx_9genexpr65__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_9genexpr65__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2747, __pyx_L26_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_9genexpr65__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2833, __pyx_L26_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2747, __pyx_L26_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2833, __pyx_L26_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -93101,19 +96129,19 @@ static PyObject *__pyx_pf_10collisions_7Polygon_10rect(CYTHON_UNUSED PyObject *_ goto __pyx_L1_error; __pyx_L30_exit_scope:; } /* exit inner scope */ - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2747, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2747, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2833, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 2747, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3)) __PYX_ERR(0, 2833, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_6); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6)) __PYX_ERR(0, 2747, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6)) __PYX_ERR(0, 2833, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_7); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7)) __PYX_ERR(0, 2747, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_7)) __PYX_ERR(0, 2833, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_8)) __PYX_ERR(0, 2747, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_8)) __PYX_ERR(0, 2833, __pyx_L1_error); __pyx_t_3 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; @@ -93122,7 +96150,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_10rect(CYTHON_UNUSED PyObject *_ __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2740 + /* "collisions.py":2826 * self.points = [[i[0], i[1]+diff] for i in self.points] * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< @@ -93150,7 +96178,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_10rect(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":2749 +/* "collisions.py":2835 * return min([i[0] for i in self.points]), min([i[1] for i in self.points]), max([i[0] for i in self.points]), max([i[1] for i in self.points]) * * def area(self) -> Number: # <<<<<<<<<<<<<< @@ -93212,12 +96240,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2749, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2835, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "area") < 0)) __PYX_ERR(0, 2749, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "area") < 0)) __PYX_ERR(0, 2835, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -93228,7 +96256,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2749, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("area", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2835, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -93256,7 +96284,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10collisions_7Polygon_4area_2generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "collisions.py":2757 +/* "collisions.py":2843 * """ * return abs(sum( * (self.points[i][0] * self.points[i+1][1] - self.points[i+1][0] * self.points[i][1]) # <<<<<<<<<<<<<< @@ -93265,29 +96293,29 @@ static PyObject *__pyx_gb_10collisions_7Polygon_4area_2generator11(__pyx_Corouti */ static PyObject *__pyx_pf_10collisions_7Polygon_4area_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10collisions___pyx_scope_struct_27_genexpr *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_28_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_27_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_27_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_27_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_28_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_28_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_28_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_27_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_28_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2757, __pyx_L1_error) + __PYX_ERR(0, 2843, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_26_area *) __pyx_self; + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_27_area *) __pyx_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_7Polygon_4area_2generator11, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Polygon_area_locals_genexpr, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 2757, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_7Polygon_4area_2generator11, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Polygon_area_locals_genexpr, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 2843, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -93305,7 +96333,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_4area_genexpr(PyObject *__pyx_se static PyObject *__pyx_gb_10collisions_7Polygon_4area_2generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10collisions___pyx_scope_struct_27_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_27_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10collisions___pyx_scope_struct_28_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_28_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -93327,24 +96355,24 @@ static PyObject *__pyx_gb_10collisions_7Polygon_4area_2generator11(__pyx_Corouti return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2757, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2843, __pyx_L1_error) - /* "collisions.py":2758 + /* "collisions.py":2844 * return abs(sum( * (self.points[i][0] * self.points[i+1][1] - self.points[i+1][0] * self.points[i][1]) * for i in range(len(self.points)-1) # <<<<<<<<<<<<<< * ) + (self.points[len(self.points)-1][0] * self.points[0][1] - self.points[0][0] * self.points[len(self.points)-1][1])) / 2 * */ - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2758, __pyx_L1_error) } + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2844, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2758, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2758, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2844, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -93352,28 +96380,28 @@ static PyObject *__pyx_gb_10collisions_7Polygon_4area_2generator11(__pyx_Corouti { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2758, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2844, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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_ERR(0, 2758, __pyx_L1_error) + __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_ERR(0, 2844, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2758, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2758, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2844, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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_ERR(0, 2758, __pyx_L1_error) + __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_ERR(0, 2844, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2758, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -93383,7 +96411,7 @@ static PyObject *__pyx_gb_10collisions_7Polygon_4area_2generator11(__pyx_Corouti PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2758, __pyx_L1_error) + else __PYX_ERR(0, 2844, __pyx_L1_error) } break; } @@ -93394,64 +96422,64 @@ static PyObject *__pyx_gb_10collisions_7Polygon_4area_2generator11(__pyx_Corouti __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2757 + /* "collisions.py":2843 * """ * return abs(sum( * (self.points[i][0] * self.points[i+1][1] - self.points[i+1][0] * self.points[i][1]) # <<<<<<<<<<<<<< * for i in range(len(self.points)-1) * ) + (self.points[len(self.points)-1][0] * self.points[0][1] - self.points[0][0] * self.points[len(self.points)-1][1])) / 2 */ - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2757, __pyx_L1_error) } - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2757, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2843, __pyx_L1_error) } + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2757, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2757, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2757, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2757, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2843, __pyx_L1_error) } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_cur_scope->__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2757, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_cur_scope->__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2757, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2757, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Multiply(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2757, __pyx_L1_error) + __pyx_t_7 = PyNumber_Multiply(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2757, __pyx_L1_error) } - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2757, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2843, __pyx_L1_error) } + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_cur_scope->__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2757, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_cur_scope->__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2757, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2757, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2757, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2757, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2843, __pyx_L1_error) } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2757, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2757, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2757, __pyx_L1_error) + __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Subtract(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2757, __pyx_L1_error) + __pyx_t_5 = PyNumber_Subtract(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -93473,9 +96501,9 @@ static PyObject *__pyx_gb_10collisions_7Polygon_4area_2generator11(__pyx_Corouti __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; __pyx_t_3 = __pyx_cur_scope->__pyx_t_2; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2757, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2843, __pyx_L1_error) - /* "collisions.py":2758 + /* "collisions.py":2844 * return abs(sum( * (self.points[i][0] * self.points[i+1][1] - self.points[i+1][0] * self.points[i][1]) * for i in range(len(self.points)-1) # <<<<<<<<<<<<<< @@ -93486,7 +96514,7 @@ static PyObject *__pyx_gb_10collisions_7Polygon_4area_2generator11(__pyx_Corouti __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); - /* "collisions.py":2757 + /* "collisions.py":2843 * """ * return abs(sum( * (self.points[i][0] * self.points[i+1][1] - self.points[i+1][0] * self.points[i][1]) # <<<<<<<<<<<<<< @@ -93516,7 +96544,7 @@ static PyObject *__pyx_gb_10collisions_7Polygon_4area_2generator11(__pyx_Corouti return __pyx_r; } -/* "collisions.py":2749 +/* "collisions.py":2835 * return min([i[0] for i in self.points]), min([i[1] for i in self.points]), max([i[0] for i in self.points]), max([i[1] for i in self.points]) * * def area(self) -> Number: # <<<<<<<<<<<<<< @@ -93525,7 +96553,7 @@ static PyObject *__pyx_gb_10collisions_7Polygon_4area_2generator11(__pyx_Corouti */ static PyObject *__pyx_pf_10collisions_7Polygon_12area(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) { - struct __pyx_obj_10collisions___pyx_scope_struct_26_area *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_27_area *__pyx_cur_scope; PyObject *__pyx_gb_10collisions_7Polygon_4area_2generator11 = 0; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations @@ -93540,11 +96568,11 @@ static PyObject *__pyx_pf_10collisions_7Polygon_12area(CYTHON_UNUSED PyObject *_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("area", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_26_area *)__pyx_tp_new_10collisions___pyx_scope_struct_26_area(__pyx_ptype_10collisions___pyx_scope_struct_26_area, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_27_area *)__pyx_tp_new_10collisions___pyx_scope_struct_27_area(__pyx_ptype_10collisions___pyx_scope_struct_27_area, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_26_area *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_27_area *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2749, __pyx_L1_error) + __PYX_ERR(0, 2835, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -93552,7 +96580,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_12area(CYTHON_UNUSED PyObject *_ __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); - /* "collisions.py":2756 + /* "collisions.py":2842 * Number: The area of the shape * """ * return abs(sum( # <<<<<<<<<<<<<< @@ -93561,137 +96589,137 @@ static PyObject *__pyx_pf_10collisions_7Polygon_12area(CYTHON_UNUSED PyObject *_ */ __Pyx_XDECREF(__pyx_r); - /* "collisions.py":2758 + /* "collisions.py":2844 * return abs(sum( * (self.points[i][0] * self.points[i+1][1] - self.points[i+1][0] * self.points[i][1]) * for i in range(len(self.points)-1) # <<<<<<<<<<<<<< * ) + (self.points[len(self.points)-1][0] * self.points[0][1] - self.points[0][0] * self.points[len(self.points)-1][1])) / 2 * */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2758, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2758, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2844, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_2 - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2758, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t((__pyx_t_2 - 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2758, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2844, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2757 + /* "collisions.py":2843 * """ * return abs(sum( * (self.points[i][0] * self.points[i+1][1] - self.points[i+1][0] * self.points[i][1]) # <<<<<<<<<<<<<< * for i in range(len(self.points)-1) * ) + (self.points[len(self.points)-1][0] * self.points[0][1] - self.points[0][0] * self.points[len(self.points)-1][1])) / 2 */ - __pyx_t_1 = __pyx_pf_10collisions_7Polygon_4area_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2757, __pyx_L1_error) + __pyx_t_1 = __pyx_pf_10collisions_7Polygon_4area_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2843, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2756 + /* "collisions.py":2842 * Number: The area of the shape * """ * return abs(sum( # <<<<<<<<<<<<<< * (self.points[i][0] * self.points[i+1][1] - self.points[i+1][0] * self.points[i][1]) * for i in range(len(self.points)-1) */ - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2756, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2759 + /* "collisions.py":2845 * (self.points[i][0] * self.points[i+1][1] - self.points[i+1][0] * self.points[i][1]) * for i in range(len(self.points)-1) * ) + (self.points[len(self.points)-1][0] * self.points[0][1] - self.points[0][0] * self.points[len(self.points)-1][1])) / 2 # <<<<<<<<<<<<<< * * def _collides(self, othershape: Shape) -> bool: */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2759, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2759, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2759, __pyx_L1_error) + __pyx_t_2 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2845, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_5 = (__pyx_t_2 - 1); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, __pyx_t_5, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2759, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, __pyx_t_5, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2759, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2759, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2759, __pyx_L1_error) + __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2759, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyNumber_Multiply(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2759, __pyx_L1_error) + __pyx_t_6 = PyNumber_Multiply(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2759, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2759, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2759, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2759, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2759, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2759, __pyx_L1_error) + __pyx_t_5 = PyObject_Length(__pyx_t_7); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2845, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_2 = (__pyx_t_5 - 1); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, __pyx_t_2, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2759, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, __pyx_t_2, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2759, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_7, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Multiply(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2759, __pyx_L1_error) + __pyx_t_7 = PyNumber_Multiply(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Subtract(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2759, __pyx_L1_error) + __pyx_t_1 = PyNumber_Subtract(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2759, __pyx_L1_error) + __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2756 + /* "collisions.py":2842 * Number: The area of the shape * """ * return abs(sum( # <<<<<<<<<<<<<< * (self.points[i][0] * self.points[i+1][1] - self.points[i+1][0] * self.points[i][1]) * for i in range(len(self.points)-1) */ - __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2756, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyNumber_Absolute(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2842, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":2759 + /* "collisions.py":2845 * (self.points[i][0] * self.points[i+1][1] - self.points[i+1][0] * self.points[i][1]) * for i in range(len(self.points)-1) * ) + (self.points[len(self.points)-1][0] * self.points[0][1] - self.points[0][0] * self.points[len(self.points)-1][1])) / 2 # <<<<<<<<<<<<<< * * def _collides(self, othershape: Shape) -> bool: */ - __pyx_t_7 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_1, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2759, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_1, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2845, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_7; __pyx_t_7 = 0; goto __pyx_L0; - /* "collisions.py":2749 + /* "collisions.py":2835 * return min([i[0] for i in self.points]), min([i[1] for i in self.points]), max([i[0] for i in self.points]), max([i[1] for i in self.points]) * * def area(self) -> Number: # <<<<<<<<<<<<<< @@ -93716,7 +96744,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_12area(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":2761 +/* "collisions.py":2847 * ) + (self.points[len(self.points)-1][0] * self.points[0][1] - self.points[0][0] * self.points[len(self.points)-1][1])) / 2 * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< @@ -93780,7 +96808,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2761, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2847, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -93788,14 +96816,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2761, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2847, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 2761, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, 1); __PYX_ERR(0, 2847, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_collides") < 0)) __PYX_ERR(0, 2761, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_collides") < 0)) __PYX_ERR(0, 2847, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 2)) { goto __pyx_L5_argtuple_error; @@ -93808,7 +96836,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2761, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("_collides", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2847, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -93836,7 +96864,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_gb_10collisions_7Polygon_9_collides_2generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "collisions.py":2789 +/* "collisions.py":2875 * return False * if checkShpType(othershape, ShpTyps.Arc): * if any(self._collides(Point(*i)) for i in othershape.endPoints()): # <<<<<<<<<<<<<< @@ -93845,29 +96873,29 @@ static PyObject *__pyx_gb_10collisions_7Polygon_9_collides_2generator12(__pyx_Co */ static PyObject *__pyx_pf_10collisions_7Polygon_9_collides_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10collisions___pyx_scope_struct_29_genexpr *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_29_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_29_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_29_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_30_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_30_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_29_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2789, __pyx_L1_error) + __PYX_ERR(0, 2875, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_28__collides *) __pyx_self; + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_29__collides *) __pyx_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_7Polygon_9_collides_2generator12, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Polygon__collides_locals_genexpr, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 2789, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_7Polygon_9_collides_2generator12, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Polygon__collides_locals_genexpr, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 2875, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -93885,7 +96913,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_9_collides_genexpr(PyObject *__p static PyObject *__pyx_gb_10collisions_7Polygon_9_collides_2generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10collisions___pyx_scope_struct_29_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_29_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -93909,16 +96937,16 @@ static PyObject *__pyx_gb_10collisions_7Polygon_9_collides_2generator12(__pyx_Co return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2789, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2789, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2875, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2875, __pyx_L1_error) } if (likely(PyList_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) || PyTuple_CheckExact(__pyx_cur_scope->__pyx_genexpr_arg_0)) { __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = NULL; } else { - __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2789, __pyx_L1_error) + __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_cur_scope->__pyx_genexpr_arg_0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2789, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2875, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_3)) { @@ -93926,28 +96954,28 @@ static PyObject *__pyx_gb_10collisions_7Polygon_9_collides_2generator12(__pyx_Co { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2789, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2875, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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_ERR(0, 2789, __pyx_L1_error) + __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_ERR(0, 2875, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2789, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2789, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2875, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __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_ERR(0, 2789, __pyx_L1_error) + __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_ERR(0, 2875, __pyx_L1_error) #else - __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2789, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); #endif } @@ -93957,7 +96985,7 @@ static PyObject *__pyx_gb_10collisions_7Polygon_9_collides_2generator12(__pyx_Co PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2789, __pyx_L1_error) + else __PYX_ERR(0, 2875, __pyx_L1_error) } break; } @@ -93967,14 +96995,14 @@ static PyObject *__pyx_gb_10collisions_7Polygon_9_collides_2generator12(__pyx_Co __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_4); __Pyx_GIVEREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2789, __pyx_L1_error) } - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2789, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2875, __pyx_L1_error) } + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Point); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2789, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Point); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2789, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2789, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -93997,11 +97025,11 @@ static PyObject *__pyx_gb_10collisions_7Polygon_9_collides_2generator12(__pyx_Co __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2789, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 2789, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 2875, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_10) { __Pyx_XDECREF(__pyx_r); @@ -94042,7 +97070,7 @@ static PyObject *__pyx_gb_10collisions_7Polygon_9_collides_2generator12(__pyx_Co return __pyx_r; } -/* "collisions.py":2761 +/* "collisions.py":2847 * ) + (self.points[len(self.points)-1][0] * self.points[0][1] - self.points[0][0] * self.points[len(self.points)-1][1])) / 2 * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< @@ -94051,7 +97079,7 @@ static PyObject *__pyx_gb_10collisions_7Polygon_9_collides_2generator12(__pyx_Co */ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_othershape) { - struct __pyx_obj_10collisions___pyx_scope_struct_28__collides *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_29__collides *__pyx_cur_scope; PyObject *__pyx_v_ps = NULL; int __pyx_v_c; Py_ssize_t __pyx_v_j; @@ -94078,11 +97106,11 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("_collides", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_28__collides *)__pyx_tp_new_10collisions___pyx_scope_struct_28__collides(__pyx_ptype_10collisions___pyx_scope_struct_28__collides, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_29__collides *)__pyx_tp_new_10collisions___pyx_scope_struct_29__collides(__pyx_ptype_10collisions___pyx_scope_struct_29__collides, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_28__collides *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_29__collides *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2761, __pyx_L1_error) + __PYX_ERR(0, 2847, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -94090,14 +97118,14 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self); - /* "collisions.py":2762 + /* "collisions.py":2848 * * def _collides(self, othershape: Shape) -> bool: * if not self.check_rects(othershape): # <<<<<<<<<<<<<< * return False * if checkShpType(othershape, ShpTyps.Point): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_check_rects); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2762, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_check_rects); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -94117,16 +97145,16 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_othershape}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2762, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2762, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2848, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = (!__pyx_t_5); if (__pyx_t_6) { - /* "collisions.py":2763 + /* "collisions.py":2849 * def _collides(self, othershape: Shape) -> bool: * if not self.check_rects(othershape): * return False # <<<<<<<<<<<<<< @@ -94138,7 +97166,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":2762 + /* "collisions.py":2848 * * def _collides(self, othershape: Shape) -> bool: * if not self.check_rects(othershape): # <<<<<<<<<<<<<< @@ -94147,18 +97175,18 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ } - /* "collisions.py":2764 + /* "collisions.py":2850 * if not self.check_rects(othershape): * return False * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< * ps = self.points * c = False */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2764, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2764, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2764, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -94180,27 +97208,27 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2764, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2850, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2764, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2850, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2765 + /* "collisions.py":2851 * return False * if checkShpType(othershape, ShpTyps.Point): * ps = self.points # <<<<<<<<<<<<<< * c = False * j = len(ps) - 1 */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2765, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2851, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_ps = __pyx_t_1; __pyx_t_1 = 0; - /* "collisions.py":2766 + /* "collisions.py":2852 * if checkShpType(othershape, ShpTyps.Point): * ps = self.points * c = False # <<<<<<<<<<<<<< @@ -94209,27 +97237,27 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ __pyx_v_c = 0; - /* "collisions.py":2767 + /* "collisions.py":2853 * ps = self.points * c = False * j = len(ps) - 1 # <<<<<<<<<<<<<< * for i in range(len(ps)): * if ((ps[i][1] > othershape.y) != (ps[j][1] > othershape.y)) and \ */ - __pyx_t_8 = PyObject_Length(__pyx_v_ps); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2767, __pyx_L1_error) + __pyx_t_8 = PyObject_Length(__pyx_v_ps); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2853, __pyx_L1_error) __pyx_v_j = (__pyx_t_8 - 1); - /* "collisions.py":2768 + /* "collisions.py":2854 * c = False * j = len(ps) - 1 * for i in range(len(ps)): # <<<<<<<<<<<<<< * if ((ps[i][1] > othershape.y) != (ps[j][1] > othershape.y)) and \ * (othershape.x < (ps[j][0] - ps[i][0]) * (othershape.y - ps[i][1]) / (ps[j][1] - ps[i][1]) + ps[i][0]): */ - __pyx_t_8 = PyObject_Length(__pyx_v_ps); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2768, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2768, __pyx_L1_error) + __pyx_t_8 = PyObject_Length(__pyx_v_ps); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2854, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2768, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { @@ -94237,9 +97265,9 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2768, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2768, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2854, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -94248,28 +97276,28 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2768, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2854, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2768, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2854, __pyx_L1_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2768, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2768, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2854, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2768, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2854, __pyx_L1_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2768, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2854, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -94279,7 +97307,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2768, __pyx_L1_error) + else __PYX_ERR(0, 2854, __pyx_L1_error) } break; } @@ -94288,37 +97316,37 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2769 + /* "collisions.py":2855 * j = len(ps) - 1 * for i in range(len(ps)): * if ((ps[i][1] > othershape.y) != (ps[j][1] > othershape.y)) and \ # <<<<<<<<<<<<<< * (othershape.x < (ps[j][0] - ps[i][0]) * (othershape.y - ps[i][1]) / (ps[j][1] - ps[i][1]) + ps[i][0]): * c = not c */ - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_ps, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2769, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_ps, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2769, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2769, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_7, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2769, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_7, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2855, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ps, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2769, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ps, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2769, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2769, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2855, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = PyObject_RichCompare(__pyx_t_7, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2769, __pyx_L1_error) + __pyx_t_10 = PyObject_RichCompare(__pyx_t_7, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2855, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_10, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2769, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_10, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2855, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2769, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2855, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (__pyx_t_5) { } else { @@ -94326,80 +97354,80 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje goto __pyx_L8_bool_binop_done; } - /* "collisions.py":2770 + /* "collisions.py":2856 * for i in range(len(ps)): * if ((ps[i][1] > othershape.y) != (ps[j][1] > othershape.y)) and \ * (othershape.x < (ps[j][0] - ps[i][0]) * (othershape.y - ps[i][1]) / (ps[j][1] - ps[i][1]) + ps[i][0]): # <<<<<<<<<<<<<< * c = not c * j = i */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2770, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_ps, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2770, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_ps, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_10, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2770, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_10, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_v_ps, __pyx_v_i); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2770, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetItem(__pyx_v_ps, __pyx_v_i); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_10, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2770, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_10, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyNumber_Subtract(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2770, __pyx_L1_error) + __pyx_t_10 = PyNumber_Subtract(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2770, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_ps, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2770, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_ps, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2770, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Subtract(__pyx_t_7, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2770, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_7, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyNumber_Multiply(__pyx_t_10, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2770, __pyx_L1_error) + __pyx_t_11 = PyNumber_Multiply(__pyx_t_10, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_ps, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2770, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_ps, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2770, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_ps, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2770, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_ps, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2770, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Subtract(__pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2770, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2770, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_ps, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2770, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_ps, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2770, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Add(__pyx_t_7, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2770, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_7, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2856, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2770, __pyx_L1_error) + __pyx_t_11 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2856, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2770, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2856, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_6 = __pyx_t_5; __pyx_L8_bool_binop_done:; - /* "collisions.py":2769 + /* "collisions.py":2855 * j = len(ps) - 1 * for i in range(len(ps)): * if ((ps[i][1] > othershape.y) != (ps[j][1] > othershape.y)) and \ # <<<<<<<<<<<<<< @@ -94408,7 +97436,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ if (__pyx_t_6) { - /* "collisions.py":2771 + /* "collisions.py":2857 * if ((ps[i][1] > othershape.y) != (ps[j][1] > othershape.y)) and \ * (othershape.x < (ps[j][0] - ps[i][0]) * (othershape.y - ps[i][1]) / (ps[j][1] - ps[i][1]) + ps[i][0]): * c = not c # <<<<<<<<<<<<<< @@ -94417,7 +97445,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ __pyx_v_c = (!__pyx_v_c); - /* "collisions.py":2769 + /* "collisions.py":2855 * j = len(ps) - 1 * for i in range(len(ps)): * if ((ps[i][1] > othershape.y) != (ps[j][1] > othershape.y)) and \ # <<<<<<<<<<<<<< @@ -94426,17 +97454,17 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ } - /* "collisions.py":2772 + /* "collisions.py":2858 * (othershape.x < (ps[j][0] - ps[i][0]) * (othershape.y - ps[i][1]) / (ps[j][1] - ps[i][1]) + ps[i][0]): * c = not c * j = i # <<<<<<<<<<<<<< * return c * if checkShpType(othershape, ShpTyps.Line): */ - __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2772, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2858, __pyx_L1_error) __pyx_v_j = __pyx_t_12; - /* "collisions.py":2768 + /* "collisions.py":2854 * c = False * j = len(ps) - 1 * for i in range(len(ps)): # <<<<<<<<<<<<<< @@ -94446,7 +97474,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2773 + /* "collisions.py":2859 * c = not c * j = i * return c # <<<<<<<<<<<<<< @@ -94454,13 +97482,13 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje * for li in self.toLines(): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2773, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_c); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2859, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2764 + /* "collisions.py":2850 * if not self.check_rects(othershape): * return False * if checkShpType(othershape, ShpTyps.Point): # <<<<<<<<<<<<<< @@ -94469,18 +97497,18 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ } - /* "collisions.py":2774 + /* "collisions.py":2860 * j = i * return c * if checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< * for li in self.toLines(): * if li.collides(othershape): */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2774, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2774, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2774, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Line); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -94502,22 +97530,22 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2774, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2860, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2774, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2860, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2775 + /* "collisions.py":2861 * return c * if checkShpType(othershape, ShpTyps.Line): * for li in self.toLines(): # <<<<<<<<<<<<<< * if li.collides(othershape): * return True */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2775, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_2 = NULL; __pyx_t_4 = 0; @@ -94537,7 +97565,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2775, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } @@ -94546,9 +97574,9 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2775, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2775, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2861, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -94557,28 +97585,28 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2775, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2861, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2775, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2861, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2775, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_11); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2775, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2861, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2775, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2861, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2775, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2861, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -94588,7 +97616,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2775, __pyx_L1_error) + else __PYX_ERR(0, 2861, __pyx_L1_error) } break; } @@ -94597,14 +97625,14 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __Pyx_XDECREF_SET(__pyx_v_li, __pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2776 + /* "collisions.py":2862 * if checkShpType(othershape, ShpTyps.Line): * for li in self.toLines(): * if li.collides(othershape): # <<<<<<<<<<<<<< * return True * if self._collides(Point(*othershape.p1)) or self._collides(Point(*othershape.p2)): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_li, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2776, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_li, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_3 = NULL; __pyx_t_4 = 0; @@ -94624,15 +97652,15 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_othershape}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2776, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2862, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2776, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2862, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2777 + /* "collisions.py":2863 * for li in self.toLines(): * if li.collides(othershape): * return True # <<<<<<<<<<<<<< @@ -94645,7 +97673,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L0; - /* "collisions.py":2776 + /* "collisions.py":2862 * if checkShpType(othershape, ShpTyps.Line): * for li in self.toLines(): * if li.collides(othershape): # <<<<<<<<<<<<<< @@ -94654,7 +97682,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ } - /* "collisions.py":2775 + /* "collisions.py":2861 * return c * if checkShpType(othershape, ShpTyps.Line): * for li in self.toLines(): # <<<<<<<<<<<<<< @@ -94664,23 +97692,23 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2778 + /* "collisions.py":2864 * if li.collides(othershape): * return True * if self._collides(Point(*othershape.p1)) or self._collides(Point(*othershape.p2)): # <<<<<<<<<<<<<< * return True * return False */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2778, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Point); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2778, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Point); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2778, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2778, __pyx_L1_error) + __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2778, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -94703,27 +97731,27 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2778, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2778, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2864, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (!__pyx_t_5) { } else { __pyx_t_6 = __pyx_t_5; goto __pyx_L17_bool_binop_done; } - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2778, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2778, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2778, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_p2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2778, __pyx_L1_error) + __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2778, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -94746,17 +97774,17 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2778, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2864, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2778, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 2864, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_6 = __pyx_t_5; __pyx_L17_bool_binop_done:; if (__pyx_t_6) { - /* "collisions.py":2779 + /* "collisions.py":2865 * return True * if self._collides(Point(*othershape.p1)) or self._collides(Point(*othershape.p2)): * return True # <<<<<<<<<<<<<< @@ -94768,7 +97796,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_r = Py_True; goto __pyx_L0; - /* "collisions.py":2778 + /* "collisions.py":2864 * if li.collides(othershape): * return True * if self._collides(Point(*othershape.p1)) or self._collides(Point(*othershape.p2)): # <<<<<<<<<<<<<< @@ -94777,7 +97805,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ } - /* "collisions.py":2780 + /* "collisions.py":2866 * if self._collides(Point(*othershape.p1)) or self._collides(Point(*othershape.p2)): * return True * return False # <<<<<<<<<<<<<< @@ -94789,7 +97817,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":2774 + /* "collisions.py":2860 * j = i * return c * if checkShpType(othershape, ShpTyps.Line): # <<<<<<<<<<<<<< @@ -94798,18 +97826,18 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ } - /* "collisions.py":2781 + /* "collisions.py":2867 * return True * return False * if checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< * if self._collides(Point(othershape.x, othershape.y)): * return True */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2781, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2781, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Circle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2781, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Circle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; @@ -94831,28 +97859,28 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2781, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2781, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2867, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_6) { - /* "collisions.py":2782 + /* "collisions.py":2868 * return False * if checkShpType(othershape, ShpTyps.Circle): * if self._collides(Point(othershape.x, othershape.y)): # <<<<<<<<<<<<<< * return True * for li in self.toLines(): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2782, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_collides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2782, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2782, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2782, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_13 = NULL; __pyx_t_4 = 0; @@ -94874,7 +97902,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2782, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } @@ -94897,15 +97925,15 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2782, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2868, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2782, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2868, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_6) { - /* "collisions.py":2783 + /* "collisions.py":2869 * if checkShpType(othershape, ShpTyps.Circle): * if self._collides(Point(othershape.x, othershape.y)): * return True # <<<<<<<<<<<<<< @@ -94917,7 +97945,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_r = Py_True; goto __pyx_L0; - /* "collisions.py":2782 + /* "collisions.py":2868 * return False * if checkShpType(othershape, ShpTyps.Circle): * if self._collides(Point(othershape.x, othershape.y)): # <<<<<<<<<<<<<< @@ -94926,14 +97954,14 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ } - /* "collisions.py":2784 + /* "collisions.py":2870 * if self._collides(Point(othershape.x, othershape.y)): * return True * for li in self.toLines(): # <<<<<<<<<<<<<< * if li.collides(othershape): * return True */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2784, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; __pyx_t_4 = 0; @@ -94953,7 +97981,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2784, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -94962,9 +97990,9 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2784, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2784, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2870, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; for (;;) { @@ -94973,28 +98001,28 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2784, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2870, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_11 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2784, __pyx_L1_error) + __pyx_t_11 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2870, __pyx_L1_error) #else - __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2784, __pyx_L1_error) + __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2784, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2870, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2784, __pyx_L1_error) + __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2870, __pyx_L1_error) #else - __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2784, __pyx_L1_error) + __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2870, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); #endif } @@ -95004,7 +98032,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2784, __pyx_L1_error) + else __PYX_ERR(0, 2870, __pyx_L1_error) } break; } @@ -95013,14 +98041,14 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __Pyx_XDECREF_SET(__pyx_v_li, __pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2785 + /* "collisions.py":2871 * return True * for li in self.toLines(): * if li.collides(othershape): # <<<<<<<<<<<<<< * return True * return False */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_li, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2785, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_li, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = NULL; __pyx_t_4 = 0; @@ -95040,15 +98068,15 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_othershape}; __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2785, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2871, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2785, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2871, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_6) { - /* "collisions.py":2786 + /* "collisions.py":2872 * for li in self.toLines(): * if li.collides(othershape): * return True # <<<<<<<<<<<<<< @@ -95061,7 +98089,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2785 + /* "collisions.py":2871 * return True * for li in self.toLines(): * if li.collides(othershape): # <<<<<<<<<<<<<< @@ -95070,7 +98098,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ } - /* "collisions.py":2784 + /* "collisions.py":2870 * if self._collides(Point(othershape.x, othershape.y)): * return True * for li in self.toLines(): # <<<<<<<<<<<<<< @@ -95080,7 +98108,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2787 + /* "collisions.py":2873 * if li.collides(othershape): * return True * return False # <<<<<<<<<<<<<< @@ -95092,7 +98120,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":2781 + /* "collisions.py":2867 * return True * return False * if checkShpType(othershape, ShpTyps.Circle): # <<<<<<<<<<<<<< @@ -95101,18 +98129,18 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ } - /* "collisions.py":2788 + /* "collisions.py":2874 * return True * return False * if checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< * if any(self._collides(Point(*i)) for i in othershape.endPoints()): * return True */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2788, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2788, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Arc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2788, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Arc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -95134,22 +98162,22 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2788, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2874, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2788, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2874, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2789 + /* "collisions.py":2875 * return False * if checkShpType(othershape, ShpTyps.Arc): * if any(self._collides(Point(*i)) for i in othershape.endPoints()): # <<<<<<<<<<<<<< * return True * for i in self.toLines(): */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_endPoints); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2789, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_endPoints); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_7 = NULL; __pyx_t_4 = 0; @@ -95169,21 +98197,21 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2789, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } - __pyx_t_11 = __pyx_pf_10collisions_7Polygon_9_collides_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2789, __pyx_L1_error) + __pyx_t_11 = __pyx_pf_10collisions_7Polygon_9_collides_genexpr(((PyObject*)__pyx_cur_scope), __pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2789, __pyx_L1_error) + __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2875, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2789, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2875, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2790 + /* "collisions.py":2876 * if checkShpType(othershape, ShpTyps.Arc): * if any(self._collides(Point(*i)) for i in othershape.endPoints()): * return True # <<<<<<<<<<<<<< @@ -95195,7 +98223,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_r = Py_True; goto __pyx_L0; - /* "collisions.py":2789 + /* "collisions.py":2875 * return False * if checkShpType(othershape, ShpTyps.Arc): * if any(self._collides(Point(*i)) for i in othershape.endPoints()): # <<<<<<<<<<<<<< @@ -95204,14 +98232,14 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ } - /* "collisions.py":2791 + /* "collisions.py":2877 * if any(self._collides(Point(*i)) for i in othershape.endPoints()): * return True * for i in self.toLines(): # <<<<<<<<<<<<<< * if othershape.collides(i): * return True */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2791, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_7 = NULL; __pyx_t_4 = 0; @@ -95231,7 +98259,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2791, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } @@ -95240,9 +98268,9 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2791, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2791, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2877, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -95251,28 +98279,28 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2791, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2877, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2791, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2877, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2791, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_11); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2791, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2877, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2791, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2877, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2791, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2877, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -95282,7 +98310,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2791, __pyx_L1_error) + else __PYX_ERR(0, 2877, __pyx_L1_error) } break; } @@ -95291,14 +98319,14 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2792 + /* "collisions.py":2878 * return True * for i in self.toLines(): * if othershape.collides(i): # <<<<<<<<<<<<<< * return True * return False */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2792, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_2 = NULL; __pyx_t_4 = 0; @@ -95318,15 +98346,15 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_i}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2792, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2878, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2792, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2878, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2793 + /* "collisions.py":2879 * for i in self.toLines(): * if othershape.collides(i): * return True # <<<<<<<<<<<<<< @@ -95339,7 +98367,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L0; - /* "collisions.py":2792 + /* "collisions.py":2878 * return True * for i in self.toLines(): * if othershape.collides(i): # <<<<<<<<<<<<<< @@ -95348,7 +98376,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ } - /* "collisions.py":2791 + /* "collisions.py":2877 * if any(self._collides(Point(*i)) for i in othershape.endPoints()): * return True * for i in self.toLines(): # <<<<<<<<<<<<<< @@ -95358,7 +98386,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2794 + /* "collisions.py":2880 * if othershape.collides(i): * return True * return False # <<<<<<<<<<<<<< @@ -95370,7 +98398,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_r = Py_False; goto __pyx_L0; - /* "collisions.py":2788 + /* "collisions.py":2874 * return True * return False * if checkShpType(othershape, ShpTyps.Arc): # <<<<<<<<<<<<<< @@ -95379,23 +98407,23 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ } - /* "collisions.py":2795 + /* "collisions.py":2881 * return True * return False * if checkShpType(othershape, ShpTyps.Rect, ShpTyps.RotRect): # <<<<<<<<<<<<<< * for li in self.toLines(): * if li.collides(othershape): */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2795, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2795, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2795, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Rect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2795, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_RotRect); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2795, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_RotRect); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; @@ -95418,22 +98446,22 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2795, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2881, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2795, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2881, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_6) { - /* "collisions.py":2796 + /* "collisions.py":2882 * return False * if checkShpType(othershape, ShpTyps.Rect, ShpTyps.RotRect): * for li in self.toLines(): # <<<<<<<<<<<<<< * if li.collides(othershape): * return True */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2796, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_10 = NULL; __pyx_t_4 = 0; @@ -95453,7 +98481,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL}; __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2796, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -95462,9 +98490,9 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2796, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2796, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2882, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; for (;;) { @@ -95473,28 +98501,28 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2796, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2882, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_11 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2796, __pyx_L1_error) + __pyx_t_11 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2882, __pyx_L1_error) #else - __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2796, __pyx_L1_error) + __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2796, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2882, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2796, __pyx_L1_error) + __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_11); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2882, __pyx_L1_error) #else - __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2796, __pyx_L1_error) + __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2882, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); #endif } @@ -95504,7 +98532,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2796, __pyx_L1_error) + else __PYX_ERR(0, 2882, __pyx_L1_error) } break; } @@ -95513,14 +98541,14 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __Pyx_XDECREF_SET(__pyx_v_li, __pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2797 + /* "collisions.py":2883 * if checkShpType(othershape, ShpTyps.Rect, ShpTyps.RotRect): * for li in self.toLines(): * if li.collides(othershape): # <<<<<<<<<<<<<< * return True * return othershape.collides(Point(self.points[0][0], self.points[0][1])) or self.collides(Point(othershape.x, othershape.y)) */ - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_li, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2797, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_li, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __pyx_t_2 = NULL; __pyx_t_4 = 0; @@ -95540,15 +98568,15 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_othershape}; __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2797, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2883, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2797, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2883, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_6) { - /* "collisions.py":2798 + /* "collisions.py":2884 * for li in self.toLines(): * if li.collides(othershape): * return True # <<<<<<<<<<<<<< @@ -95561,7 +98589,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2797 + /* "collisions.py":2883 * if checkShpType(othershape, ShpTyps.Rect, ShpTyps.RotRect): * for li in self.toLines(): * if li.collides(othershape): # <<<<<<<<<<<<<< @@ -95570,7 +98598,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ } - /* "collisions.py":2796 + /* "collisions.py":2882 * return False * if checkShpType(othershape, ShpTyps.Rect, ShpTyps.RotRect): * for li in self.toLines(): # <<<<<<<<<<<<<< @@ -95580,7 +98608,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2799 + /* "collisions.py":2885 * if li.collides(othershape): * return True * return othershape.collides(Point(self.points[0][0], self.points[0][1])) or self.collides(Point(othershape.x, othershape.y)) # <<<<<<<<<<<<<< @@ -95588,24 +98616,24 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje * for li in self.toLines(): */ __Pyx_XDECREF(__pyx_r); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2799, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2799, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2799, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2799, __pyx_L1_error) + __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_13, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2799, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_13, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2799, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_13, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2799, __pyx_L1_error) + __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_13, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_14, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2799, __pyx_L1_error) + __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_14, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = NULL; @@ -95628,7 +98656,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2799, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } @@ -95651,11 +98679,11 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2799, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2799, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2885, __pyx_L1_error) if (!__pyx_t_6) { __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } else { @@ -95664,13 +98692,13 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L36_bool_binop_done; } - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2799, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2799, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2799, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_x); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2799, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_14 = NULL; __pyx_t_4 = 0; @@ -95692,7 +98720,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2799, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } @@ -95715,7 +98743,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2799, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2885, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; } @@ -95727,7 +98755,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2795 + /* "collisions.py":2881 * return True * return False * if checkShpType(othershape, ShpTyps.Rect, ShpTyps.RotRect): # <<<<<<<<<<<<<< @@ -95736,18 +98764,18 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ } - /* "collisions.py":2800 + /* "collisions.py":2886 * return True * return othershape.collides(Point(self.points[0][0], self.points[0][1])) or self.collides(Point(othershape.x, othershape.y)) * if checkShpType(othershape, ShpTyps.Polygon): # <<<<<<<<<<<<<< * for li in self.toLines(): * if li.collides(othershape): */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2800, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2800, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2800, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; @@ -95769,22 +98797,22 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2800, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2886, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2800, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2886, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2801 + /* "collisions.py":2887 * return othershape.collides(Point(self.points[0][0], self.points[0][1])) or self.collides(Point(othershape.x, othershape.y)) * if checkShpType(othershape, ShpTyps.Polygon): * for li in self.toLines(): # <<<<<<<<<<<<<< * if li.collides(othershape): * return True */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2801, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_toLines); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_2 = NULL; __pyx_t_4 = 0; @@ -95804,7 +98832,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2801, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } @@ -95813,9 +98841,9 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2801, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_11 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2801, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2887, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -95824,28 +98852,28 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_11); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2801, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2887, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2801, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_11, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2887, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2801, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_11); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2801, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2887, __pyx_L1_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2801, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_11, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 2887, __pyx_L1_error) #else - __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2801, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_11, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2887, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -95855,7 +98883,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2801, __pyx_L1_error) + else __PYX_ERR(0, 2887, __pyx_L1_error) } break; } @@ -95864,14 +98892,14 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __Pyx_XDECREF_SET(__pyx_v_li, __pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2802 + /* "collisions.py":2888 * if checkShpType(othershape, ShpTyps.Polygon): * for li in self.toLines(): * if li.collides(othershape): # <<<<<<<<<<<<<< * return True * return othershape.collides(Point(self.points[0][0], self.points[0][1])) or self.collides(Point(othershape.points[0][0], othershape.points[0][1])) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_li, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2802, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_li, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_10 = NULL; __pyx_t_4 = 0; @@ -95891,15 +98919,15 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_v_othershape}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2802, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2888, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2802, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2888, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2803 + /* "collisions.py":2889 * for li in self.toLines(): * if li.collides(othershape): * return True # <<<<<<<<<<<<<< @@ -95912,7 +98940,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; goto __pyx_L0; - /* "collisions.py":2802 + /* "collisions.py":2888 * if checkShpType(othershape, ShpTyps.Polygon): * for li in self.toLines(): * if li.collides(othershape): # <<<<<<<<<<<<<< @@ -95921,7 +98949,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ } - /* "collisions.py":2801 + /* "collisions.py":2887 * return othershape.collides(Point(self.points[0][0], self.points[0][1])) or self.collides(Point(othershape.x, othershape.y)) * if checkShpType(othershape, ShpTyps.Polygon): * for li in self.toLines(): # <<<<<<<<<<<<<< @@ -95931,7 +98959,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2804 + /* "collisions.py":2890 * if li.collides(othershape): * return True * return othershape.collides(Point(self.points[0][0], self.points[0][1])) or self.collides(Point(othershape.points[0][0], othershape.points[0][1])) # <<<<<<<<<<<<<< @@ -95939,24 +98967,24 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje * */ __Pyx_XDECREF(__pyx_r); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2804, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2804, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2804, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2804, __pyx_L1_error) + __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_13, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2804, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_13, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2804, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_13, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2804, __pyx_L1_error) + __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_13, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_14, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2804, __pyx_L1_error) + __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_14, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = NULL; @@ -95979,7 +99007,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2804, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } @@ -96002,11 +99030,11 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2804, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2804, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2890, __pyx_L1_error) if (!__pyx_t_6) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else { @@ -96015,24 +99043,24 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; goto __pyx_L43_bool_binop_done; } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2804, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2804, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Point); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_points_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2804, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_points_2); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_13, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2804, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_13, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; - __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2804, __pyx_L1_error) + __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_13); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_points_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2804, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_points_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2804, __pyx_L1_error) + __pyx_t_14 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_14); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_14, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2804, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_14, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; __pyx_t_14 = NULL; @@ -96055,7 +99083,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2804, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } @@ -96078,7 +99106,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2804, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2890, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -96090,7 +99118,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_t_11 = 0; goto __pyx_L0; - /* "collisions.py":2800 + /* "collisions.py":2886 * return True * return othershape.collides(Point(self.points[0][0], self.points[0][1])) or self.collides(Point(othershape.x, othershape.y)) * if checkShpType(othershape, ShpTyps.Polygon): # <<<<<<<<<<<<<< @@ -96099,7 +99127,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje */ } - /* "collisions.py":2805 + /* "collisions.py":2891 * return True * return othershape.collides(Point(self.points[0][0], self.points[0][1])) or self.collides(Point(othershape.points[0][0], othershape.points[0][1])) * return othershape._collides(self) # <<<<<<<<<<<<<< @@ -96107,7 +99135,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje * def toLines(self) -> Iterable[Line]: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2805, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_othershape, __pyx_n_s_collides); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; __pyx_t_4 = 0; @@ -96127,7 +99155,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_cur_scope->__pyx_v_self}; __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2805, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2891, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } @@ -96135,7 +99163,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje __pyx_t_11 = 0; goto __pyx_L0; - /* "collisions.py":2761 + /* "collisions.py":2847 * ) + (self.points[len(self.points)-1][0] * self.points[0][1] - self.points[0][0] * self.points[len(self.points)-1][1])) / 2 * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< @@ -96166,7 +99194,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_14_collides(CYTHON_UNUSED PyObje return __pyx_r; } -/* "collisions.py":2807 +/* "collisions.py":2893 * return othershape._collides(self) * * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< @@ -96228,12 +99256,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2807, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2893, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toLines") < 0)) __PYX_ERR(0, 2807, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toLines") < 0)) __PYX_ERR(0, 2893, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -96244,7 +99272,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("toLines", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2807, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("toLines", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2893, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -96291,7 +99319,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_16toLines(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toLines", 1); - /* "collisions.py":2812 + /* "collisions.py":2898 * Iterable[Line]: Get a list of all the Lines that make up this object. * """ * return [ # <<<<<<<<<<<<<< @@ -96300,43 +99328,43 @@ static PyObject *__pyx_pf_10collisions_7Polygon_16toLines(CYTHON_UNUSED PyObject */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2812, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2898, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "collisions.py":2814 + /* "collisions.py":2900 * return [ * Line(self.points[i], self.points[i+1]) * for i in range(len(self.points)-1) # <<<<<<<<<<<<<< * ] + [Line(self.points[len(self.points)-1], self.points[0])] * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2814, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2900, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2814, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2900, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = (__pyx_t_3 - 1); __pyx_t_3 = __pyx_t_4; for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) { __pyx_9genexpr68__pyx_v_i = __pyx_t_5; - /* "collisions.py":2813 + /* "collisions.py":2899 * """ * return [ * Line(self.points[i], self.points[i+1]) # <<<<<<<<<<<<<< * for i in range(len(self.points)-1) * ] + [Line(self.points[len(self.points)-1], self.points[0])] */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Line); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2813, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Line); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2813, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_7, __pyx_9genexpr68__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2813, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_7, __pyx_9genexpr68__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2813, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_9 = (__pyx_9genexpr68__pyx_v_i + 1); - __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_7, __pyx_t_9, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2813, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_7, __pyx_t_9, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; @@ -96359,37 +99387,37 @@ static PyObject *__pyx_pf_10collisions_7Polygon_16toLines(CYTHON_UNUSED PyObject __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2813, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2899, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2812, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2898, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } } /* exit inner scope */ - /* "collisions.py":2815 + /* "collisions.py":2901 * Line(self.points[i], self.points[i+1]) * for i in range(len(self.points)-1) * ] + [Line(self.points[len(self.points)-1], self.points[0])] # <<<<<<<<<<<<<< * * def toPoints(self) -> Iterable[pointLike]: */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Line); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2815, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Line); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2815, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2815, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = PyObject_Length(__pyx_t_8); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2815, __pyx_L1_error) + __pyx_t_4 = PyObject_Length(__pyx_t_8); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2901, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_3 = (__pyx_t_4 - 1); - __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_10, __pyx_t_3, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2815, __pyx_L1_error) + __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_10, __pyx_t_3, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2815, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_10, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2815, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_10, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; @@ -96412,16 +99440,16 @@ static PyObject *__pyx_pf_10collisions_7Polygon_16toLines(CYTHON_UNUSED PyObject __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2815, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2815, __pyx_L1_error) + __pyx_t_6 = PyList_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(0, 2815, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_2)) __PYX_ERR(0, 2901, __pyx_L1_error); __pyx_t_2 = 0; - __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2815, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2901, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -96429,7 +99457,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_16toLines(CYTHON_UNUSED PyObject __pyx_t_2 = 0; goto __pyx_L0; - /* "collisions.py":2807 + /* "collisions.py":2893 * return othershape._collides(self) * * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< @@ -96453,7 +99481,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_16toLines(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":2817 +/* "collisions.py":2903 * ] + [Line(self.points[len(self.points)-1], self.points[0])] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -96515,12 +99543,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2817, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2903, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toPoints") < 0)) __PYX_ERR(0, 2817, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "toPoints") < 0)) __PYX_ERR(0, 2903, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -96531,7 +99559,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("toPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2817, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("toPoints", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2903, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -96572,7 +99600,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_18toPoints(CYTHON_UNUSED PyObjec int __pyx_clineno = 0; __Pyx_RefNannySetupContext("toPoints", 1); - /* "collisions.py":2822 + /* "collisions.py":2908 * Iterable[pointLike]: Get a list of all the Points that make up this object. * """ * return [list(i) for i in self.points] # <<<<<<<<<<<<<< @@ -96581,18 +99609,18 @@ static PyObject *__pyx_pf_10collisions_7Polygon_18toPoints(CYTHON_UNUSED PyObjec */ __Pyx_XDECREF(__pyx_r); { /* enter inner scope */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2822, __pyx_L5_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2908, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2822, __pyx_L5_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2908, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2822, __pyx_L5_error) + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2908, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2822, __pyx_L5_error) + __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2908, __pyx_L5_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -96601,28 +99629,28 @@ static PyObject *__pyx_pf_10collisions_7Polygon_18toPoints(CYTHON_UNUSED PyObjec { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2822, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2908, __pyx_L5_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2822, __pyx_L5_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2908, __pyx_L5_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2822, __pyx_L5_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2908, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2822, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2908, __pyx_L5_error) #endif if (__pyx_t_4 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2822, __pyx_L5_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 2908, __pyx_L5_error) #else - __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2822, __pyx_L5_error) + __pyx_t_2 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2908, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -96632,7 +99660,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_18toPoints(CYTHON_UNUSED PyObjec PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2822, __pyx_L5_error) + else __PYX_ERR(0, 2908, __pyx_L5_error) } break; } @@ -96640,9 +99668,9 @@ static PyObject *__pyx_pf_10collisions_7Polygon_18toPoints(CYTHON_UNUSED PyObjec } __Pyx_XDECREF_SET(__pyx_9genexpr69__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PySequence_List(__pyx_9genexpr69__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2822, __pyx_L5_error) + __pyx_t_2 = PySequence_List(__pyx_9genexpr69__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2908, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2822, __pyx_L5_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 2908, __pyx_L5_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -96657,7 +99685,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_18toPoints(CYTHON_UNUSED PyObjec __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2817 + /* "collisions.py":2903 * ] + [Line(self.points[len(self.points)-1], self.points[0])] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< @@ -96679,7 +99707,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_18toPoints(CYTHON_UNUSED PyObjec return __pyx_r; } -/* "collisions.py":2824 +/* "collisions.py":2910 * return [list(i) for i in self.points] * * def copy(self) -> 'Polygon': # <<<<<<<<<<<<<< @@ -96741,12 +99769,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2824, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2910, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(0, 2824, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "copy") < 0)) __PYX_ERR(0, 2910, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -96757,7 +99785,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("copy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2824, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("copy", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2910, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -96796,7 +99824,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_20copy(CYTHON_UNUSED PyObject *_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("copy", 1); - /* "collisions.py":2828 + /* "collisions.py":2914 * And then he lifted his arms and said, 'LET THERE BE ANOTHER!' * """ * return Polygon(*self.points, errorOnLT3=False, bounciness=self.bounciness) # <<<<<<<<<<<<<< @@ -96804,21 +99832,21 @@ static PyObject *__pyx_pf_10collisions_7Polygon_20copy(CYTHON_UNUSED PyObject *_ * def __setitem__(self, item: int, new: pointLike) -> None: */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2828, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2828, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2828, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2828, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_errorOnLT3, Py_False) < 0) __PYX_ERR(0, 2828, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2828, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_errorOnLT3, Py_False) < 0) __PYX_ERR(0, 2914, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bounciness); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_bounciness, __pyx_t_4) < 0) __PYX_ERR(0, 2828, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_bounciness, __pyx_t_4) < 0) __PYX_ERR(0, 2914, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2828, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2914, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -96827,7 +99855,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_20copy(CYTHON_UNUSED PyObject *_ __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":2824 + /* "collisions.py":2910 * return [list(i) for i in self.points] * * def copy(self) -> 'Polygon': # <<<<<<<<<<<<<< @@ -96849,7 +99877,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_20copy(CYTHON_UNUSED PyObject *_ return __pyx_r; } -/* "collisions.py":2830 +/* "collisions.py":2916 * return Polygon(*self.points, errorOnLT3=False, bounciness=self.bounciness) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< @@ -96916,7 +99944,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2830, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2916, __pyx_L3_error) else goto __pyx_L5_argtuple_error; CYTHON_FALLTHROUGH; case 1: @@ -96924,9 +99952,9 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[1]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2830, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2916, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 2830, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 1); __PYX_ERR(0, 2916, __pyx_L3_error) } CYTHON_FALLTHROUGH; case 2: @@ -96934,14 +99962,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[2]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2830, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2916, __pyx_L3_error) else { - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 2830, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, 2); __PYX_ERR(0, 2916, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(0, 2830, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setitem__") < 0)) __PYX_ERR(0, 2916, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 3)) { goto __pyx_L5_argtuple_error; @@ -96956,7 +99984,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 2830, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__setitem__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 2916, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -96970,7 +99998,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_item), (&PyInt_Type), 0, "item", 1))) __PYX_ERR(0, 2830, __pyx_L1_error) + if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_item), (&PyInt_Type), 0, "item", 1))) __PYX_ERR(0, 2916, __pyx_L1_error) __pyx_r = __pyx_pf_10collisions_7Polygon_22__setitem__(__pyx_self, __pyx_v_self, __pyx_v_item, __pyx_v_new); /* function exit code */ @@ -96997,19 +100025,19 @@ static PyObject *__pyx_pf_10collisions_7Polygon_22__setitem__(CYTHON_UNUSED PyOb int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__setitem__", 1); - /* "collisions.py":2831 + /* "collisions.py":2917 * * def __setitem__(self, item: int, new: pointLike) -> None: * self.points[item] = new # <<<<<<<<<<<<<< * * def __str__(self): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2831, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2917, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_new) < 0))) __PYX_ERR(0, 2831, __pyx_L1_error) + if (unlikely((PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_new) < 0))) __PYX_ERR(0, 2917, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "collisions.py":2830 + /* "collisions.py":2916 * return Polygon(*self.points, errorOnLT3=False, bounciness=self.bounciness) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< @@ -97030,7 +100058,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_22__setitem__(CYTHON_UNUSED PyOb return __pyx_r; } -/* "collisions.py":2833 +/* "collisions.py":2919 * self.points[item] = new * * def __str__(self): # <<<<<<<<<<<<<< @@ -97091,12 +100119,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2833, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2919, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 2833, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__str__") < 0)) __PYX_ERR(0, 2919, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -97107,7 +100135,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2833, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("__str__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2919, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -97147,7 +100175,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_24__str__(CYTHON_UNUSED PyObject int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__str__", 1); - /* "collisions.py":2834 + /* "collisions.py":2920 * * def __str__(self): * return f'' # <<<<<<<<<<<<<< @@ -97155,7 +100183,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_24__str__(CYTHON_UNUSED PyObject * class ShapeCombiner: */ __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2834, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = 0; __pyx_t_3 = 127; @@ -97163,9 +100191,9 @@ static PyObject *__pyx_pf_10collisions_7Polygon_24__str__(CYTHON_UNUSED PyObject __pyx_t_2 += 21; __Pyx_GIVEREF(__pyx_kp_u_Polygon_with_points); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Polygon_with_points); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2834, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_points_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2834, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3; @@ -97173,18 +100201,18 @@ static PyObject *__pyx_pf_10collisions_7Polygon_24__str__(CYTHON_UNUSED PyObject __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); __pyx_t_5 = 0; - __Pyx_INCREF(__pyx_kp_u__5); + __Pyx_INCREF(__pyx_kp_u__7); __pyx_t_2 += 1; - __Pyx_GIVEREF(__pyx_kp_u__5); - PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__5); - __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2834, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_kp_u__7); + PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__7); + __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2920, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_r = __pyx_t_5; __pyx_t_5 = 0; goto __pyx_L0; - /* "collisions.py":2833 + /* "collisions.py":2919 * self.points[item] = new * * def __str__(self): # <<<<<<<<<<<<<< @@ -97205,7 +100233,7 @@ static PyObject *__pyx_pf_10collisions_7Polygon_24__str__(CYTHON_UNUSED PyObject return __pyx_r; } -/* "collisions.py":2839 +/* "collisions.py":2925 * """A class to combine shapes together. You do not actually need to create an object of this as all the methods are static. * Instead you just run things like `ShapeCombiner.combineRects(rect1, rect2, rect3)`.""" * @staticmethod # <<<<<<<<<<<<<< @@ -97242,7 +100270,7 @@ static PyObject *__pyx_pw_10collisions_13ShapeCombiner_1boundingBox(PyObject *__ } static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_2generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "collisions.py":2851 +/* "collisions.py":2937 * rs = [s.rect() for s in shapes] * mins, maxs = [ * min(i[0] for i in rs), # <<<<<<<<<<<<<< @@ -97251,18 +100279,18 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_2generator1 */ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_11boundingBox_genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_30_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_30_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_31_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_31_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2851, __pyx_L1_error) + __PYX_ERR(0, 2937, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -97270,7 +100298,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_11boundingBox_genexpr(CYT __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_13ShapeCombiner_11boundingBox_2generator13, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ShapeCombiner_boundingBox_locals, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 2851, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_13ShapeCombiner_11boundingBox_2generator13, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ShapeCombiner_boundingBox_locals, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 2937, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -97288,7 +100316,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_11boundingBox_genexpr(CYT static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_2generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -97306,29 +100334,29 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_2generator1 return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2851, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2851, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2937, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2937, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2851, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2937, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 2851, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 2937, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2851, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2851, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_i, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -97346,7 +100374,7 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_2generator1 __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2851, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2937, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -97371,7 +100399,7 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_2generator1 } static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_5generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "collisions.py":2852 +/* "collisions.py":2938 * mins, maxs = [ * min(i[0] for i in rs), * min(i[1] for i in rs) # <<<<<<<<<<<<<< @@ -97380,18 +100408,18 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_5generator1 */ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_11boundingBox_3genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_31_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_31_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_32_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_32_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2852, __pyx_L1_error) + __PYX_ERR(0, 2938, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -97399,7 +100427,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_11boundingBox_3genexpr(CY __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_13ShapeCombiner_11boundingBox_5generator14, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ShapeCombiner_boundingBox_locals, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 2852, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_13ShapeCombiner_11boundingBox_5generator14, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ShapeCombiner_boundingBox_locals, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 2938, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -97417,7 +100445,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_11boundingBox_3genexpr(CY static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_5generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -97435,29 +100463,29 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_5generator1 return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2852, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2852, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2938, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2938, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2852, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2938, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 2852, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 2938, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2852, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2852, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_i, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -97475,7 +100503,7 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_5generator1 __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2852, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2938, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -97500,7 +100528,7 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_5generator1 } static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_8generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "collisions.py":2854 +/* "collisions.py":2940 * min(i[1] for i in rs) * ], [ * max(i[2] for i in rs), # <<<<<<<<<<<<<< @@ -97509,18 +100537,18 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_8generator1 */ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_11boundingBox_6genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_32_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_32_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_33_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_33_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2854, __pyx_L1_error) + __PYX_ERR(0, 2940, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -97528,7 +100556,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_11boundingBox_6genexpr(CY __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_13ShapeCombiner_11boundingBox_8generator15, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ShapeCombiner_boundingBox_locals, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 2854, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_13ShapeCombiner_11boundingBox_8generator15, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ShapeCombiner_boundingBox_locals, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 2940, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -97546,7 +100574,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_11boundingBox_6genexpr(CY static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_8generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -97564,29 +100592,29 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_8generator1 return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2854, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2854, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2940, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2940, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2854, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2940, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 2854, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 2940, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2854, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_i, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2854, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_i, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -97604,7 +100632,7 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_8generator1 __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2854, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2940, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -97629,7 +100657,7 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_8generator1 } static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_11generator16(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "collisions.py":2855 +/* "collisions.py":2941 * ], [ * max(i[2] for i in rs), * max(i[3] for i in rs) # <<<<<<<<<<<<<< @@ -97638,18 +100666,18 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_11generator */ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_11boundingBox_9genexpr(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_34_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_33_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_33_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_34_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_34_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_34_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_34_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2855, __pyx_L1_error) + __PYX_ERR(0, 2941, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } @@ -97657,7 +100685,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_11boundingBox_9genexpr(CY __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_13ShapeCombiner_11boundingBox_11generator16, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ShapeCombiner_boundingBox_locals, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 2855, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_13ShapeCombiner_11boundingBox_11generator16, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ShapeCombiner_boundingBox_locals, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 2941, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -97675,7 +100703,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_11boundingBox_9genexpr(CY static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_11generator16(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10collisions___pyx_scope_struct_34_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_34_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -97693,29 +100721,29 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_11generator return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2855, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2855, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2941, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2941, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2855, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2941, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 2855, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 2941, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2855, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_i); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_i, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_i, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2855, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_i, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_r = __pyx_t_3; __pyx_t_3 = 0; @@ -97733,7 +100761,7 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_11generator __pyx_cur_scope->__pyx_t_0 = 0; __Pyx_XGOTREF(__pyx_t_1); __pyx_t_2 = __pyx_cur_scope->__pyx_t_1; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2855, __pyx_L1_error) + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2941, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope); @@ -97757,7 +100785,7 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_11boundingBox_11generator return __pyx_r; } -/* "collisions.py":2839 +/* "collisions.py":2925 * """A class to combine shapes together. You do not actually need to create an object of this as all the methods are static. * Instead you just run things like `ShapeCombiner.combineRects(rect1, rect2, rect3)`.""" * @staticmethod # <<<<<<<<<<<<<< @@ -97793,7 +100821,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_boundingBox(CYTHON_UNUSED int __pyx_clineno = 0; __Pyx_RefNannySetupContext("boundingBox", 1); - /* "collisions.py":2847 + /* "collisions.py":2933 * Shapes: A Shapes object containing one rectangle (if there are any shapes in shapes; else nothing) which is the bounding box around every input shape. * """ * if not shapes: # <<<<<<<<<<<<<< @@ -97804,7 +100832,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_boundingBox(CYTHON_UNUSED __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { - /* "collisions.py":2848 + /* "collisions.py":2934 * """ * if not shapes: * return Shapes() # <<<<<<<<<<<<<< @@ -97812,7 +100840,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_boundingBox(CYTHON_UNUSED * mins, maxs = [ */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2848, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2934, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -97832,7 +100860,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_boundingBox(CYTHON_UNUSED PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2848, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2934, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -97840,7 +100868,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_boundingBox(CYTHON_UNUSED __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2847 + /* "collisions.py":2933 * Shapes: A Shapes object containing one rectangle (if there are any shapes in shapes; else nothing) which is the bounding box around every input shape. * """ * if not shapes: # <<<<<<<<<<<<<< @@ -97849,7 +100877,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_boundingBox(CYTHON_UNUSED */ } - /* "collisions.py":2849 + /* "collisions.py":2935 * if not shapes: * return Shapes() * rs = [s.rect() for s in shapes] # <<<<<<<<<<<<<< @@ -97857,7 +100885,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_boundingBox(CYTHON_UNUSED * min(i[0] for i in rs), */ { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2849, __pyx_L6_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2935, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_v_shapes; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; @@ -97865,19 +100893,19 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_boundingBox(CYTHON_UNUSED { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2849, __pyx_L6_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2935, __pyx_L6_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2849, __pyx_L6_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2935, __pyx_L6_error) #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2849, __pyx_L6_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2935, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_XDECREF_SET(__pyx_9genexpr70__pyx_v_s, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr70__pyx_v_s, __pyx_n_s_rect); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2849, __pyx_L6_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr70__pyx_v_s, __pyx_n_s_rect); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2935, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_6 = 0; @@ -97897,11 +100925,11 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_boundingBox(CYTHON_UNUSED PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2849, __pyx_L6_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2935, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 2849, __pyx_L6_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 2935, __pyx_L6_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -97915,87 +100943,87 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_boundingBox(CYTHON_UNUSED __pyx_v_rs = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2851 + /* "collisions.py":2937 * rs = [s.rect() for s in shapes] * mins, maxs = [ * min(i[0] for i in rs), # <<<<<<<<<<<<<< * min(i[1] for i in rs) * ], [ */ - __pyx_t_3 = __pyx_pf_10collisions_13ShapeCombiner_11boundingBox_genexpr(NULL, __pyx_v_rs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2851, __pyx_L1_error) + __pyx_t_3 = __pyx_pf_10collisions_13ShapeCombiner_11boundingBox_genexpr(NULL, __pyx_v_rs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2851, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2937, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2852 + /* "collisions.py":2938 * mins, maxs = [ * min(i[0] for i in rs), * min(i[1] for i in rs) # <<<<<<<<<<<<<< * ], [ * max(i[2] for i in rs), */ - __pyx_t_3 = __pyx_pf_10collisions_13ShapeCombiner_11boundingBox_3genexpr(NULL, __pyx_v_rs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2852, __pyx_L1_error) + __pyx_t_3 = __pyx_pf_10collisions_13ShapeCombiner_11boundingBox_3genexpr(NULL, __pyx_v_rs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2852, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2938, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2850 + /* "collisions.py":2936 * return Shapes() * rs = [s.rect() for s in shapes] * mins, maxs = [ # <<<<<<<<<<<<<< * min(i[0] for i in rs), * min(i[1] for i in rs) */ - __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2850, __pyx_L1_error) + __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2936, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 2850, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 2936, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_5)) __PYX_ERR(0, 2850, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_5)) __PYX_ERR(0, 2936, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_5 = 0; - /* "collisions.py":2854 + /* "collisions.py":2940 * min(i[1] for i in rs) * ], [ * max(i[2] for i in rs), # <<<<<<<<<<<<<< * max(i[3] for i in rs) * ] */ - __pyx_t_5 = __pyx_pf_10collisions_13ShapeCombiner_11boundingBox_6genexpr(NULL, __pyx_v_rs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2854, __pyx_L1_error) + __pyx_t_5 = __pyx_pf_10collisions_13ShapeCombiner_11boundingBox_6genexpr(NULL, __pyx_v_rs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2854, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2940, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "collisions.py":2855 + /* "collisions.py":2941 * ], [ * max(i[2] for i in rs), * max(i[3] for i in rs) # <<<<<<<<<<<<<< * ] * return Shapes(Rect( */ - __pyx_t_5 = __pyx_pf_10collisions_13ShapeCombiner_11boundingBox_9genexpr(NULL, __pyx_v_rs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2855, __pyx_L1_error) + __pyx_t_5 = __pyx_pf_10collisions_13ShapeCombiner_11boundingBox_9genexpr(NULL, __pyx_v_rs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2855, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2941, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "collisions.py":2853 + /* "collisions.py":2939 * min(i[0] for i in rs), * min(i[1] for i in rs) * ], [ # <<<<<<<<<<<<<< * max(i[2] for i in rs), * max(i[3] for i in rs) */ - __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2853, __pyx_L1_error) + __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2939, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 2853, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_4)) __PYX_ERR(0, 2939, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_8); - if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_8)) __PYX_ERR(0, 2853, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_8)) __PYX_ERR(0, 2939, __pyx_L1_error); __pyx_t_4 = 0; __pyx_t_8 = 0; __pyx_v_mins = ((PyObject*)__pyx_t_3); @@ -98003,7 +101031,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_boundingBox(CYTHON_UNUSED __pyx_v_maxs = ((PyObject*)__pyx_t_5); __pyx_t_5 = 0; - /* "collisions.py":2857 + /* "collisions.py":2943 * max(i[3] for i in rs) * ] * return Shapes(Rect( # <<<<<<<<<<<<<< @@ -98011,73 +101039,73 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_boundingBox(CYTHON_UNUSED * maxs[0]-mins[0], */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2857, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Rect); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2857, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Rect); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - /* "collisions.py":2858 + /* "collisions.py":2944 * ] * return Shapes(Rect( * *mins, # <<<<<<<<<<<<<< * maxs[0]-mins[0], * maxs[1]-mins[1] */ - __pyx_t_4 = PySequence_Tuple(__pyx_v_mins); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2857, __pyx_L1_error) + __pyx_t_4 = PySequence_Tuple(__pyx_v_mins); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - /* "collisions.py":2859 + /* "collisions.py":2945 * return Shapes(Rect( * *mins, * maxs[0]-mins[0], # <<<<<<<<<<<<<< * maxs[1]-mins[1] * )) */ - __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_maxs, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2859, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_maxs, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_10 = __Pyx_GetItemInt_List(__pyx_v_mins, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2859, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetItemInt_List(__pyx_v_mins, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = PyNumber_Subtract(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2859, __pyx_L1_error) + __pyx_t_11 = PyNumber_Subtract(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2860 + /* "collisions.py":2946 * *mins, * maxs[0]-mins[0], * maxs[1]-mins[1] # <<<<<<<<<<<<<< * )) * */ - __pyx_t_10 = __Pyx_GetItemInt_List(__pyx_v_maxs, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2860, __pyx_L1_error) + __pyx_t_10 = __Pyx_GetItemInt_List(__pyx_v_maxs, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2946, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_mins, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2860, __pyx_L1_error) + __pyx_t_9 = __Pyx_GetItemInt_List(__pyx_v_mins, 1, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2946, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_12 = PyNumber_Subtract(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2860, __pyx_L1_error) + __pyx_t_12 = PyNumber_Subtract(__pyx_t_10, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2946, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "collisions.py":2857 + /* "collisions.py":2943 * max(i[3] for i in rs) * ] * return Shapes(Rect( # <<<<<<<<<<<<<< * *mins, * maxs[0]-mins[0], */ - __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2857, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_11)) __PYX_ERR(0, 2857, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_11)) __PYX_ERR(0, 2943, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_12); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_12)) __PYX_ERR(0, 2857, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_12)) __PYX_ERR(0, 2943, __pyx_L1_error); __pyx_t_11 = 0; __pyx_t_12 = 0; - __pyx_t_12 = PyNumber_Add(__pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2857, __pyx_L1_error) + __pyx_t_12 = PyNumber_Add(__pyx_t_4, __pyx_t_9); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_12, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2857, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_12, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; @@ -98100,7 +101128,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_boundingBox(CYTHON_UNUSED __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2857, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2943, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -98108,7 +101136,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_boundingBox(CYTHON_UNUSED __pyx_t_5 = 0; goto __pyx_L0; - /* "collisions.py":2839 + /* "collisions.py":2925 * """A class to combine shapes together. You do not actually need to create an object of this as all the methods are static. * Instead you just run things like `ShapeCombiner.combineRects(rect1, rect2, rect3)`.""" * @staticmethod # <<<<<<<<<<<<<< @@ -98142,7 +101170,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_boundingBox(CYTHON_UNUSED return __pyx_r; } -/* "collisions.py":2863 +/* "collisions.py":2949 * )) * * @staticmethod # <<<<<<<<<<<<<< @@ -98178,7 +101206,7 @@ static PyObject *__pyx_pw_10collisions_13ShapeCombiner_3combineRects(PyObject *_ return __pyx_r; } -/* "collisions.py":2886 +/* "collisions.py":2972 * merged = False * # Sort shapes by x-coordinate * shapes = sorted(shapes, key=lambda x: x.x) # <<<<<<<<<<<<<< @@ -98239,12 +101267,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2886, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2972, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda38") < 0)) __PYX_ERR(0, 2886, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda38") < 0)) __PYX_ERR(0, 2972, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -98255,7 +101283,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda38", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2886, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda38", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2972, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -98291,7 +101319,7 @@ static PyObject *__pyx_lambda_funcdef_lambda38(CYTHON_UNUSED PyObject *__pyx_sel int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda38", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2886, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -98308,7 +101336,7 @@ static PyObject *__pyx_lambda_funcdef_lambda38(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "collisions.py":2900 +/* "collisions.py":2986 * * # Sort shapes by y-coordinate * outshapes1 = sorted(outshapes1, key=lambda x: x.y) # <<<<<<<<<<<<<< @@ -98369,12 +101397,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2900, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2986, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda39") < 0)) __PYX_ERR(0, 2900, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda39") < 0)) __PYX_ERR(0, 2986, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -98385,7 +101413,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda39", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2900, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda39", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2986, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -98421,7 +101449,7 @@ static PyObject *__pyx_lambda_funcdef_lambda39(CYTHON_UNUSED PyObject *__pyx_sel int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda39", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2900, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; @@ -98438,7 +101466,7 @@ static PyObject *__pyx_lambda_funcdef_lambda39(CYTHON_UNUSED PyObject *__pyx_sel return __pyx_r; } -/* "collisions.py":2863 +/* "collisions.py":2949 * )) * * @staticmethod # <<<<<<<<<<<<<< @@ -98476,18 +101504,18 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS __Pyx_RefNannySetupContext("combineRects", 0); __Pyx_INCREF(__pyx_v_shapes); - /* "collisions.py":2879 + /* "collisions.py":2965 * Shapes: A Shapes object with the rectangles from the input shapes combined * """ * if not shapes: # <<<<<<<<<<<<<< * return Shapes() * shapes, others = [i for i in shapes if checkShpType(i, ShpTyps.Rect)], [i for i in shapes if not checkShpType(i, ShpTyps.Rect)] */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_shapes); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2879, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_shapes); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2965, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { - /* "collisions.py":2880 + /* "collisions.py":2966 * """ * if not shapes: * return Shapes() # <<<<<<<<<<<<<< @@ -98495,7 +101523,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS * merged = True */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2880, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -98515,7 +101543,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2880, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2966, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -98523,7 +101551,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2879 + /* "collisions.py":2965 * Shapes: A Shapes object with the rectangles from the input shapes combined * """ * if not shapes: # <<<<<<<<<<<<<< @@ -98532,7 +101560,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS */ } - /* "collisions.py":2881 + /* "collisions.py":2967 * if not shapes: * return Shapes() * shapes, others = [i for i in shapes if checkShpType(i, ShpTyps.Rect)], [i for i in shapes if not checkShpType(i, ShpTyps.Rect)] # <<<<<<<<<<<<<< @@ -98540,16 +101568,16 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS * while merged: */ { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2881, __pyx_L6_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2967, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_v_shapes)) || PyTuple_CheckExact(__pyx_v_shapes)) { __pyx_t_4 = __pyx_v_shapes; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2881, __pyx_L6_error) + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2967, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2881, __pyx_L6_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2967, __pyx_L6_error) } for (;;) { if (likely(!__pyx_t_8)) { @@ -98557,28 +101585,28 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2881, __pyx_L6_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2967, __pyx_L6_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2881, __pyx_L6_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2967, __pyx_L6_error) #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2881, __pyx_L6_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2967, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2881, __pyx_L6_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2967, __pyx_L6_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2881, __pyx_L6_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2967, __pyx_L6_error) #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2881, __pyx_L6_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2967, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -98588,7 +101616,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2881, __pyx_L6_error) + else __PYX_ERR(0, 2967, __pyx_L6_error) } break; } @@ -98596,11 +101624,11 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS } __Pyx_XDECREF_SET(__pyx_9genexpr75__pyx_v_i, __pyx_t_5); __pyx_t_5 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2881, __pyx_L6_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2967, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2881, __pyx_L6_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2967, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_Rect); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2881, __pyx_L6_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_Rect); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2967, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; @@ -98622,14 +101650,14 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2881, __pyx_L6_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2967, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2881, __pyx_L6_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2967, __pyx_L6_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_2) { - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_9genexpr75__pyx_v_i))) __PYX_ERR(0, 2881, __pyx_L6_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_9genexpr75__pyx_v_i))) __PYX_ERR(0, 2967, __pyx_L6_error) } } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -98641,16 +101669,16 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS __pyx_L11_exit_scope:; } /* exit inner scope */ { /* enter inner scope */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2881, __pyx_L14_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2967, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_4); if (likely(PyList_CheckExact(__pyx_v_shapes)) || PyTuple_CheckExact(__pyx_v_shapes)) { __pyx_t_5 = __pyx_v_shapes; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_shapes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2881, __pyx_L14_error) + __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_shapes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2967, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2881, __pyx_L14_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2967, __pyx_L14_error) } for (;;) { if (likely(!__pyx_t_8)) { @@ -98658,28 +101686,28 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2881, __pyx_L14_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2967, __pyx_L14_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2881, __pyx_L14_error) + __pyx_t_9 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2967, __pyx_L14_error) #else - __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2881, __pyx_L14_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2967, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_9); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2881, __pyx_L14_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2967, __pyx_L14_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2881, __pyx_L14_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2967, __pyx_L14_error) #else - __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2881, __pyx_L14_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2967, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_9); #endif } @@ -98689,7 +101717,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2881, __pyx_L14_error) + else __PYX_ERR(0, 2967, __pyx_L14_error) } break; } @@ -98697,11 +101725,11 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS } __Pyx_XDECREF_SET(__pyx_9genexpr76__pyx_v_i, __pyx_t_9); __pyx_t_9 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2881, __pyx_L14_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2967, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2881, __pyx_L14_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2967, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_Rect); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2881, __pyx_L14_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_Rect); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2967, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; @@ -98723,15 +101751,15 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_6, 2+__pyx_t_6); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2881, __pyx_L14_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2967, __pyx_L14_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2881, __pyx_L14_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2967, __pyx_L14_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_1 = (!__pyx_t_2); if (__pyx_t_1) { - if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_9genexpr76__pyx_v_i))) __PYX_ERR(0, 2881, __pyx_L14_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_9genexpr76__pyx_v_i))) __PYX_ERR(0, 2967, __pyx_L14_error) } } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -98747,7 +101775,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS __pyx_v_others = ((PyObject*)__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2882 + /* "collisions.py":2968 * return Shapes() * shapes, others = [i for i in shapes if checkShpType(i, ShpTyps.Rect)], [i for i in shapes if not checkShpType(i, ShpTyps.Rect)] * merged = True # <<<<<<<<<<<<<< @@ -98756,7 +101784,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS */ __pyx_v_merged = 1; - /* "collisions.py":2883 + /* "collisions.py":2969 * shapes, others = [i for i in shapes if checkShpType(i, ShpTyps.Rect)], [i for i in shapes if not checkShpType(i, ShpTyps.Rect)] * merged = True * while merged: # <<<<<<<<<<<<<< @@ -98766,7 +101794,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS while (1) { if (!__pyx_v_merged) break; - /* "collisions.py":2884 + /* "collisions.py":2970 * merged = True * while merged: * merged = False # <<<<<<<<<<<<<< @@ -98775,44 +101803,44 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS */ __pyx_v_merged = 0; - /* "collisions.py":2886 + /* "collisions.py":2972 * merged = False * # Sort shapes by x-coordinate * shapes = sorted(shapes, key=lambda x: x.x) # <<<<<<<<<<<<<< * outshapes1 = [] * */ - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2886, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_shapes); __Pyx_GIVEREF(__pyx_v_shapes); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shapes)) __PYX_ERR(0, 2886, __pyx_L1_error); - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2886, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shapes)) __PYX_ERR(0, 2972, __pyx_L1_error); + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_13ShapeCombiner_12combineRects_lambda38, 0, __pyx_n_s_ShapeCombiner_combineRects_local, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2886, __pyx_L1_error) + __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_13ShapeCombiner_12combineRects_lambda38, 0, __pyx_n_s_ShapeCombiner_combineRects_local, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_key, __pyx_t_5) < 0) __PYX_ERR(0, 2886, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_key, __pyx_t_5) < 0) __PYX_ERR(0, 2972, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2886, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2972, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_shapes, __pyx_t_5); __pyx_t_5 = 0; - /* "collisions.py":2887 + /* "collisions.py":2973 * # Sort shapes by x-coordinate * shapes = sorted(shapes, key=lambda x: x.x) * outshapes1 = [] # <<<<<<<<<<<<<< * * while shapes: */ - __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2887, __pyx_L1_error) + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2973, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_outshapes1, __pyx_t_5); __pyx_t_5 = 0; - /* "collisions.py":2889 + /* "collisions.py":2975 * outshapes1 = [] * * while shapes: # <<<<<<<<<<<<<< @@ -98820,22 +101848,22 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS * for i in shapes: */ while (1) { - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_shapes); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2889, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_shapes); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2975, __pyx_L1_error) if (!__pyx_t_1) break; - /* "collisions.py":2890 + /* "collisions.py":2976 * * while shapes: * rect = shapes.pop(0) # <<<<<<<<<<<<<< * for i in shapes: * if rect.y == i.y and rect.h == i.h and (rect.x + rect.w >= i.x): */ - __pyx_t_5 = __Pyx_PyObject_PopIndex(__pyx_v_shapes, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2890, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_PopIndex(__pyx_v_shapes, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2976, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_rect, __pyx_t_5); __pyx_t_5 = 0; - /* "collisions.py":2891 + /* "collisions.py":2977 * while shapes: * rect = shapes.pop(0) * for i in shapes: # <<<<<<<<<<<<<< @@ -98847,9 +101875,9 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_shapes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2891, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_shapes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2977, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2891, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2977, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { @@ -98857,28 +101885,28 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2891, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2977, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2891, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2977, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2891, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2977, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2891, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2977, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2891, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2977, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2891, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2977, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -98888,7 +101916,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2891, __pyx_L1_error) + else __PYX_ERR(0, 2977, __pyx_L1_error) } break; } @@ -98897,85 +101925,85 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2892 + /* "collisions.py":2978 * rect = shapes.pop(0) * for i in shapes: * if rect.y == i.y and rect.h == i.h and (rect.x + rect.w >= i.x): # <<<<<<<<<<<<<< * rect.w = max(rect.x + rect.w, i.x + i.w) - rect.x * shapes.remove(i) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2892, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2892, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2892, __pyx_L1_error) + __pyx_t_9 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2978, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2892, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2978, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L27_bool_binop_done; } - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2892, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2892, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_9, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2892, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_9, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2978, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2892, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2978, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L27_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2892, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2892, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2892, __pyx_L1_error) + __pyx_t_9 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2892, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_9, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2892, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_9, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2978, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2892, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2978, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_1 = __pyx_t_2; __pyx_L27_bool_binop_done:; if (__pyx_t_1) { - /* "collisions.py":2893 + /* "collisions.py":2979 * for i in shapes: * if rect.y == i.y and rect.h == i.h and (rect.x + rect.w >= i.x): * rect.w = max(rect.x + rect.w, i.x + i.w) - rect.x # <<<<<<<<<<<<<< * shapes.remove(i) * merged = True */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2893, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2893, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_9 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2893, __pyx_L1_error) + __pyx_t_9 = PyNumber_Add(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2893, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2893, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2893, __pyx_L1_error) + __pyx_t_11 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_4 = PyObject_RichCompare(__pyx_t_9, __pyx_t_11, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2893, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2893, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_9, __pyx_t_11, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2979, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2979, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_1) { __Pyx_INCREF(__pyx_t_9); @@ -98986,23 +102014,23 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2893, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_11 = PyNumber_Subtract(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2893, __pyx_L1_error) + __pyx_t_11 = PyNumber_Subtract(__pyx_t_3, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2979, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_rect, __pyx_n_s_w, __pyx_t_11) < 0) __PYX_ERR(0, 2893, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_rect, __pyx_n_s_w, __pyx_t_11) < 0) __PYX_ERR(0, 2979, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2894 + /* "collisions.py":2980 * if rect.y == i.y and rect.h == i.h and (rect.x + rect.w >= i.x): * rect.w = max(rect.x + rect.w, i.x + i.w) - rect.x * shapes.remove(i) # <<<<<<<<<<<<<< * merged = True * break */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_shapes, __pyx_n_s_remove); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2894, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_shapes, __pyx_n_s_remove); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_3 = NULL; __pyx_t_6 = 0; @@ -99022,13 +102050,13 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_i}; __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2894, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2980, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2895 + /* "collisions.py":2981 * rect.w = max(rect.x + rect.w, i.x + i.w) - rect.x * shapes.remove(i) * merged = True # <<<<<<<<<<<<<< @@ -99037,7 +102065,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS */ __pyx_v_merged = 1; - /* "collisions.py":2896 + /* "collisions.py":2982 * shapes.remove(i) * merged = True * break # <<<<<<<<<<<<<< @@ -99046,7 +102074,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS */ goto __pyx_L25_break; - /* "collisions.py":2892 + /* "collisions.py":2978 * rect = shapes.pop(0) * for i in shapes: * if rect.y == i.y and rect.h == i.h and (rect.x + rect.w >= i.x): # <<<<<<<<<<<<<< @@ -99055,7 +102083,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS */ } - /* "collisions.py":2891 + /* "collisions.py":2977 * while shapes: * rect = shapes.pop(0) * for i in shapes: # <<<<<<<<<<<<<< @@ -99070,54 +102098,54 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS goto __pyx_L30_for_end; __pyx_L30_for_end:; - /* "collisions.py":2897 + /* "collisions.py":2983 * merged = True * break * outshapes1.append(rect) # <<<<<<<<<<<<<< * * # Sort shapes by y-coordinate */ - __pyx_t_13 = __Pyx_PyObject_Append(__pyx_v_outshapes1, __pyx_v_rect); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 2897, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyObject_Append(__pyx_v_outshapes1, __pyx_v_rect); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 2983, __pyx_L1_error) } - /* "collisions.py":2900 + /* "collisions.py":2986 * * # Sort shapes by y-coordinate * outshapes1 = sorted(outshapes1, key=lambda x: x.y) # <<<<<<<<<<<<<< * outshapes2 = [] * */ - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2900, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_outshapes1); __Pyx_GIVEREF(__pyx_v_outshapes1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_outshapes1)) __PYX_ERR(0, 2900, __pyx_L1_error); - __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2900, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_outshapes1)) __PYX_ERR(0, 2986, __pyx_L1_error); + __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_13ShapeCombiner_12combineRects_1lambda39, 0, __pyx_n_s_ShapeCombiner_combineRects_local, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2900, __pyx_L1_error) + __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_13ShapeCombiner_12combineRects_1lambda39, 0, __pyx_n_s_ShapeCombiner_combineRects_local, NULL, __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_key, __pyx_t_9) < 0) __PYX_ERR(0, 2900, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_key, __pyx_t_9) < 0) __PYX_ERR(0, 2986, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_5, __pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2900, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_5, __pyx_t_11); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2986, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF_SET(__pyx_v_outshapes1, __pyx_t_9); __pyx_t_9 = 0; - /* "collisions.py":2901 + /* "collisions.py":2987 * # Sort shapes by y-coordinate * outshapes1 = sorted(outshapes1, key=lambda x: x.y) * outshapes2 = [] # <<<<<<<<<<<<<< * * while outshapes1: */ - __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2901, __pyx_L1_error) + __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2987, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF_SET(__pyx_v_outshapes2, ((PyObject*)__pyx_t_9)); __pyx_t_9 = 0; - /* "collisions.py":2903 + /* "collisions.py":2989 * outshapes2 = [] * * while outshapes1: # <<<<<<<<<<<<<< @@ -99125,22 +102153,22 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS * for i in outshapes1: */ while (1) { - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_outshapes1); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2903, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_outshapes1); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2989, __pyx_L1_error) if (!__pyx_t_1) break; - /* "collisions.py":2904 + /* "collisions.py":2990 * * while outshapes1: * rect = outshapes1.pop(0) # <<<<<<<<<<<<<< * for i in outshapes1: * if rect.x == i.x and rect.w == i.w and (rect.y + rect.h >= i.y): */ - __pyx_t_9 = __Pyx_PyObject_PopIndex(__pyx_v_outshapes1, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2904, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_PopIndex(__pyx_v_outshapes1, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2990, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_XDECREF_SET(__pyx_v_rect, __pyx_t_9); __pyx_t_9 = 0; - /* "collisions.py":2905 + /* "collisions.py":2991 * while outshapes1: * rect = outshapes1.pop(0) * for i in outshapes1: # <<<<<<<<<<<<<< @@ -99152,9 +102180,9 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_outshapes1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2905, __pyx_L1_error) + __pyx_t_7 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_outshapes1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2905, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2991, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_8)) { @@ -99162,28 +102190,28 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_9); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2905, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2991, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_11 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_7); __Pyx_INCREF(__pyx_t_11); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2905, __pyx_L1_error) + __pyx_t_11 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_7); __Pyx_INCREF(__pyx_t_11); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2991, __pyx_L1_error) #else - __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2905, __pyx_L1_error) + __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_9); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2905, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2991, __pyx_L1_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_7); __Pyx_INCREF(__pyx_t_11); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2905, __pyx_L1_error) + __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_7); __Pyx_INCREF(__pyx_t_11); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2991, __pyx_L1_error) #else - __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2905, __pyx_L1_error) + __pyx_t_11 = __Pyx_PySequence_ITEM(__pyx_t_9, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2991, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); #endif } @@ -99193,7 +102221,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2905, __pyx_L1_error) + else __PYX_ERR(0, 2991, __pyx_L1_error) } break; } @@ -99202,85 +102230,85 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2906 + /* "collisions.py":2992 * rect = outshapes1.pop(0) * for i in outshapes1: * if rect.x == i.x and rect.w == i.w and (rect.y + rect.h >= i.y): # <<<<<<<<<<<<<< * rect.h = max(rect.y + rect.h, i.y + i.h) - rect.y * outshapes1.remove(i) */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2906, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_x); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2906, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyObject_RichCompare(__pyx_t_11, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2906, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_t_11, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2992, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2906, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2992, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L36_bool_binop_done; } - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2906, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_w); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2906, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_w); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2906, __pyx_L1_error) + __pyx_t_11 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2992, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2906, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2992, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; if (__pyx_t_2) { } else { __pyx_t_1 = __pyx_t_2; goto __pyx_L36_bool_binop_done; } - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2906, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2906, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyNumber_Add(__pyx_t_11, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2906, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_11, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2906, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2992, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2906, __pyx_L1_error) + __pyx_t_11 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2992, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2906, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2992, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_1 = __pyx_t_2; __pyx_L36_bool_binop_done:; if (__pyx_t_1) { - /* "collisions.py":2907 + /* "collisions.py":2993 * for i in outshapes1: * if rect.x == i.x and rect.w == i.w and (rect.y + rect.h >= i.y): * rect.h = max(rect.y + rect.h, i.y + i.h) - rect.y # <<<<<<<<<<<<<< * outshapes1.remove(i) * merged = True */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_y); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2907, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_y); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2993, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2907, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2993, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyNumber_Add(__pyx_t_11, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2907, __pyx_L1_error) + __pyx_t_3 = PyNumber_Add(__pyx_t_11, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2993, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2907, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2993, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2907, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_h); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2993, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2907, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2993, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2907, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2907, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2993, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2993, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (__pyx_t_1) { __Pyx_INCREF(__pyx_t_3); @@ -99291,23 +102319,23 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2907, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_rect, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2993, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2907, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2993, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_rect, __pyx_n_s_h, __pyx_t_4) < 0) __PYX_ERR(0, 2907, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_rect, __pyx_n_s_h, __pyx_t_4) < 0) __PYX_ERR(0, 2993, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2908 + /* "collisions.py":2994 * if rect.x == i.x and rect.w == i.w and (rect.y + rect.h >= i.y): * rect.h = max(rect.y + rect.h, i.y + i.h) - rect.y * outshapes1.remove(i) # <<<<<<<<<<<<<< * merged = True * break */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_outshapes1, __pyx_n_s_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2908, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_outshapes1, __pyx_n_s_remove); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2994, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_11 = NULL; __pyx_t_6 = 0; @@ -99327,13 +102355,13 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_i}; __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2908, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2994, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2909 + /* "collisions.py":2995 * rect.h = max(rect.y + rect.h, i.y + i.h) - rect.y * outshapes1.remove(i) * merged = True # <<<<<<<<<<<<<< @@ -99342,7 +102370,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS */ __pyx_v_merged = 1; - /* "collisions.py":2910 + /* "collisions.py":2996 * outshapes1.remove(i) * merged = True * break # <<<<<<<<<<<<<< @@ -99351,7 +102379,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS */ goto __pyx_L34_break; - /* "collisions.py":2906 + /* "collisions.py":2992 * rect = outshapes1.pop(0) * for i in outshapes1: * if rect.x == i.x and rect.w == i.w and (rect.y + rect.h >= i.y): # <<<<<<<<<<<<<< @@ -99360,7 +102388,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS */ } - /* "collisions.py":2905 + /* "collisions.py":2991 * while outshapes1: * rect = outshapes1.pop(0) * for i in outshapes1: # <<<<<<<<<<<<<< @@ -99375,17 +102403,17 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS goto __pyx_L39_for_end; __pyx_L39_for_end:; - /* "collisions.py":2911 + /* "collisions.py":2997 * merged = True * break * outshapes2.append(rect) # <<<<<<<<<<<<<< * * shapes = outshapes2 */ - __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_outshapes2, __pyx_v_rect); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 2911, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_outshapes2, __pyx_v_rect); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(0, 2997, __pyx_L1_error) } - /* "collisions.py":2913 + /* "collisions.py":2999 * outshapes2.append(rect) * * shapes = outshapes2 # <<<<<<<<<<<<<< @@ -99396,7 +102424,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS __Pyx_DECREF_SET(__pyx_v_shapes, __pyx_v_outshapes2); } - /* "collisions.py":2915 + /* "collisions.py":3001 * shapes = outshapes2 * * return Shapes(*shapes, *others) # <<<<<<<<<<<<<< @@ -99404,17 +102432,17 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS * @staticmethod */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2915, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2915, __pyx_L1_error) + __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PySequence_Tuple(__pyx_v_others); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2915, __pyx_L1_error) + __pyx_t_3 = PySequence_Tuple(__pyx_v_others); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2915, __pyx_L1_error) + __pyx_t_11 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2915, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3001, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; @@ -99422,7 +102450,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2863 + /* "collisions.py":2949 * )) * * @staticmethod # <<<<<<<<<<<<<< @@ -99455,7 +102483,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_2combineRects(CYTHON_UNUS return __pyx_r; } -/* "collisions.py":2917 +/* "collisions.py":3003 * return Shapes(*shapes, *others) * * @staticmethod # <<<<<<<<<<<<<< @@ -99491,7 +102519,7 @@ static PyObject *__pyx_pw_10collisions_13ShapeCombiner_5union(PyObject *__pyx_se return __pyx_r; } -/* "collisions.py":2927 +/* "collisions.py":3013 * if not shapes: * return Shapes() * def reformat(obj): # <<<<<<<<<<<<<< @@ -99552,12 +102580,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2927, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3013, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "reformat") < 0)) __PYX_ERR(0, 2927, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "reformat") < 0)) __PYX_ERR(0, 3013, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -99568,7 +102596,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("reformat", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2927, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("reformat", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3013, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -99595,9 +102623,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_10collisions_13ShapeCombiner_5union_reformat(PyObject *__pyx_self, PyObject *__pyx_v_obj) { - struct __pyx_obj_10collisions___pyx_scope_struct_34_union *__pyx_cur_scope; - struct __pyx_obj_10collisions___pyx_scope_struct_34_union *__pyx_outer_scope; +static PyObject *__pyx_pf_10collisions_13ShapeCombiner_5union_reformat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_obj) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -99613,21 +102639,19 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_5union_reformat(PyObject const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reformat", 1); - __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_34_union *) __Pyx_CyFunction_GetClosure(__pyx_self); - __pyx_cur_scope = __pyx_outer_scope; - /* "collisions.py":2928 + /* "collisions.py":3014 * return Shapes() * def reformat(obj): * if checkShpType(obj, ShpGroups.CLOSED): # <<<<<<<<<<<<<< * return obj - * elif checkShpType(s, ShpTyps.Line): + * elif checkShpType(obj, ShpTyps.Line): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2928, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3014, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2928, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3014, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CLOSED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2928, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CLOSED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3014, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -99649,19 +102673,19 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_5union_reformat(PyObject __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2928, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3014, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2928, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 3014, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2929 + /* "collisions.py":3015 * def reformat(obj): * if checkShpType(obj, ShpGroups.CLOSED): * return obj # <<<<<<<<<<<<<< - * elif checkShpType(s, ShpTyps.Line): + * elif checkShpType(obj, ShpTyps.Line): * return Polygon(obj.p1, obj.p2, obj.p2, obj.p1) */ __Pyx_XDECREF(__pyx_r); @@ -99669,28 +102693,27 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_5union_reformat(PyObject __pyx_r = __pyx_v_obj; goto __pyx_L0; - /* "collisions.py":2928 + /* "collisions.py":3014 * return Shapes() * def reformat(obj): * if checkShpType(obj, ShpGroups.CLOSED): # <<<<<<<<<<<<<< * return obj - * elif checkShpType(s, ShpTyps.Line): + * elif checkShpType(obj, ShpTyps.Line): */ } - /* "collisions.py":2930 + /* "collisions.py":3016 * if checkShpType(obj, ShpGroups.CLOSED): * return obj - * elif checkShpType(s, ShpTyps.Line): # <<<<<<<<<<<<<< + * elif checkShpType(obj, ShpTyps.Line): # <<<<<<<<<<<<<< * return Polygon(obj.p1, obj.p2, obj.p2, obj.p1) * # TODO: More */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2930, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_checkShpType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(!__pyx_cur_scope->__pyx_v_s)) { __Pyx_RaiseClosureNameError("s"); __PYX_ERR(0, 2930, __pyx_L1_error) } - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2930, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2930, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -99708,35 +102731,35 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_5union_reformat(PyObject } #endif { - PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_cur_scope->__pyx_v_s, __pyx_t_3}; + PyObject *__pyx_callargs[3] = {__pyx_t_4, __pyx_v_obj, __pyx_t_3}; __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2930, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3016, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 2930, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 3016, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_6) { - /* "collisions.py":2931 + /* "collisions.py":3017 * return obj - * elif checkShpType(s, ShpTyps.Line): + * elif checkShpType(obj, ShpTyps.Line): * return Polygon(obj.p1, obj.p2, obj.p2, obj.p1) # <<<<<<<<<<<<<< * # TODO: More * reform = [reformat(s) for s in shapes] */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2931, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3017, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2931, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_p1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3017, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2931, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3017, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_p2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2931, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_p2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3017, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_p1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2931, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_p1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3017, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_5 = 0; @@ -99760,7 +102783,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_5union_reformat(PyObject __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2931, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3017, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -99768,16 +102791,16 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_5union_reformat(PyObject __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":2930 + /* "collisions.py":3016 * if checkShpType(obj, ShpGroups.CLOSED): * return obj - * elif checkShpType(s, ShpTyps.Line): # <<<<<<<<<<<<<< + * elif checkShpType(obj, ShpTyps.Line): # <<<<<<<<<<<<<< * return Polygon(obj.p1, obj.p2, obj.p2, obj.p1) * # TODO: More */ } - /* "collisions.py":2927 + /* "collisions.py":3013 * if not shapes: * return Shapes() * def reformat(obj): # <<<<<<<<<<<<<< @@ -99805,7 +102828,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_5union_reformat(PyObject } static PyObject *__pyx_gb_10collisions_13ShapeCombiner_5union_9genexpr81_2generator17(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */ -/* "collisions.py":2949 +/* "collisions.py":3035 * checked = [] * # TODO: When objs are covered * ps = [any(k.collides(Point(*j)) for k in oshps if k != s) for j in s.toPoints()] # <<<<<<<<<<<<<< @@ -99814,29 +102837,29 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_5union_9genexpr81_2genera */ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_5union_9genexpr81_genexpr(PyObject *__pyx_self, PyObject *__pyx_genexpr_arg_0) { - struct __pyx_obj_10collisions___pyx_scope_struct_35_genexpr *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_36_genexpr *__pyx_cur_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations int __pyx_lineno = 0; const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("genexpr", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_35_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_35_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_35_genexpr, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_36_genexpr *)__pyx_tp_new_10collisions___pyx_scope_struct_36_genexpr(__pyx_ptype_10collisions___pyx_scope_struct_36_genexpr, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_35_genexpr *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_36_genexpr *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2949, __pyx_L1_error) + __PYX_ERR(0, 3035, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } - __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_34_union *) __pyx_self; + __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_35_union *) __pyx_self; __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_outer_scope); __pyx_cur_scope->__pyx_genexpr_arg_0 = __pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_cur_scope->__pyx_genexpr_arg_0); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_genexpr_arg_0); { - __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_13ShapeCombiner_5union_9genexpr81_2generator17, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ShapeCombiner_union_locals_genex, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 2949, __pyx_L1_error) + __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10collisions_13ShapeCombiner_5union_9genexpr81_2generator17, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_ShapeCombiner_union_locals_genex, __pyx_n_s_collisions); if (unlikely(!gen)) __PYX_ERR(0, 3035, __pyx_L1_error) __Pyx_DECREF(__pyx_cur_scope); __Pyx_RefNannyFinishContext(); return (PyObject *) gen; @@ -99854,7 +102877,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_5union_9genexpr81_genexpr static PyObject *__pyx_gb_10collisions_13ShapeCombiner_5union_9genexpr81_2generator17(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */ { - struct __pyx_obj_10collisions___pyx_scope_struct_35_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_35_genexpr *)__pyx_generator->closure); + struct __pyx_obj_10collisions___pyx_scope_struct_36_genexpr *__pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_36_genexpr *)__pyx_generator->closure); PyObject *__pyx_r = NULL; PyObject *__pyx_t_1 = NULL; Py_ssize_t __pyx_t_2; @@ -99877,41 +102900,41 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_5union_9genexpr81_2genera return NULL; } __pyx_L3_first_run:; - if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2949, __pyx_L1_error) - if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 2949, __pyx_L1_error) } + if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 3035, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_genexpr_arg_0)) { __Pyx_RaiseUnboundLocalError(".0"); __PYX_ERR(0, 3035, __pyx_L1_error) } __pyx_t_1 = __pyx_cur_scope->__pyx_genexpr_arg_0; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; for (;;) { { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2949, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3035, __pyx_L1_error) #endif if (__pyx_t_2 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 2949, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 3035, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2949, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3035, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_k); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_k, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_s)) { __Pyx_RaiseClosureNameError("s"); __PYX_ERR(0, 2949, __pyx_L1_error) } - __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_k, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_s, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2949, __pyx_L1_error) - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 2949, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_s)) { __Pyx_RaiseClosureNameError("s"); __PYX_ERR(0, 3035, __pyx_L1_error) } + __pyx_t_3 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_k, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_s, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3035, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 3035, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_k, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2949, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_k, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3035, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Point); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2949, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_Point); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3035, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_9genexpr81__pyx_v_j)) { __Pyx_RaiseClosureNameError("j"); __PYX_ERR(0, 2949, __pyx_L1_error) } - __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_outer_scope->__pyx_9genexpr81__pyx_v_j); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2949, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_9genexpr81__pyx_v_j)) { __Pyx_RaiseClosureNameError("j"); __PYX_ERR(0, 3035, __pyx_L1_error) } + __pyx_t_7 = __Pyx_PySequence_Tuple(__pyx_cur_scope->__pyx_outer_scope->__pyx_9genexpr81__pyx_v_j); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3035, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2949, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3035, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -99934,11 +102957,11 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_5union_9genexpr81_2genera __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2949, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3035, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 2949, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 3035, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_4) { __Pyx_XDECREF(__pyx_r); @@ -99980,7 +103003,7 @@ static PyObject *__pyx_gb_10collisions_13ShapeCombiner_5union_9genexpr81_2genera return __pyx_r; } -/* "collisions.py":2967 +/* "collisions.py":3053 * wheres.extend(zip(ws, [(other, k) for _ in range(len(ws))])) * if wheres != []: * wheres.sort(key=lambda x: (x[0][0]-p1[0])**2+(x[0][1]-p1[1])**2) # <<<<<<<<<<<<<< @@ -100041,12 +103064,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds (void)__Pyx_Arg_NewRef_FASTCALL(values[0]); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2967, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3053, __pyx_L3_error) else goto __pyx_L5_argtuple_error; } if (unlikely(kw_args > 0)) { const Py_ssize_t kwd_pos_args = __pyx_nargs; - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda41") < 0)) __PYX_ERR(0, 2967, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "lambda41") < 0)) __PYX_ERR(0, 3053, __pyx_L3_error) } } else if (unlikely(__pyx_nargs != 1)) { goto __pyx_L5_argtuple_error; @@ -100057,7 +103080,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("lambda41", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2967, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("lambda41", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3053, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -100085,8 +103108,8 @@ PyObject *__pyx_args, PyObject *__pyx_kwds } static PyObject *__pyx_lambda_funcdef_lambda41(PyObject *__pyx_self, PyObject *__pyx_v_x) { - struct __pyx_obj_10collisions___pyx_scope_struct_34_union *__pyx_cur_scope; - struct __pyx_obj_10collisions___pyx_scope_struct_34_union *__pyx_outer_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_35_union *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_35_union *__pyx_outer_scope; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -100097,40 +103120,40 @@ static PyObject *__pyx_lambda_funcdef_lambda41(PyObject *__pyx_self, PyObject *_ const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("lambda41", 1); - __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_34_union *) __Pyx_CyFunction_GetClosure(__pyx_self); + __pyx_outer_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_35_union *) __Pyx_CyFunction_GetClosure(__pyx_self); __pyx_cur_scope = __pyx_outer_scope; __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2967, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2967, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_v_p1)) { __Pyx_RaiseClosureNameError("p1"); __PYX_ERR(0, 2967, __pyx_L1_error) } - __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_p1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2967, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_p1)) { __Pyx_RaiseClosureNameError("p1"); __PYX_ERR(0, 3053, __pyx_L1_error) } + __pyx_t_1 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_p1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2967, __pyx_L1_error) + __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2967, __pyx_L1_error) + __pyx_t_1 = PyNumber_Power(__pyx_t_3, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2967, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_x, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2967, __pyx_L1_error) + __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_cur_scope->__pyx_v_p1)) { __Pyx_RaiseClosureNameError("p1"); __PYX_ERR(0, 2967, __pyx_L1_error) } - __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_p1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2967, __pyx_L1_error) + if (unlikely(!__pyx_cur_scope->__pyx_v_p1)) { __Pyx_RaiseClosureNameError("p1"); __PYX_ERR(0, 3053, __pyx_L1_error) } + __pyx_t_3 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_p1, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2967, __pyx_L1_error) + __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2967, __pyx_L1_error) + __pyx_t_3 = PyNumber_Power(__pyx_t_4, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2967, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -100152,7 +103175,7 @@ static PyObject *__pyx_lambda_funcdef_lambda41(PyObject *__pyx_self, PyObject *_ return __pyx_r; } -/* "collisions.py":2917 +/* "collisions.py":3003 * return Shapes(*shapes, *others) * * @staticmethod # <<<<<<<<<<<<<< @@ -100161,7 +103184,7 @@ static PyObject *__pyx_lambda_funcdef_lambda41(PyObject *__pyx_self, PyObject *_ */ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_shapes) { - struct __pyx_obj_10collisions___pyx_scope_struct_34_union *__pyx_cur_scope; + struct __pyx_obj_10collisions___pyx_scope_struct_35_union *__pyx_cur_scope; PyObject *__pyx_v_reformat = 0; PyObject *__pyx_v_reform = NULL; PyObject *__pyx_v_outshps = NULL; @@ -100216,28 +103239,28 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb const char *__pyx_filename = NULL; int __pyx_clineno = 0; __Pyx_RefNannySetupContext("union", 0); - __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_34_union *)__pyx_tp_new_10collisions___pyx_scope_struct_34_union(__pyx_ptype_10collisions___pyx_scope_struct_34_union, __pyx_empty_tuple, NULL); + __pyx_cur_scope = (struct __pyx_obj_10collisions___pyx_scope_struct_35_union *)__pyx_tp_new_10collisions___pyx_scope_struct_35_union(__pyx_ptype_10collisions___pyx_scope_struct_35_union, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_cur_scope)) { - __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_34_union *)Py_None); + __pyx_cur_scope = ((struct __pyx_obj_10collisions___pyx_scope_struct_35_union *)Py_None); __Pyx_INCREF(Py_None); - __PYX_ERR(0, 2917, __pyx_L1_error) + __PYX_ERR(0, 3003, __pyx_L1_error) } else { __Pyx_GOTREF((PyObject *)__pyx_cur_scope); } __Pyx_INCREF(__pyx_v_shapes); - /* "collisions.py":2925 + /* "collisions.py":3011 * Shapes: The union of all the shapes. * """ * if not shapes: # <<<<<<<<<<<<<< * return Shapes() * def reformat(obj): */ - __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_shapes); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2925, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_shapes); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 3011, __pyx_L1_error) __pyx_t_2 = (!__pyx_t_1); if (__pyx_t_2) { - /* "collisions.py":2926 + /* "collisions.py":3012 * """ * if not shapes: * return Shapes() # <<<<<<<<<<<<<< @@ -100245,7 +103268,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb * if checkShpType(obj, ShpGroups.CLOSED): */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2926, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3012, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -100265,7 +103288,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2926, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3012, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -100273,7 +103296,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":2925 + /* "collisions.py":3011 * Shapes: The union of all the shapes. * """ * if not shapes: # <<<<<<<<<<<<<< @@ -100282,19 +103305,19 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb */ } - /* "collisions.py":2927 + /* "collisions.py":3013 * if not shapes: * return Shapes() * def reformat(obj): # <<<<<<<<<<<<<< * if checkShpType(obj, ShpGroups.CLOSED): * return obj */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_13ShapeCombiner_5union_1reformat, 0, __pyx_n_s_ShapeCombiner_union_locals_refor, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2927, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_13ShapeCombiner_5union_1reformat, 0, __pyx_n_s_ShapeCombiner_union_locals_refor, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__39)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3013, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_reformat = __pyx_t_3; __pyx_t_3 = 0; - /* "collisions.py":2933 + /* "collisions.py":3019 * return Polygon(obj.p1, obj.p2, obj.p2, obj.p1) * # TODO: More * reform = [reformat(s) for s in shapes] # <<<<<<<<<<<<<< @@ -100302,16 +103325,16 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb * outshps = [] */ { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2933, __pyx_L6_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3019, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_3); if (likely(PyList_CheckExact(__pyx_v_shapes)) || PyTuple_CheckExact(__pyx_v_shapes)) { __pyx_t_4 = __pyx_v_shapes; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2933, __pyx_L6_error) + __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3019, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2933, __pyx_L6_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3019, __pyx_L6_error) } for (;;) { if (likely(!__pyx_t_8)) { @@ -100319,28 +103342,28 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2933, __pyx_L6_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3019, __pyx_L6_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2933, __pyx_L6_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 3019, __pyx_L6_error) #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2933, __pyx_L6_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3019, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2933, __pyx_L6_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3019, __pyx_L6_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2933, __pyx_L6_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 3019, __pyx_L6_error) #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2933, __pyx_L6_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3019, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -100350,7 +103373,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2933, __pyx_L6_error) + else __PYX_ERR(0, 3019, __pyx_L6_error) } break; } @@ -100358,9 +103381,9 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb } __Pyx_XDECREF_SET(__pyx_9genexpr77__pyx_v_s, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __pyx_pf_10collisions_13ShapeCombiner_5union_reformat(__pyx_v_reformat, __pyx_9genexpr77__pyx_v_s); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2933, __pyx_L6_error) + __pyx_t_5 = __pyx_pf_10collisions_13ShapeCombiner_5union_reformat(__pyx_v_reformat, __pyx_9genexpr77__pyx_v_s); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3019, __pyx_L6_error) __Pyx_GOTREF(__pyx_t_5); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 2933, __pyx_L6_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 3019, __pyx_L6_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -100374,7 +103397,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb __pyx_v_reform = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2934 + /* "collisions.py":3020 * # TODO: More * reform = [reformat(s) for s in shapes] * shapes = [reform[i] for i in range(len(reform)) if reform[i]] # <<<<<<<<<<<<<< @@ -100382,20 +103405,20 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb * while shapes: */ { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2934, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3020, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyList_GET_SIZE(__pyx_v_reform); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2934, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_GET_SIZE(__pyx_v_reform); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3020, __pyx_L1_error) __pyx_t_9 = __pyx_t_7; for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_9genexpr78__pyx_v_i = __pyx_t_10; - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_reform, __pyx_9genexpr78__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2934, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_reform, __pyx_9genexpr78__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3020, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2934, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 3020, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_reform, __pyx_9genexpr78__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2934, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_reform, __pyx_9genexpr78__pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3020, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 2934, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 3020, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } } @@ -100403,19 +103426,19 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb __Pyx_DECREF_SET(__pyx_v_shapes, __pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2935 + /* "collisions.py":3021 * reform = [reformat(s) for s in shapes] * shapes = [reform[i] for i in range(len(reform)) if reform[i]] * outshps = [] # <<<<<<<<<<<<<< * while shapes: * s = shapes.pop(0) */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2935, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3021, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_v_outshps = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2936 + /* "collisions.py":3022 * shapes = [reform[i] for i in range(len(reform)) if reform[i]] * outshps = [] * while shapes: # <<<<<<<<<<<<<< @@ -100423,24 +103446,24 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb * colls = [i.collides(s) for i in outshps] */ while (1) { - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_shapes); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2936, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_shapes); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 3022, __pyx_L1_error) if (!__pyx_t_2) break; - /* "collisions.py":2937 + /* "collisions.py":3023 * outshps = [] * while shapes: * s = shapes.pop(0) # <<<<<<<<<<<<<< * colls = [i.collides(s) for i in outshps] * if any(colls): */ - __pyx_t_3 = __Pyx_PyList_PopIndex(__pyx_v_shapes, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2937, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_PopIndex(__pyx_v_shapes, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3023, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_s); __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_s, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2938 + /* "collisions.py":3024 * while shapes: * s = shapes.pop(0) * colls = [i.collides(s) for i in outshps] # <<<<<<<<<<<<<< @@ -100448,7 +103471,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb * for i in range(len(colls)): */ { /* enter inner scope */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2938, __pyx_L18_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3024, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_v_outshps; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0; @@ -100456,19 +103479,19 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2938, __pyx_L18_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3024, __pyx_L18_error) #endif if (__pyx_t_7 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 2938, __pyx_L18_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 3024, __pyx_L18_error) #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2938, __pyx_L18_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3024, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_XDECREF_SET(__pyx_9genexpr79__pyx_v_i, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr79__pyx_v_i, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2938, __pyx_L18_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr79__pyx_v_i, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3024, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = NULL; __pyx_t_6 = 0; @@ -100488,11 +103511,11 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb PyObject *__pyx_callargs[2] = {__pyx_t_12, __pyx_cur_scope->__pyx_v_s}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2938, __pyx_L18_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3024, __pyx_L18_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 2938, __pyx_L18_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 3024, __pyx_L18_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -100506,77 +103529,77 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb __Pyx_XDECREF_SET(__pyx_v_colls, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "collisions.py":2939 + /* "collisions.py":3025 * s = shapes.pop(0) * colls = [i.collides(s) for i in outshps] * if any(colls): # <<<<<<<<<<<<<< * for i in range(len(colls)): * if colls[i]: */ - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_any, __pyx_v_colls); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2939, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_any, __pyx_v_colls); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3025, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2939, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 3025, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - /* "collisions.py":2940 + /* "collisions.py":3026 * colls = [i.collides(s) for i in outshps] * if any(colls): * for i in range(len(colls)): # <<<<<<<<<<<<<< * if colls[i]: * newpts = [] */ - __pyx_t_7 = __Pyx_PyList_GET_SIZE(__pyx_v_colls); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2940, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_GET_SIZE(__pyx_v_colls); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3026, __pyx_L1_error) __pyx_t_9 = __pyx_t_7; for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) { __pyx_v_i = __pyx_t_10; - /* "collisions.py":2941 + /* "collisions.py":3027 * if any(colls): * for i in range(len(colls)): * if colls[i]: # <<<<<<<<<<<<<< * newpts = [] * oshps = [s, outshps[i]] */ - __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_colls, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2941, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_colls, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2941, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 3027, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - /* "collisions.py":2942 + /* "collisions.py":3028 * for i in range(len(colls)): * if colls[i]: * newpts = [] # <<<<<<<<<<<<<< * oshps = [s, outshps[i]] * lns = [j.toLines() for j in oshps] */ - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2942, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3028, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_XDECREF_SET(__pyx_v_newpts, ((PyObject*)__pyx_t_3)); __pyx_t_3 = 0; - /* "collisions.py":2943 + /* "collisions.py":3029 * if colls[i]: * newpts = [] * oshps = [s, outshps[i]] # <<<<<<<<<<<<<< * lns = [j.toLines() for j in oshps] * direc = 1 */ - __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_outshps, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2943, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_outshps, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3029, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2943, __pyx_L1_error) + __pyx_t_4 = PyList_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3029, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_cur_scope->__pyx_v_s); __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_s); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_s)) __PYX_ERR(0, 2943, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_s)) __PYX_ERR(0, 3029, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 2943, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_4, 1, __pyx_t_3)) __PYX_ERR(0, 3029, __pyx_L1_error); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_oshps, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "collisions.py":2944 + /* "collisions.py":3030 * newpts = [] * oshps = [s, outshps[i]] * lns = [j.toLines() for j in oshps] # <<<<<<<<<<<<<< @@ -100584,7 +103607,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb * check = 0 */ { /* enter inner scope */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2944, __pyx_L29_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3030, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_3 = __pyx_v_oshps; __Pyx_INCREF(__pyx_t_3); __pyx_t_13 = 0; @@ -100592,19 +103615,19 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2944, __pyx_L29_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3030, __pyx_L29_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_5); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 2944, __pyx_L29_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_5); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 3030, __pyx_L29_error) #else - __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2944, __pyx_L29_error) + __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3030, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_5); #endif __Pyx_XDECREF_SET(__pyx_9genexpr80__pyx_v_j, __pyx_t_5); __pyx_t_5 = 0; - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr80__pyx_v_j, __pyx_n_s_toLines); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2944, __pyx_L29_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_9genexpr80__pyx_v_j, __pyx_n_s_toLines); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3030, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_12 = NULL; __pyx_t_6 = 0; @@ -100624,11 +103647,11 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL}; __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2944, __pyx_L29_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3030, __pyx_L29_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } - if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 2944, __pyx_L29_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 3030, __pyx_L29_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -100642,7 +103665,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb __Pyx_XDECREF_SET(__pyx_v_lns, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "collisions.py":2945 + /* "collisions.py":3031 * oshps = [s, outshps[i]] * lns = [j.toLines() for j in oshps] * direc = 1 # <<<<<<<<<<<<<< @@ -100652,7 +103675,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb __Pyx_INCREF(__pyx_int_1); __Pyx_XDECREF_SET(__pyx_v_direc, __pyx_int_1); - /* "collisions.py":2946 + /* "collisions.py":3032 * lns = [j.toLines() for j in oshps] * direc = 1 * check = 0 # <<<<<<<<<<<<<< @@ -100662,19 +103685,19 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb __Pyx_INCREF(__pyx_int_0); __Pyx_XDECREF_SET(__pyx_v_check, __pyx_int_0); - /* "collisions.py":2947 + /* "collisions.py":3033 * direc = 1 * check = 0 * checked = [] # <<<<<<<<<<<<<< * # TODO: When objs are covered * ps = [any(k.collides(Point(*j)) for k in oshps if k != s) for j in s.toPoints()] */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2947, __pyx_L1_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3033, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_checked, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "collisions.py":2949 + /* "collisions.py":3035 * checked = [] * # TODO: When objs are covered * ps = [any(k.collides(Point(*j)) for k in oshps if k != s) for j in s.toPoints()] # <<<<<<<<<<<<<< @@ -100682,9 +103705,9 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb * while True: */ { /* enter inner scope */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2949, __pyx_L1_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3035, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_s, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2949, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_s, __pyx_n_s_toPoints); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3035, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_11 = NULL; __pyx_t_6 = 0; @@ -100704,7 +103727,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2949, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3035, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -100713,9 +103736,9 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb __pyx_t_13 = 0; __pyx_t_8 = NULL; } else { - __pyx_t_13 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2949, __pyx_L1_error) + __pyx_t_13 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3035, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2949, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3035, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -100724,28 +103747,28 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb { Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2949, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3035, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 2949, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 3035, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2949, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3035, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_5); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2949, __pyx_L1_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3035, __pyx_L1_error) #endif if (__pyx_t_13 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 2949, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_13); __Pyx_INCREF(__pyx_t_3); __pyx_t_13++; if (unlikely((0 < 0))) __PYX_ERR(0, 3035, __pyx_L1_error) #else - __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2949, __pyx_L1_error) + __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_5, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3035, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -100755,7 +103778,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 2949, __pyx_L1_error) + else __PYX_ERR(0, 3035, __pyx_L1_error) } break; } @@ -100765,12 +103788,12 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_9genexpr81__pyx_v_j, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __pyx_pf_10collisions_13ShapeCombiner_5union_9genexpr81_genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_oshps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2949, __pyx_L1_error) + __pyx_t_3 = __pyx_pf_10collisions_13ShapeCombiner_5union_9genexpr81_genexpr(((PyObject*)__pyx_cur_scope), __pyx_v_oshps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3035, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2949, __pyx_L1_error) + __pyx_t_11 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3035, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 2949, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 3035, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -100778,19 +103801,19 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb __Pyx_XDECREF_SET(__pyx_v_ps, ((PyObject*)__pyx_t_4)); __pyx_t_4 = 0; - /* "collisions.py":2950 + /* "collisions.py":3036 * # TODO: When objs are covered * ps = [any(k.collides(Point(*j)) for k in oshps if k != s) for j in s.toPoints()] * j = ps.index(False) # <<<<<<<<<<<<<< * while True: * if (check, j) not in checked: */ - __pyx_t_4 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyList_Type_index, __pyx_v_ps, Py_False); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2950, __pyx_L1_error) + __pyx_t_4 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyList_Type_index, __pyx_v_ps, Py_False); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3036, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2951 + /* "collisions.py":3037 * ps = [any(k.collides(Point(*j)) for k in oshps if k != s) for j in s.toPoints()] * j = ps.index(False) * while True: # <<<<<<<<<<<<<< @@ -100799,73 +103822,73 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb */ while (1) { - /* "collisions.py":2952 + /* "collisions.py":3038 * j = ps.index(False) * while True: * if (check, j) not in checked: # <<<<<<<<<<<<<< * checked.append((check, j)) * ln = lns[check][j] */ - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2952, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3038, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_check); __Pyx_GIVEREF(__pyx_v_check); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_check)) __PYX_ERR(0, 2952, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_check)) __PYX_ERR(0, 3038, __pyx_L1_error); __Pyx_INCREF(__pyx_v_j); __Pyx_GIVEREF(__pyx_v_j); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_j)) __PYX_ERR(0, 2952, __pyx_L1_error); - __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_v_checked, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2952, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_j)) __PYX_ERR(0, 3038, __pyx_L1_error); + __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_4, __pyx_v_checked, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 3038, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { - /* "collisions.py":2953 + /* "collisions.py":3039 * while True: * if (check, j) not in checked: * checked.append((check, j)) # <<<<<<<<<<<<<< * ln = lns[check][j] * p1 = ln.p1 if direc == 1 else ln.p2 */ - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2953, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3039, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_INCREF(__pyx_v_check); __Pyx_GIVEREF(__pyx_v_check); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_check)) __PYX_ERR(0, 2953, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_check)) __PYX_ERR(0, 3039, __pyx_L1_error); __Pyx_INCREF(__pyx_v_j); __Pyx_GIVEREF(__pyx_v_j); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_j)) __PYX_ERR(0, 2953, __pyx_L1_error); - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_checked, __pyx_t_4); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 2953, __pyx_L1_error) + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_j)) __PYX_ERR(0, 3039, __pyx_L1_error); + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_checked, __pyx_t_4); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 3039, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2954 + /* "collisions.py":3040 * if (check, j) not in checked: * checked.append((check, j)) * ln = lns[check][j] # <<<<<<<<<<<<<< * p1 = ln.p1 if direc == 1 else ln.p2 * p2 = ln.p2 if direc == 1 else ln.p1 */ - __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_lns, __pyx_v_check); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2954, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_lns, __pyx_v_check); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3040, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2954, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3040, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_XDECREF_SET(__pyx_v_ln, __pyx_t_5); __pyx_t_5 = 0; - /* "collisions.py":2955 + /* "collisions.py":3041 * checked.append((check, j)) * ln = lns[check][j] * p1 = ln.p1 if direc == 1 else ln.p2 # <<<<<<<<<<<<<< * p2 = ln.p2 if direc == 1 else ln.p1 * newpts.append(p1) */ - __pyx_t_2 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_direc, __pyx_int_1, 1, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2955, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_direc, __pyx_int_1, 1, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 3041, __pyx_L1_error) if (__pyx_t_2) { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2955, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_t_4; __pyx_t_4 = 0; } else { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2955, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3041, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_t_4; __pyx_t_4 = 0; @@ -100875,21 +103898,21 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb __Pyx_GIVEREF(__pyx_t_5); __pyx_t_5 = 0; - /* "collisions.py":2956 + /* "collisions.py":3042 * ln = lns[check][j] * p1 = ln.p1 if direc == 1 else ln.p2 * p2 = ln.p2 if direc == 1 else ln.p1 # <<<<<<<<<<<<<< * newpts.append(p1) * wheres = [] */ - __pyx_t_2 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_direc, __pyx_int_1, 1, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2956, __pyx_L1_error) + __pyx_t_2 = (__Pyx_PyInt_BoolEqObjC(__pyx_v_direc, __pyx_int_1, 1, 0)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 3042, __pyx_L1_error) if (__pyx_t_2) { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2956, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_p2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3042, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_t_4; __pyx_t_4 = 0; } else { - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2956, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_p1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3042, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = __pyx_t_4; __pyx_t_4 = 0; @@ -100897,7 +103920,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb __Pyx_XDECREF_SET(__pyx_v_p2, __pyx_t_5); __pyx_t_5 = 0; - /* "collisions.py":2957 + /* "collisions.py":3043 * p1 = ln.p1 if direc == 1 else ln.p2 * p2 = ln.p2 if direc == 1 else ln.p1 * newpts.append(p1) # <<<<<<<<<<<<<< @@ -100906,58 +103929,58 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb */ __pyx_t_5 = __pyx_cur_scope->__pyx_v_p1; __Pyx_INCREF(__pyx_t_5); - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_newpts, __pyx_t_5); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 2957, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_newpts, __pyx_t_5); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 3043, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "collisions.py":2958 + /* "collisions.py":3044 * p2 = ln.p2 if direc == 1 else ln.p1 * newpts.append(p1) * wheres = [] # <<<<<<<<<<<<<< * for other in range(len(oshps)): * if other != check: */ - __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2958, __pyx_L1_error) + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_XDECREF_SET(__pyx_v_wheres, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; - /* "collisions.py":2959 + /* "collisions.py":3045 * newpts.append(p1) * wheres = [] * for other in range(len(oshps)): # <<<<<<<<<<<<<< * if other != check: * if ln.collides(oshps[other]): */ - __pyx_t_13 = __Pyx_PyList_GET_SIZE(__pyx_v_oshps); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2959, __pyx_L1_error) + __pyx_t_13 = __Pyx_PyList_GET_SIZE(__pyx_v_oshps); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3045, __pyx_L1_error) __pyx_t_15 = __pyx_t_13; for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) { __pyx_v_other = __pyx_t_16; - /* "collisions.py":2960 + /* "collisions.py":3046 * wheres = [] * for other in range(len(oshps)): * if other != check: # <<<<<<<<<<<<<< * if ln.collides(oshps[other]): * for k in range(len(lns[other])): */ - __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_other); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2960, __pyx_L1_error) + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_other); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3046, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_v_check, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2960, __pyx_L1_error) + __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_v_check, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3046, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2960, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 3046, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { - /* "collisions.py":2961 + /* "collisions.py":3047 * for other in range(len(oshps)): * if other != check: * if ln.collides(oshps[other]): # <<<<<<<<<<<<<< * for k in range(len(lns[other])): * if ln.collides(lns[other][k]): */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2961, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3047, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = __Pyx_GetItemInt_List(__pyx_v_oshps, __pyx_v_other, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2961, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt_List(__pyx_v_oshps, __pyx_v_other, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3047, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_3 = NULL; __pyx_t_6 = 0; @@ -100978,41 +104001,41 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2961, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3047, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2961, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 3047, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { - /* "collisions.py":2962 + /* "collisions.py":3048 * if other != check: * if ln.collides(oshps[other]): * for k in range(len(lns[other])): # <<<<<<<<<<<<<< * if ln.collides(lns[other][k]): * ws = ln.whereCollides(lns[other][k]) */ - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_lns, __pyx_v_other, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2962, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_lns, __pyx_v_other, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3048, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_17 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_17 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2962, __pyx_L1_error) + __pyx_t_17 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_17 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3048, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_18 = __pyx_t_17; for (__pyx_t_19 = 0; __pyx_t_19 < __pyx_t_18; __pyx_t_19+=1) { __pyx_v_k = __pyx_t_19; - /* "collisions.py":2963 + /* "collisions.py":3049 * if ln.collides(oshps[other]): * for k in range(len(lns[other])): * if ln.collides(lns[other][k]): # <<<<<<<<<<<<<< * ws = ln.whereCollides(lns[other][k]) * wheres.extend(zip(ws, [(other, k) for _ in range(len(ws))])) */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2963, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = __Pyx_GetItemInt_List(__pyx_v_lns, __pyx_v_other, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2963, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt_List(__pyx_v_lns, __pyx_v_other, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_11, __pyx_v_k, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2963, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_11, __pyx_v_k, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; @@ -101034,26 +104057,26 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2963, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3049, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2963, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 3049, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { - /* "collisions.py":2964 + /* "collisions.py":3050 * for k in range(len(lns[other])): * if ln.collides(lns[other][k]): * ws = ln.whereCollides(lns[other][k]) # <<<<<<<<<<<<<< * wheres.extend(zip(ws, [(other, k) for _ in range(len(ws))])) * if wheres != []: */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2964, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_ln, __pyx_n_s_whereCollides); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3050, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_lns, __pyx_v_other, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2964, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_lns, __pyx_v_other, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3050, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_k, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2964, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_3, __pyx_v_k, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3050, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -101075,14 +104098,14 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2964, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3050, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } __Pyx_XDECREF_SET(__pyx_v_ws, __pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2965 + /* "collisions.py":3051 * if ln.collides(lns[other][k]): * ws = ln.whereCollides(lns[other][k]) * wheres.extend(zip(ws, [(other, k) for _ in range(len(ws))])) # <<<<<<<<<<<<<< @@ -101090,43 +104113,43 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb * wheres.sort(key=lambda x: (x[0][0]-p1[0])**2+(x[0][1]-p1[1])**2) */ { /* enter inner scope */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2965, __pyx_L1_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_20 = PyObject_Length(__pyx_v_ws); if (unlikely(__pyx_t_20 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2965, __pyx_L1_error) + __pyx_t_20 = PyObject_Length(__pyx_v_ws); if (unlikely(__pyx_t_20 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3051, __pyx_L1_error) __pyx_t_21 = __pyx_t_20; for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) { __pyx_9genexpr83__pyx_v__ = __pyx_t_22; - __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_other); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2965, __pyx_L1_error) + __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_other); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2965, __pyx_L1_error) + __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2965, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_5); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5)) __PYX_ERR(0, 2965, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5)) __PYX_ERR(0, 3051, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_11); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11)) __PYX_ERR(0, 2965, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_11)) __PYX_ERR(0, 3051, __pyx_L1_error); __pyx_t_5 = 0; __pyx_t_11 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 2965, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 3051, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } } /* exit inner scope */ - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2965, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_ws); __Pyx_GIVEREF(__pyx_v_ws); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_ws)) __PYX_ERR(0, 2965, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_ws)) __PYX_ERR(0, 3051, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4)) __PYX_ERR(0, 2965, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4)) __PYX_ERR(0, 3051, __pyx_L1_error); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2965, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3051, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_14 = __Pyx_PyList_Extend(__pyx_v_wheres, __pyx_t_4); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 2965, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Extend(__pyx_v_wheres, __pyx_t_4); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 3051, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2963 + /* "collisions.py":3049 * if ln.collides(oshps[other]): * for k in range(len(lns[other])): * if ln.collides(lns[other][k]): # <<<<<<<<<<<<<< @@ -101136,7 +104159,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb } } - /* "collisions.py":2961 + /* "collisions.py":3047 * for other in range(len(oshps)): * if other != check: * if ln.collides(oshps[other]): # <<<<<<<<<<<<<< @@ -101145,7 +104168,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb */ } - /* "collisions.py":2960 + /* "collisions.py":3046 * wheres = [] * for other in range(len(oshps)): * if other != check: # <<<<<<<<<<<<<< @@ -101155,101 +104178,101 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb } } - /* "collisions.py":2966 + /* "collisions.py":3052 * ws = ln.whereCollides(lns[other][k]) * wheres.extend(zip(ws, [(other, k) for _ in range(len(ws))])) * if wheres != []: # <<<<<<<<<<<<<< * wheres.sort(key=lambda x: (x[0][0]-p1[0])**2+(x[0][1]-p1[1])**2) * newpts.append(wheres[0][0]) */ - __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2966, __pyx_L1_error) + __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3052, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_wheres, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2966, __pyx_L1_error) + __pyx_t_3 = PyObject_RichCompare(__pyx_v_wheres, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3052, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2966, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 3052, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_2) { - /* "collisions.py":2967 + /* "collisions.py":3053 * wheres.extend(zip(ws, [(other, k) for _ in range(len(ws))])) * if wheres != []: * wheres.sort(key=lambda x: (x[0][0]-p1[0])**2+(x[0][1]-p1[1])**2) # <<<<<<<<<<<<<< * newpts.append(wheres[0][0]) * # Correct direction handling */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_wheres, __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2967, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_wheres, __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2967, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_13ShapeCombiner_5union_2lambda41, 0, __pyx_n_s_ShapeCombiner_union_locals_lambd, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2967, __pyx_L1_error) + __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_13ShapeCombiner_5union_2lambda41, 0, __pyx_n_s_ShapeCombiner_union_locals_lambd, ((PyObject*)__pyx_cur_scope), __pyx_n_s_collisions, __pyx_d, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_key, __pyx_t_11) < 0) __PYX_ERR(0, 2967, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_key, __pyx_t_11) < 0) __PYX_ERR(0, 3053, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2967, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3053, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2968 + /* "collisions.py":3054 * if wheres != []: * wheres.sort(key=lambda x: (x[0][0]-p1[0])**2+(x[0][1]-p1[1])**2) * newpts.append(wheres[0][0]) # <<<<<<<<<<<<<< * # Correct direction handling * if oshps[check].collides(Point(*lns[wheres[0][1][0]][wheres[0][1][1]].p2)): */ - __pyx_t_11 = __Pyx_GetItemInt_List(__pyx_v_wheres, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2968, __pyx_L1_error) + __pyx_t_11 = __Pyx_GetItemInt_List(__pyx_v_wheres, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_11, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2968, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_11, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3054, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_newpts, __pyx_t_4); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 2968, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_newpts, __pyx_t_4); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 3054, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2970 + /* "collisions.py":3056 * newpts.append(wheres[0][0]) * # Correct direction handling * if oshps[check].collides(Point(*lns[wheres[0][1][0]][wheres[0][1][1]].p2)): # <<<<<<<<<<<<<< * direc = -1 * else: */ - __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_v_oshps, __pyx_v_check); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2970, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_v_oshps, __pyx_v_check); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2970, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_collides_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_Point); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2970, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_Point); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_wheres, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2970, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_wheres, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2970, __pyx_L1_error) + __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_12, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2970, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_12, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_v_lns, __pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2970, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetItem(__pyx_v_lns, __pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 3056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_wheres, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2970, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_wheres, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_23 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2970, __pyx_L1_error) + __pyx_t_23 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 3056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_23, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2970, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_23, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; - __pyx_t_23 = __Pyx_PyObject_GetItem(__pyx_t_12, __pyx_t_5); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2970, __pyx_L1_error) + __pyx_t_23 = __Pyx_PyObject_GetItem(__pyx_t_12, __pyx_t_5); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 3056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_23, __pyx_n_s_p2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2970, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_23, __pyx_n_s_p2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; - __pyx_t_23 = __Pyx_PySequence_Tuple(__pyx_t_5); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 2970, __pyx_L1_error) + __pyx_t_23 = __Pyx_PySequence_Tuple(__pyx_t_5); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 3056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_23); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_23, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2970, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_23, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0; @@ -101272,15 +104295,15 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6); __Pyx_XDECREF(__pyx_t_23); __pyx_t_23 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2970, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 2970, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 3056, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; if (__pyx_t_2) { - /* "collisions.py":2971 + /* "collisions.py":3057 * # Correct direction handling * if oshps[check].collides(Point(*lns[wheres[0][1][0]][wheres[0][1][1]].p2)): * direc = -1 # <<<<<<<<<<<<<< @@ -101290,7 +104313,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb __Pyx_INCREF(__pyx_int_neg_1); __Pyx_DECREF_SET(__pyx_v_direc, __pyx_int_neg_1); - /* "collisions.py":2970 + /* "collisions.py":3056 * newpts.append(wheres[0][0]) * # Correct direction handling * if oshps[check].collides(Point(*lns[wheres[0][1][0]][wheres[0][1][1]].p2)): # <<<<<<<<<<<<<< @@ -101300,7 +104323,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb goto __pyx_L50; } - /* "collisions.py":2973 + /* "collisions.py":3059 * direc = -1 * else: * direc = 1 # <<<<<<<<<<<<<< @@ -101313,43 +104336,43 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb } __pyx_L50:; - /* "collisions.py":2974 + /* "collisions.py":3060 * else: * direc = 1 * check = wheres[0][1][0] # <<<<<<<<<<<<<< * j = wheres[0][1][1] * else: */ - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_wheres, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2974, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_wheres, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3060, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2974, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3060, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2974, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3060, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_check, __pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2975 + /* "collisions.py":3061 * direc = 1 * check = wheres[0][1][0] * j = wheres[0][1][1] # <<<<<<<<<<<<<< * else: * newpts.append(p2) */ - __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_wheres, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2975, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_wheres, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2975, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_4, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2975, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3061, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_j, __pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2966 + /* "collisions.py":3052 * ws = ln.whereCollides(lns[other][k]) * wheres.extend(zip(ws, [(other, k) for _ in range(len(ws))])) * if wheres != []: # <<<<<<<<<<<<<< @@ -101359,7 +104382,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb goto __pyx_L49; } - /* "collisions.py":2977 + /* "collisions.py":3063 * j = wheres[0][1][1] * else: * newpts.append(p2) # <<<<<<<<<<<<<< @@ -101367,11 +104390,11 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb * break */ /*else*/ { - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_newpts, __pyx_v_p2); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 2977, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_newpts, __pyx_v_p2); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 3063, __pyx_L1_error) } __pyx_L49:; - /* "collisions.py":2952 + /* "collisions.py":3038 * j = ps.index(False) * while True: * if (check, j) not in checked: # <<<<<<<<<<<<<< @@ -101381,7 +104404,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb goto __pyx_L39; } - /* "collisions.py":2979 + /* "collisions.py":3065 * newpts.append(p2) * else: * break # <<<<<<<<<<<<<< @@ -101393,22 +104416,22 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb } __pyx_L39:; - /* "collisions.py":2980 + /* "collisions.py":3066 * else: * break * j = (j + direc) % len(lns[check]) # <<<<<<<<<<<<<< * outshps[i] = Polygon(*newpts) * else: */ - __pyx_t_4 = PyNumber_Add(__pyx_v_j, __pyx_v_direc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2980, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_v_j, __pyx_v_direc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_lns, __pyx_v_check); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2980, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_lns, __pyx_v_check); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_13 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 2980, __pyx_L1_error) + __pyx_t_13 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_13 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3066, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2980, __pyx_L1_error) + __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_13); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyNumber_Remainder(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2980, __pyx_L1_error) + __pyx_t_5 = PyNumber_Remainder(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3066, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -101417,25 +104440,25 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb } __pyx_L38_break:; - /* "collisions.py":2981 + /* "collisions.py":3067 * break * j = (j + direc) % len(lns[check]) * outshps[i] = Polygon(*newpts) # <<<<<<<<<<<<<< * else: * outshps.append(s) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2981, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PySequence_Tuple(__pyx_v_newpts); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2981, __pyx_L1_error) + __pyx_t_3 = PySequence_Tuple(__pyx_v_newpts); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2981, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3067, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely((__Pyx_SetItemInt(__pyx_v_outshps, __pyx_v_i, __pyx_t_4, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0))) __PYX_ERR(0, 2981, __pyx_L1_error) + if (unlikely((__Pyx_SetItemInt(__pyx_v_outshps, __pyx_v_i, __pyx_t_4, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0))) __PYX_ERR(0, 3067, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "collisions.py":2941 + /* "collisions.py":3027 * if any(colls): * for i in range(len(colls)): * if colls[i]: # <<<<<<<<<<<<<< @@ -101445,7 +104468,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb } } - /* "collisions.py":2939 + /* "collisions.py":3025 * s = shapes.pop(0) * colls = [i.collides(s) for i in outshps] * if any(colls): # <<<<<<<<<<<<<< @@ -101455,7 +104478,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb goto __pyx_L23; } - /* "collisions.py":2983 + /* "collisions.py":3069 * outshps[i] = Polygon(*newpts) * else: * outshps.append(s) # <<<<<<<<<<<<<< @@ -101465,13 +104488,13 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb /*else*/ { __pyx_t_4 = __pyx_cur_scope->__pyx_v_s; __Pyx_INCREF(__pyx_t_4); - __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_outshps, __pyx_t_4); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 2983, __pyx_L1_error) + __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_outshps, __pyx_t_4); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 3069, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } __pyx_L23:; } - /* "collisions.py":2984 + /* "collisions.py":3070 * else: * outshps.append(s) * return Shapes(*outshps) # <<<<<<<<<<<<<< @@ -101479,11 +104502,11 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb * @staticmethod */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2984, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3070, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PySequence_Tuple(__pyx_v_outshps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2984, __pyx_L1_error) + __pyx_t_3 = PySequence_Tuple(__pyx_v_outshps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3070, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2984, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3070, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -101491,7 +104514,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb __pyx_t_5 = 0; goto __pyx_L0; - /* "collisions.py":2917 + /* "collisions.py":3003 * return Shapes(*shapes, *others) * * @staticmethod # <<<<<<<<<<<<<< @@ -101537,7 +104560,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb return __pyx_r; } -/* "collisions.py":2986 +/* "collisions.py":3072 * return Shapes(*outshps) * * @staticmethod # <<<<<<<<<<<<<< @@ -101545,7 +104568,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_4union(CYTHON_UNUSED PyOb * """ */ -static PyObject *__pyx_pf_10collisions_66__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { +static PyObject *__pyx_pf_10collisions_68__defaults__(CYTHON_UNUSED PyObject *__pyx_self) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -101555,19 +104578,19 @@ static PyObject *__pyx_pf_10collisions_66__defaults__(CYTHON_UNUSED PyObject *__ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__defaults__", 1); __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2986, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3072, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults24, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2986, __pyx_L1_error) + __pyx_t_2 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(__pyx_defaults25, __pyx_self)->__pyx_arg_bounciness); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3072, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_bounciness, __pyx_t_2) < 0) __PYX_ERR(0, 2986, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_bounciness, __pyx_t_2) < 0) __PYX_ERR(0, 3072, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2986, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3072, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(Py_None); __Pyx_GIVEREF(Py_None); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 2986, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, Py_None)) __PYX_ERR(0, 3072, __pyx_L1_error); __Pyx_GIVEREF(__pyx_t_1); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 2986, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1)) __PYX_ERR(0, 3072, __pyx_L1_error); __pyx_t_1 = 0; __pyx_r = __pyx_t_2; __pyx_t_2 = 0; @@ -101611,7 +104634,7 @@ static PyObject *__pyx_pw_10collisions_13ShapeCombiner_7pointsToShape(PyObject * __pyx_v_points = __pyx_args; { PyObject **__pyx_pyargnames[] = {&__pyx_n_s_bounciness,0}; - __pyx_defaults24 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults24, __pyx_self); + __pyx_defaults25 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults25, __pyx_self); if (__pyx_kwds) { Py_ssize_t kw_args; switch (__pyx_nargs) { @@ -101623,24 +104646,24 @@ static PyObject *__pyx_pw_10collisions_13ShapeCombiner_7pointsToShape(PyObject * const Py_ssize_t index = 0; PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2986, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3072, __pyx_L3_error) } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, 0, "pointsToShape") < 0)) __PYX_ERR(0, 2986, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, 0, "pointsToShape") < 0)) __PYX_ERR(0, 3072, __pyx_L3_error) } } else if (unlikely(__pyx_nargs < 0)) { goto __pyx_L5_argtuple_error; } else { } if (values[0]) { - __pyx_v_bounciness = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_bounciness == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2987, __pyx_L3_error) + __pyx_v_bounciness = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_bounciness == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3073, __pyx_L3_error) } else { __pyx_v_bounciness = __pyx_dynamic_args->__pyx_arg_bounciness; } } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("pointsToShape", 0, 0, 0, __pyx_nargs); __PYX_ERR(0, 2986, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pointsToShape", 0, 0, 0, __pyx_nargs); __PYX_ERR(0, 3072, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -101692,18 +104715,18 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(CYTHON_UNU int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pointsToShape", 1); - /* "collisions.py":3007 + /* "collisions.py":3093 * Shape: The shape object made from the points * """ * if len(points) == 0: # <<<<<<<<<<<<<< * return NoShape() * elif len(points) == 1: */ - __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_points); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3007, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_points); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3093, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == 0); if (__pyx_t_2) { - /* "collisions.py":3008 + /* "collisions.py":3094 * """ * if len(points) == 0: * return NoShape() # <<<<<<<<<<<<<< @@ -101711,7 +104734,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(CYTHON_UNU * return Point(*points[0], bounciness) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NoShape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3008, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_NoShape); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3094, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_t_5 = NULL; __pyx_t_6 = 0; @@ -101731,7 +104754,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(CYTHON_UNU PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL}; __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3008, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3094, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } @@ -101739,7 +104762,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(CYTHON_UNU __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":3007 + /* "collisions.py":3093 * Shape: The shape object made from the points * """ * if len(points) == 0: # <<<<<<<<<<<<<< @@ -101748,18 +104771,18 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(CYTHON_UNU */ } - /* "collisions.py":3009 + /* "collisions.py":3095 * if len(points) == 0: * return NoShape() * elif len(points) == 1: # <<<<<<<<<<<<<< * return Point(*points[0], bounciness) * if len(points) == 2: */ - __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_points); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3009, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_points); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3095, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == 1); if (__pyx_t_2) { - /* "collisions.py":3010 + /* "collisions.py":3096 * return NoShape() * elif len(points) == 1: * return Point(*points[0], bounciness) # <<<<<<<<<<<<<< @@ -101767,25 +104790,25 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(CYTHON_UNU * return Line(*points, bounciness) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3010, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_points, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3010, __pyx_L1_error) + __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_points, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3010, __pyx_L1_error) + __pyx_t_5 = __Pyx_PySequence_Tuple(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3010, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3010, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4)) __PYX_ERR(0, 3010, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4)) __PYX_ERR(0, 3096, __pyx_L1_error); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3010, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3010, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3096, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -101793,7 +104816,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(CYTHON_UNU __pyx_t_7 = 0; goto __pyx_L0; - /* "collisions.py":3009 + /* "collisions.py":3095 * if len(points) == 0: * return NoShape() * elif len(points) == 1: # <<<<<<<<<<<<<< @@ -101802,18 +104825,18 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(CYTHON_UNU */ } - /* "collisions.py":3011 + /* "collisions.py":3097 * elif len(points) == 1: * return Point(*points[0], bounciness) * if len(points) == 2: # <<<<<<<<<<<<<< * return Line(*points, bounciness) * */ - __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_points); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3011, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_points); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3097, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == 2); if (__pyx_t_2) { - /* "collisions.py":3012 + /* "collisions.py":3098 * return Point(*points[0], bounciness) * if len(points) == 2: * return Line(*points, bounciness) # <<<<<<<<<<<<<< @@ -101821,19 +104844,19 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(CYTHON_UNU * if len(points) == 4: */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Line); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3012, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Line); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_4 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3012, __pyx_L1_error) + __pyx_t_4 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3012, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_4); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 3012, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4)) __PYX_ERR(0, 3098, __pyx_L1_error); __pyx_t_4 = 0; - __pyx_t_4 = PyNumber_Add(__pyx_v_points, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3012, __pyx_L1_error) + __pyx_t_4 = PyNumber_Add(__pyx_v_points, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3012, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3098, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -101841,7 +104864,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(CYTHON_UNU __pyx_t_3 = 0; goto __pyx_L0; - /* "collisions.py":3011 + /* "collisions.py":3097 * elif len(points) == 1: * return Point(*points[0], bounciness) * if len(points) == 2: # <<<<<<<<<<<<<< @@ -101850,18 +104873,18 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(CYTHON_UNU */ } - /* "collisions.py":3014 + /* "collisions.py":3100 * return Line(*points, bounciness) * * if len(points) == 4: # <<<<<<<<<<<<<< * x_vals = {p[0] for p in points} * y_vals = {p[1] for p in points} */ - __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_points); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3014, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyTuple_GET_SIZE(__pyx_v_points); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3100, __pyx_L1_error) __pyx_t_2 = (__pyx_t_1 == 4); if (__pyx_t_2) { - /* "collisions.py":3015 + /* "collisions.py":3101 * * if len(points) == 4: * x_vals = {p[0] for p in points} # <<<<<<<<<<<<<< @@ -101869,7 +104892,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(CYTHON_UNU * */ { /* enter inner scope */ - __pyx_t_3 = PySet_New(NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3015, __pyx_L8_error) + __pyx_t_3 = PySet_New(NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3101, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_v_points; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = 0; @@ -101877,21 +104900,21 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(CYTHON_UNU { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3015, __pyx_L8_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3101, __pyx_L8_error) #endif if (__pyx_t_1 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 3015, __pyx_L8_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 3101, __pyx_L8_error) #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3015, __pyx_L8_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3101, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_XDECREF_SET(__pyx_9genexpr84__pyx_v_p, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_GetItemInt(__pyx_9genexpr84__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3015, __pyx_L8_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_9genexpr84__pyx_v_p, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3101, __pyx_L8_error) __Pyx_GOTREF(__pyx_t_7); - if (unlikely(PySet_Add(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 3015, __pyx_L8_error) + if (unlikely(PySet_Add(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 3101, __pyx_L8_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -101905,7 +104928,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(CYTHON_UNU __pyx_v_x_vals = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":3016 + /* "collisions.py":3102 * if len(points) == 4: * x_vals = {p[0] for p in points} * y_vals = {p[1] for p in points} # <<<<<<<<<<<<<< @@ -101913,7 +104936,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(CYTHON_UNU * # To form a rectangle, we should have exactly two unique x-values and two unique y-values */ { /* enter inner scope */ - __pyx_t_3 = PySet_New(NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3016, __pyx_L15_error) + __pyx_t_3 = PySet_New(NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3102, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = __pyx_v_points; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = 0; @@ -101921,21 +104944,21 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(CYTHON_UNU { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3016, __pyx_L15_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3102, __pyx_L15_error) #endif if (__pyx_t_1 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 3016, __pyx_L15_error) + __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_7); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 3102, __pyx_L15_error) #else - __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3016, __pyx_L15_error) + __pyx_t_7 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3102, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_7); #endif __Pyx_XDECREF_SET(__pyx_9genexpr85__pyx_v_p, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_GetItemInt(__pyx_9genexpr85__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3016, __pyx_L15_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_9genexpr85__pyx_v_p, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3102, __pyx_L15_error) __Pyx_GOTREF(__pyx_t_7); - if (unlikely(PySet_Add(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 3016, __pyx_L15_error) + if (unlikely(PySet_Add(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 3102, __pyx_L15_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -101949,43 +104972,43 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(CYTHON_UNU __pyx_v_y_vals = ((PyObject*)__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":3019 + /* "collisions.py":3105 * * # To form a rectangle, we should have exactly two unique x-values and two unique y-values * if len(x_vals) == 2 and len(y_vals) == 2: # <<<<<<<<<<<<<< * x_min, y_min = min(x_vals), min(y_vals) * return Rect(x_min, y_min, max(x_vals)-x_min, max(y_vals)-y_min) */ - __pyx_t_1 = __Pyx_PySet_GET_SIZE(__pyx_v_x_vals); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3019, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySet_GET_SIZE(__pyx_v_x_vals); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3105, __pyx_L1_error) __pyx_t_8 = (__pyx_t_1 == 2); if (__pyx_t_8) { } else { __pyx_t_2 = __pyx_t_8; goto __pyx_L21_bool_binop_done; } - __pyx_t_1 = __Pyx_PySet_GET_SIZE(__pyx_v_y_vals); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3019, __pyx_L1_error) + __pyx_t_1 = __Pyx_PySet_GET_SIZE(__pyx_v_y_vals); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 3105, __pyx_L1_error) __pyx_t_8 = (__pyx_t_1 == 2); __pyx_t_2 = __pyx_t_8; __pyx_L21_bool_binop_done:; if (__pyx_t_2) { - /* "collisions.py":3020 + /* "collisions.py":3106 * # To form a rectangle, we should have exactly two unique x-values and two unique y-values * if len(x_vals) == 2 and len(y_vals) == 2: * x_min, y_min = min(x_vals), min(y_vals) # <<<<<<<<<<<<<< * return Rect(x_min, y_min, max(x_vals)-x_min, max(y_vals)-y_min) * */ - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_v_x_vals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3020, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_v_x_vals); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_v_y_vals); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3020, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_min, __pyx_v_y_vals); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3106, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __pyx_v_x_min = __pyx_t_3; __pyx_t_3 = 0; __pyx_v_y_min = __pyx_t_4; __pyx_t_4 = 0; - /* "collisions.py":3021 + /* "collisions.py":3107 * if len(x_vals) == 2 and len(y_vals) == 2: * x_min, y_min = min(x_vals), min(y_vals) * return Rect(x_min, y_min, max(x_vals)-x_min, max(y_vals)-y_min) # <<<<<<<<<<<<<< @@ -101993,16 +105016,16 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(CYTHON_UNU * return Polygon(*points, bounciness=bounciness) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3021, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_v_x_vals); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3021, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_v_x_vals); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = PyNumber_Subtract(__pyx_t_7, __pyx_v_x_min); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3021, __pyx_L1_error) + __pyx_t_5 = PyNumber_Subtract(__pyx_t_7, __pyx_v_x_min); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_v_y_vals); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3021, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_max, __pyx_v_y_vals); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = PyNumber_Subtract(__pyx_t_7, __pyx_v_y_min); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3021, __pyx_L1_error) + __pyx_t_9 = PyNumber_Subtract(__pyx_t_7, __pyx_v_y_min); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; @@ -102025,7 +105048,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(CYTHON_UNU __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3021, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3107, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } @@ -102033,7 +105056,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(CYTHON_UNU __pyx_t_4 = 0; goto __pyx_L0; - /* "collisions.py":3019 + /* "collisions.py":3105 * * # To form a rectangle, we should have exactly two unique x-values and two unique y-values * if len(x_vals) == 2 and len(y_vals) == 2: # <<<<<<<<<<<<<< @@ -102042,7 +105065,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(CYTHON_UNU */ } - /* "collisions.py":3014 + /* "collisions.py":3100 * return Line(*points, bounciness) * * if len(points) == 4: # <<<<<<<<<<<<<< @@ -102051,7 +105074,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(CYTHON_UNU */ } - /* "collisions.py":3023 + /* "collisions.py":3109 * return Rect(x_min, y_min, max(x_vals)-x_min, max(y_vals)-y_min) * * return Polygon(*points, bounciness=bounciness) # <<<<<<<<<<<<<< @@ -102059,15 +105082,15 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(CYTHON_UNU * @staticmethod */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3023, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3023, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3023, __pyx_L1_error) + __pyx_t_9 = PyFloat_FromDouble(__pyx_v_bounciness); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_bounciness, __pyx_t_9) < 0) __PYX_ERR(0, 3023, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_bounciness, __pyx_t_9) < 0) __PYX_ERR(0, 3109, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_v_points, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3023, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_v_points, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -102075,7 +105098,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(CYTHON_UNU __pyx_t_9 = 0; goto __pyx_L0; - /* "collisions.py":2986 + /* "collisions.py":3072 * return Shapes(*outshps) * * @staticmethod # <<<<<<<<<<<<<< @@ -102104,7 +105127,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_6pointsToShape(CYTHON_UNU return __pyx_r; } -/* "collisions.py":3025 +/* "collisions.py":3111 * return Polygon(*points, bounciness=bounciness) * * @staticmethod # <<<<<<<<<<<<<< @@ -102150,10 +105173,10 @@ static PyObject *__pyx_pw_10collisions_13ShapeCombiner_9pointsToPoly(PyObject *_ const Py_ssize_t index = 0; PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, *__pyx_pyargnames[index]); if (value) { values[index] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; } - else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3025, __pyx_L3_error) + else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3111, __pyx_L3_error) } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, 0, "pointsToPoly") < 0)) __PYX_ERR(0, 3025, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, 0, "pointsToPoly") < 0)) __PYX_ERR(0, 3111, __pyx_L3_error) } } else if (unlikely(__pyx_nargs < 0)) { goto __pyx_L5_argtuple_error; @@ -102163,7 +105186,7 @@ static PyObject *__pyx_pw_10collisions_13ShapeCombiner_9pointsToPoly(PyObject *_ } goto __pyx_L6_skip; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("pointsToPoly", 0, 0, 0, __pyx_nargs); __PYX_ERR(0, 3025, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("pointsToPoly", 0, 0, 0, __pyx_nargs); __PYX_ERR(0, 3111, __pyx_L3_error) __pyx_L6_skip:; goto __pyx_L4_argument_unpacking_done; __pyx_L3_error:; @@ -102211,7 +105234,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_8pointsToPoly(CYTHON_UNUS int __pyx_clineno = 0; __Pyx_RefNannySetupContext("pointsToPoly", 1); - /* "collisions.py":3039 + /* "collisions.py":3125 * Shape | Shapes: A Shapes object containing one polygon with the points from the input. * """ * return shapelyToColl(shapely.concave_hull(shapelyGeom.MultiPoint([tuple(i) for i in points]), ratio=ratio)) # <<<<<<<<<<<<<< @@ -102219,20 +105242,20 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_8pointsToPoly(CYTHON_UNUS * @staticmethod */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapelyToColl); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3039, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapelyToColl); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_shapely); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3039, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_shapely); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_concave_hull); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3039, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_concave_hull); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3039, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_shapelyGeom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_MultiPoint); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3039, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_MultiPoint); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; { /* enter inner scope */ - __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3039, __pyx_L5_error) + __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3125, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_7 = __pyx_v_points; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0; @@ -102240,21 +105263,21 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_8pointsToPoly(CYTHON_UNUS { Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_7); #if !CYTHON_ASSUME_SAFE_MACROS - if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3039, __pyx_L5_error) + if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3125, __pyx_L5_error) #endif if (__pyx_t_8 >= __pyx_temp) break; } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_9); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 3039, __pyx_L5_error) + __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_9); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 3125, __pyx_L5_error) #else - __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3039, __pyx_L5_error) + __pyx_t_9 = __Pyx_PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3125, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_XDECREF_SET(__pyx_9genexpr86__pyx_v_i, __pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PySequence_Tuple(__pyx_9genexpr86__pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3039, __pyx_L5_error) + __pyx_t_9 = __Pyx_PySequence_Tuple(__pyx_9genexpr86__pyx_v_i); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 3125, __pyx_L5_error) __Pyx_GOTREF(__pyx_t_9); - if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 3039, __pyx_L5_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_9))) __PYX_ERR(0, 3125, __pyx_L5_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -102284,19 +105307,19 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_8pointsToPoly(CYTHON_UNUS __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3039, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3039, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_3); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 3039, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3)) __PYX_ERR(0, 3125, __pyx_L1_error); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3039, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ratio, __pyx_v_ratio) < 0) __PYX_ERR(0, 3039, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3039, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ratio, __pyx_v_ratio) < 0) __PYX_ERR(0, 3125, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -102320,7 +105343,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_8pointsToPoly(CYTHON_UNUS __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3039, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -102328,7 +105351,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_8pointsToPoly(CYTHON_UNUS __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":3025 + /* "collisions.py":3111 * return Polygon(*points, bounciness=bounciness) * * @staticmethod # <<<<<<<<<<<<<< @@ -102355,7 +105378,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_8pointsToPoly(CYTHON_UNUS return __pyx_r; } -/* "collisions.py":3041 +/* "collisions.py":3127 * return shapelyToColl(shapely.concave_hull(shapelyGeom.MultiPoint([tuple(i) for i in points]), ratio=ratio)) * * @staticmethod # <<<<<<<<<<<<<< @@ -102408,7 +105431,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_10shapelyUnion(CYTHON_UNU int __pyx_clineno = 0; __Pyx_RefNannySetupContext("shapelyUnion", 1); - /* "collisions.py":3054 + /* "collisions.py":3140 * Shape: A Shape which is the union of all the input shapes. * """ * return shapelyToColl(shapelyOps.unary_union(collToShapely(Shapes(*shapes)))) # <<<<<<<<<<<<<< @@ -102416,18 +105439,18 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_10shapelyUnion(CYTHON_UNU * # TODO: Options for having func(a, b, c) OR func([a, b, c]) */ __Pyx_XDECREF(__pyx_r); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapelyToColl); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3054, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_shapelyToColl); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_shapelyOps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3054, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_shapelyOps); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_unary_union); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3054, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_unary_union); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_collToShapely); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3054, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_collToShapely); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3054, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Shapes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_v_shapes, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3054, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_v_shapes, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; @@ -102449,7 +105472,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_10shapelyUnion(CYTHON_UNU __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3054, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -102472,7 +105495,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_10shapelyUnion(CYTHON_UNU __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3054, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } @@ -102495,7 +105518,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_10shapelyUnion(CYTHON_UNU __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3054, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -102503,7 +105526,7 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_10shapelyUnion(CYTHON_UNU __pyx_t_1 = 0; goto __pyx_L0; - /* "collisions.py":3041 + /* "collisions.py":3127 * return shapelyToColl(shapely.concave_hull(shapelyGeom.MultiPoint([tuple(i) for i in points]), ratio=ratio)) * * @staticmethod # <<<<<<<<<<<<<< @@ -102530,20 +105553,20 @@ static PyObject *__pyx_pf_10collisions_13ShapeCombiner_10shapelyUnion(CYTHON_UNU } #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct__genexpr *__pyx_freelist_10collisions___pyx_scope_struct__genexpr[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct__genexpr = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct__closestPointTo *__pyx_freelist_10collisions___pyx_scope_struct__closestPointTo[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct__closestPointTo = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct__closestPointTo(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct__genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct__genexpr)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct__genexpr[--__pyx_freecount_10collisions___pyx_scope_struct__genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct__genexpr)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct__closestPointTo > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct__closestPointTo)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct__closestPointTo[--__pyx_freecount_10collisions___pyx_scope_struct__closestPointTo]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct__closestPointTo)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -102556,22 +105579,20 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct__genexpr(PyTypeObj return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct__genexpr(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct__genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct__genexpr *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct__closestPointTo(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct__closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct__closestPointTo *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct__genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct__closestPointTo) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); - Py_CLEAR(p->__pyx_genexpr_arg_0); - Py_CLEAR(p->__pyx_v_s); - Py_CLEAR(p->__pyx_t_0); + Py_CLEAR(p->__pyx_v_othershape); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct__genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct__genexpr)))) { - __pyx_freelist_10collisions___pyx_scope_struct__genexpr[__pyx_freecount_10collisions___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct__genexpr *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct__closestPointTo < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct__closestPointTo)))) { + __pyx_freelist_10collisions___pyx_scope_struct__closestPointTo[__pyx_freecount_10collisions___pyx_scope_struct__closestPointTo++] = ((struct __pyx_obj_10collisions___pyx_scope_struct__closestPointTo *)o); } else #endif { @@ -102586,42 +105607,46 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct__genexpr(PyObject * } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct__closestPointTo(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct__genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct__genexpr *)o; - if (p->__pyx_genexpr_arg_0) { - e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; - } - if (p->__pyx_v_s) { - e = (*v)(p->__pyx_v_s, a); if (e) return e; - } - if (p->__pyx_t_0) { - e = (*v)(p->__pyx_t_0, a); if (e) return e; + struct __pyx_obj_10collisions___pyx_scope_struct__closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct__closestPointTo *)o; + if (p->__pyx_v_othershape) { + e = (*v)(p->__pyx_v_othershape, a); if (e) return e; } return 0; } + +static int __pyx_tp_clear_10collisions___pyx_scope_struct__closestPointTo(PyObject *o) { + PyObject* tmp; + struct __pyx_obj_10collisions___pyx_scope_struct__closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct__closestPointTo *)o; + tmp = ((PyObject*)p->__pyx_v_othershape); + p->__pyx_v_othershape = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + return 0; +} #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct__genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct__genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct__genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct__genexpr}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct__closestPointTo_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct__closestPointTo}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct__closestPointTo}, + {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct__closestPointTo}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct__closestPointTo}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct__genexpr_spec = { - "collisions.__pyx_scope_struct__genexpr", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct__genexpr), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct__closestPointTo_spec = { + "collisions.__pyx_scope_struct__closestPointTo", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct__closestPointTo), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct__genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct__closestPointTo_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct__genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct__closestPointTo = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct__genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct__genexpr), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct__closestPointTo", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct__closestPointTo), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct__genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct__closestPointTo, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -102648,8 +105673,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct__genexpr = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct__genexpr, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct__closestPointTo, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct__closestPointTo, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -102666,7 +105691,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct__genexpr = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct__genexpr, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct__closestPointTo, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -102739,7 +105764,7 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_1_genexpr(PyObject #endif PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_genexpr_arg_0); - Py_CLEAR(p->__pyx_v_i); + Py_CLEAR(p->__pyx_v_s); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_1_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_1_genexpr)))) { @@ -102764,8 +105789,8 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_1_genexpr(PyObject if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } - if (p->__pyx_v_i) { - e = (*v)(p->__pyx_v_i, a); if (e) return e; + if (p->__pyx_v_s) { + e = (*v)(p->__pyx_v_s, a); if (e) return e; } if (p->__pyx_t_0) { e = (*v)(p->__pyx_t_0, a); if (e) return e; @@ -103046,20 +106071,192 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_2_genexpr = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_3_genexpr[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_3_genexpr = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_3_genexpr[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_3_genexpr = 0; +#endif + +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + PyObject *o; + #if CYTHON_COMPILING_IN_LIMITED_API + allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); + o = alloc_func(t, 0); + #else + #if CYTHON_USE_FREELISTS + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_3_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_3_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_3_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr)); + (void) PyObject_INIT(o, t); + PyObject_GC_Track(o); + } else + #endif + { + o = (*t->tp_alloc)(t, 0); + if (unlikely(!o)) return 0; + } + #endif + return o; +} + +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_3_genexpr(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr *)o; + #if CYTHON_USE_TP_FINALIZE + if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_3_genexpr) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + } + #endif + PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_genexpr_arg_0); + Py_CLEAR(p->__pyx_v_i); + Py_CLEAR(p->__pyx_t_0); + #if CYTHON_USE_FREELISTS + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_3_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr)))) { + __pyx_freelist_10collisions___pyx_scope_struct_3_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr *)o); + } else + #endif + { + #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY + (*Py_TYPE(o)->tp_free)(o); + #else + { + freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free); + if (tp_free) tp_free(o); + } + #endif + } +} + +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) { + int e; + struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr *)o; + if (p->__pyx_genexpr_arg_0) { + e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; + } + if (p->__pyx_v_i) { + e = (*v)(p->__pyx_v_i, a); if (e) return e; + } + if (p->__pyx_t_0) { + e = (*v)(p->__pyx_t_0, a); if (e) return e; + } + return 0; +} +#if CYTHON_USE_TYPE_SPECS +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_3_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_3_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_3_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_3_genexpr}, + {0, 0}, +}; +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_3_genexpr_spec = { + "collisions.__pyx_scope_struct_3_genexpr", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr), + 0, + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, + __pyx_type_10collisions___pyx_scope_struct_3_genexpr_slots, +}; +#else + +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_3_genexpr = { + PyVarObject_HEAD_INIT(0, 0) + "collisions.""__pyx_scope_struct_3_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_3_genexpr, /*tp_dealloc*/ + #if PY_VERSION_HEX < 0x030800b4 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030800b4 + 0, /*tp_vectorcall_offset*/ + #endif + 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|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ + 0, /*tp_doc*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_3_genexpr, /*tp_traverse*/ + 0, /*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*/ + #if !CYTHON_USE_TYPE_SPECS + 0, /*tp_dictoffset*/ + #endif + 0, /*tp_init*/ + 0, /*tp_alloc*/ + __pyx_tp_new_10collisions___pyx_scope_struct_3_genexpr, /*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 + #if CYTHON_USE_TP_FINALIZE + 0, /*tp_finalize*/ + #else + NULL, /*tp_finalize*/ + #endif + #endif + #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800) + 0, /*tp_vectorcall*/ + #endif + #if __PYX_NEED_TP_PRINT_SLOT == 1 + 0, /*tp_print*/ + #endif + #if PY_VERSION_HEX >= 0x030C0000 + 0, /*tp_watched*/ + #endif + #if PY_VERSION_HEX >= 0x030d00A4 + 0, /*tp_versions_used*/ + #endif + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000 + 0, /*tp_pypy_flags*/ + #endif +}; +#endif + +#if CYTHON_USE_FREELISTS +static struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_4_genexpr[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_4_genexpr = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_3_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_3_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_3_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_4_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_4_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_4_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -103072,11 +106269,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_3_genexpr(PyTypeOb return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_3_genexpr(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_4_genexpr(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_3_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_4_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -103086,8 +106283,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_3_genexpr(PyObject Py_CLEAR(p->__pyx_v_i); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_3_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr)))) { - __pyx_freelist_10collisions___pyx_scope_struct_3_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_4_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr)))) { + __pyx_freelist_10collisions___pyx_scope_struct_4_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_4_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr *)o); } else #endif { @@ -103102,9 +106299,9 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_3_genexpr(PyObject } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr *)o; if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } @@ -103117,27 +106314,27 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_3_genexpr(PyObject return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_3_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_3_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_3_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_3_genexpr}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_4_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_4_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_4_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_4_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_3_genexpr_spec = { - "collisions.__pyx_scope_struct_3_genexpr", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_4_genexpr_spec = { + "collisions.__pyx_scope_struct_4_genexpr", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_3_genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_4_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_3_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_4_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_3_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_3_genexpr), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_4_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_3_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_4_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -103164,7 +106361,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_3_genexpr = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_3_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_4_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -103182,7 +106379,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_3_genexpr = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_3_genexpr, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_4_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -103218,20 +106415,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_3_genexpr = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_4_genexpr[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_4_genexpr = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_5_genexpr[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_5_genexpr = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_4_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_4_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_4_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_4_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_5_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_5_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_5_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -103244,11 +106441,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_4_genexpr(PyTypeOb return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_4_genexpr(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_5_genexpr(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_4_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_5_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -103258,8 +106455,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_4_genexpr(PyObject Py_CLEAR(p->__pyx_v_i); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_4_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr)))) { - __pyx_freelist_10collisions___pyx_scope_struct_4_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_4_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_5_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr)))) { + __pyx_freelist_10collisions___pyx_scope_struct_5_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr *)o); } else #endif { @@ -103274,9 +106471,9 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_4_genexpr(PyObject } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_4_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr *)o; if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } @@ -103289,27 +106486,27 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_4_genexpr(PyObject return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_4_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_4_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_4_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_4_genexpr}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_5_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_5_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_5_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_5_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_4_genexpr_spec = { - "collisions.__pyx_scope_struct_4_genexpr", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_5_genexpr_spec = { + "collisions.__pyx_scope_struct_5_genexpr", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_4_genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_5_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_4_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_5_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_4_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_4_genexpr), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_5_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_4_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_5_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -103336,7 +106533,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_4_genexpr = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_4_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_5_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -103354,7 +106551,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_4_genexpr = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_4_genexpr, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_5_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -103390,20 +106587,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_4_genexpr = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_5_genexpr[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_5_genexpr = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_6_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_6_genexpr[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_6_genexpr = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_5_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_6_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_5_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_5_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_5_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_6_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_6_genexpr)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_6_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_6_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_6_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -103416,11 +106613,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_5_genexpr(PyTypeOb return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_5_genexpr(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_6_genexpr(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_6_genexpr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_5_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_6_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -103430,8 +106627,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_5_genexpr(PyObject Py_CLEAR(p->__pyx_v_s); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_5_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr)))) { - __pyx_freelist_10collisions___pyx_scope_struct_5_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_5_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_6_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_6_genexpr)))) { + __pyx_freelist_10collisions___pyx_scope_struct_6_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_6_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_6_genexpr *)o); } else #endif { @@ -103446,9 +106643,9 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_5_genexpr(PyObject } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_5_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_6_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_6_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_6_genexpr *)o; if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } @@ -103461,27 +106658,27 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_5_genexpr(PyObject return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_5_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_5_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_5_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_5_genexpr}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_6_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_6_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_6_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_6_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_5_genexpr_spec = { - "collisions.__pyx_scope_struct_5_genexpr", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_6_genexpr_spec = { + "collisions.__pyx_scope_struct_6_genexpr", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_6_genexpr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_5_genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_6_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_5_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_6_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_5_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_5_genexpr), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_6_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_6_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_5_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_6_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -103508,7 +106705,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_5_genexpr = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_5_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_6_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -103526,7 +106723,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_5_genexpr = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_5_genexpr, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_6_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -103562,20 +106759,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_5_genexpr = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_6_handleCollisionsPos *__pyx_freelist_10collisions___pyx_scope_struct_6_handleCollisionsPos[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_6_handleCollisionsPos = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_7_handleCollisionsPos *__pyx_freelist_10collisions___pyx_scope_struct_7_handleCollisionsPos[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_7_handleCollisionsPos = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_6_handleCollisionsPos(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_7_handleCollisionsPos(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_6_handleCollisionsPos > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_6_handleCollisionsPos)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_6_handleCollisionsPos[--__pyx_freecount_10collisions___pyx_scope_struct_6_handleCollisionsPos]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_6_handleCollisionsPos)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_7_handleCollisionsPos > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_7_handleCollisionsPos)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_7_handleCollisionsPos[--__pyx_freecount_10collisions___pyx_scope_struct_7_handleCollisionsPos]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_7_handleCollisionsPos)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -103588,11 +106785,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_6_handleCollisions return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_6_handleCollisionsPos(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_6_handleCollisionsPos *p = (struct __pyx_obj_10collisions___pyx_scope_struct_6_handleCollisionsPos *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_7_handleCollisionsPos(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_7_handleCollisionsPos *p = (struct __pyx_obj_10collisions___pyx_scope_struct_7_handleCollisionsPos *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_6_handleCollisionsPos) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_7_handleCollisionsPos) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -103600,8 +106797,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_6_handleCollisionsP PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_oldPoint); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_6_handleCollisionsPos < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_6_handleCollisionsPos)))) { - __pyx_freelist_10collisions___pyx_scope_struct_6_handleCollisionsPos[__pyx_freecount_10collisions___pyx_scope_struct_6_handleCollisionsPos++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_6_handleCollisionsPos *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_7_handleCollisionsPos < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_7_handleCollisionsPos)))) { + __pyx_freelist_10collisions___pyx_scope_struct_7_handleCollisionsPos[__pyx_freecount_10collisions___pyx_scope_struct_7_handleCollisionsPos++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_7_handleCollisionsPos *)o); } else #endif { @@ -103616,46 +106813,46 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_6_handleCollisionsP } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_6_handleCollisionsPos(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_7_handleCollisionsPos(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_6_handleCollisionsPos *p = (struct __pyx_obj_10collisions___pyx_scope_struct_6_handleCollisionsPos *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_7_handleCollisionsPos *p = (struct __pyx_obj_10collisions___pyx_scope_struct_7_handleCollisionsPos *)o; if (p->__pyx_v_oldPoint) { e = (*v)(p->__pyx_v_oldPoint, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_10collisions___pyx_scope_struct_6_handleCollisionsPos(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_7_handleCollisionsPos(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_6_handleCollisionsPos *p = (struct __pyx_obj_10collisions___pyx_scope_struct_6_handleCollisionsPos *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_7_handleCollisionsPos *p = (struct __pyx_obj_10collisions___pyx_scope_struct_7_handleCollisionsPos *)o; tmp = ((PyObject*)p->__pyx_v_oldPoint); p->__pyx_v_oldPoint = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_6_handleCollisionsPos_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_6_handleCollisionsPos}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_6_handleCollisionsPos}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_6_handleCollisionsPos}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_6_handleCollisionsPos}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_7_handleCollisionsPos_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_7_handleCollisionsPos}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_7_handleCollisionsPos}, + {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_7_handleCollisionsPos}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_7_handleCollisionsPos}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_6_handleCollisionsPos_spec = { - "collisions.__pyx_scope_struct_6_handleCollisionsPos", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_6_handleCollisionsPos), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_7_handleCollisionsPos_spec = { + "collisions.__pyx_scope_struct_7_handleCollisionsPos", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_7_handleCollisionsPos), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_6_handleCollisionsPos_slots, + __pyx_type_10collisions___pyx_scope_struct_7_handleCollisionsPos_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_6_handleCollisionsPos = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_7_handleCollisionsPos = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_6_handleCollisionsPos", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_6_handleCollisionsPos), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_7_handleCollisionsPos", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_7_handleCollisionsPos), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_6_handleCollisionsPos, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_7_handleCollisionsPos, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -103682,8 +106879,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_6_handleCollision 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_6_handleCollisionsPos, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_6_handleCollisionsPos, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_7_handleCollisionsPos, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_7_handleCollisionsPos, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -103700,7 +106897,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_6_handleCollision #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_6_handleCollisionsPos, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_7_handleCollisionsPos, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -103736,20 +106933,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_6_handleCollision #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo *__pyx_freelist_10collisions___pyx_scope_struct_7_closestPointTo[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_7_closestPointTo = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_8_closestPointTo *__pyx_freelist_10collisions___pyx_scope_struct_8_closestPointTo[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_8_closestPointTo = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_7_closestPointTo(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_8_closestPointTo(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_7_closestPointTo > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_7_closestPointTo[--__pyx_freecount_10collisions___pyx_scope_struct_7_closestPointTo]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_8_closestPointTo > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_8_closestPointTo)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_8_closestPointTo[--__pyx_freecount_10collisions___pyx_scope_struct_8_closestPointTo]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_8_closestPointTo)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -103762,11 +106959,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_7_closestPointTo(P return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_7_closestPointTo(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_8_closestPointTo(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_8_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_8_closestPointTo *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_7_closestPointTo) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_8_closestPointTo) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -103774,8 +106971,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_7_closestPointTo(Py PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_self); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_7_closestPointTo < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo)))) { - __pyx_freelist_10collisions___pyx_scope_struct_7_closestPointTo[__pyx_freecount_10collisions___pyx_scope_struct_7_closestPointTo++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_8_closestPointTo < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_8_closestPointTo)))) { + __pyx_freelist_10collisions___pyx_scope_struct_8_closestPointTo[__pyx_freecount_10collisions___pyx_scope_struct_8_closestPointTo++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_8_closestPointTo *)o); } else #endif { @@ -103790,46 +106987,46 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_7_closestPointTo(Py } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_7_closestPointTo(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_8_closestPointTo(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_8_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_8_closestPointTo *)o; if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_10collisions___pyx_scope_struct_7_closestPointTo(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_8_closestPointTo(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_8_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_8_closestPointTo *)o; tmp = ((PyObject*)p->__pyx_v_self); p->__pyx_v_self = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_7_closestPointTo_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_7_closestPointTo}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_7_closestPointTo}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_7_closestPointTo}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_7_closestPointTo}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_8_closestPointTo_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_8_closestPointTo}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_8_closestPointTo}, + {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_8_closestPointTo}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_8_closestPointTo}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_7_closestPointTo_spec = { - "collisions.__pyx_scope_struct_7_closestPointTo", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_8_closestPointTo_spec = { + "collisions.__pyx_scope_struct_8_closestPointTo", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_8_closestPointTo), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_7_closestPointTo_slots, + __pyx_type_10collisions___pyx_scope_struct_8_closestPointTo_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_7_closestPointTo = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_8_closestPointTo = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_7_closestPointTo", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_7_closestPointTo), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_8_closestPointTo", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_8_closestPointTo), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_7_closestPointTo, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_8_closestPointTo, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -103856,8 +107053,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_7_closestPointTo 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_7_closestPointTo, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_7_closestPointTo, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_8_closestPointTo, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_8_closestPointTo, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -103874,7 +107071,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_7_closestPointTo #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_7_closestPointTo, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_8_closestPointTo, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -103910,20 +107107,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_7_closestPointTo #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner *__pyx_freelist_10collisions___pyx_scope_struct_8_isCorner[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_8_isCorner = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_9_isCorner *__pyx_freelist_10collisions___pyx_scope_struct_9_isCorner[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_9_isCorner = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_8_isCorner(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_9_isCorner(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_8_isCorner > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_8_isCorner[--__pyx_freecount_10collisions___pyx_scope_struct_8_isCorner]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_9_isCorner > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_9_isCorner)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_9_isCorner[--__pyx_freecount_10collisions___pyx_scope_struct_9_isCorner]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_9_isCorner)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -103936,11 +107133,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_8_isCorner(PyTypeO return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_8_isCorner(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner *p = (struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_9_isCorner(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_9_isCorner *p = (struct __pyx_obj_10collisions___pyx_scope_struct_9_isCorner *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_8_isCorner) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_9_isCorner) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -103948,8 +107145,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_8_isCorner(PyObject PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_precision); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_8_isCorner < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner)))) { - __pyx_freelist_10collisions___pyx_scope_struct_8_isCorner[__pyx_freecount_10collisions___pyx_scope_struct_8_isCorner++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_9_isCorner < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_9_isCorner)))) { + __pyx_freelist_10collisions___pyx_scope_struct_9_isCorner[__pyx_freecount_10collisions___pyx_scope_struct_9_isCorner++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_9_isCorner *)o); } else #endif { @@ -103964,46 +107161,46 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_8_isCorner(PyObject } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_8_isCorner(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_9_isCorner(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner *p = (struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_9_isCorner *p = (struct __pyx_obj_10collisions___pyx_scope_struct_9_isCorner *)o; if (p->__pyx_v_precision) { e = (*v)(p->__pyx_v_precision, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_10collisions___pyx_scope_struct_8_isCorner(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_9_isCorner(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner *p = (struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_9_isCorner *p = (struct __pyx_obj_10collisions___pyx_scope_struct_9_isCorner *)o; tmp = ((PyObject*)p->__pyx_v_precision); p->__pyx_v_precision = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_8_isCorner_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_8_isCorner}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_8_isCorner}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_8_isCorner}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_8_isCorner}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_9_isCorner_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_9_isCorner}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_9_isCorner}, + {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_9_isCorner}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_9_isCorner}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_8_isCorner_spec = { - "collisions.__pyx_scope_struct_8_isCorner", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_9_isCorner_spec = { + "collisions.__pyx_scope_struct_9_isCorner", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_9_isCorner), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_8_isCorner_slots, + __pyx_type_10collisions___pyx_scope_struct_9_isCorner_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_8_isCorner = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_9_isCorner = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_8_isCorner", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_8_isCorner), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_9_isCorner", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_9_isCorner), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_8_isCorner, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_9_isCorner, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -104030,8 +107227,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_8_isCorner = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_8_isCorner, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_8_isCorner, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_9_isCorner, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_9_isCorner, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -104048,7 +107245,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_8_isCorner = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_8_isCorner, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_9_isCorner, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -104084,20 +107281,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_8_isCorner = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_9__contains *__pyx_freelist_10collisions___pyx_scope_struct_9__contains[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_9__contains = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_10__contains *__pyx_freelist_10collisions___pyx_scope_struct_10__contains[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_10__contains = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_9__contains(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_10__contains(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_9__contains > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_9__contains)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_9__contains[--__pyx_freecount_10collisions___pyx_scope_struct_9__contains]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_9__contains)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_10__contains > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_10__contains)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_10__contains[--__pyx_freecount_10collisions___pyx_scope_struct_10__contains]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_10__contains)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -104110,11 +107307,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_9__contains(PyType return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_9__contains(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_9__contains *p = (struct __pyx_obj_10collisions___pyx_scope_struct_9__contains *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_10__contains(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_10__contains *p = (struct __pyx_obj_10collisions___pyx_scope_struct_10__contains *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_9__contains) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_10__contains) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -104122,8 +107319,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_9__contains(PyObjec PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_self); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_9__contains < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_9__contains)))) { - __pyx_freelist_10collisions___pyx_scope_struct_9__contains[__pyx_freecount_10collisions___pyx_scope_struct_9__contains++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_9__contains *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_10__contains < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_10__contains)))) { + __pyx_freelist_10collisions___pyx_scope_struct_10__contains[__pyx_freecount_10collisions___pyx_scope_struct_10__contains++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_10__contains *)o); } else #endif { @@ -104138,46 +107335,46 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_9__contains(PyObjec } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_9__contains(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_10__contains(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_9__contains *p = (struct __pyx_obj_10collisions___pyx_scope_struct_9__contains *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_10__contains *p = (struct __pyx_obj_10collisions___pyx_scope_struct_10__contains *)o; if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_10collisions___pyx_scope_struct_9__contains(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_10__contains(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_9__contains *p = (struct __pyx_obj_10collisions___pyx_scope_struct_9__contains *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_10__contains *p = (struct __pyx_obj_10collisions___pyx_scope_struct_10__contains *)o; tmp = ((PyObject*)p->__pyx_v_self); p->__pyx_v_self = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_9__contains_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_9__contains}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_9__contains}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_9__contains}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_9__contains}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_10__contains_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_10__contains}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_10__contains}, + {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_10__contains}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_10__contains}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_9__contains_spec = { - "collisions.__pyx_scope_struct_9__contains", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_9__contains), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_10__contains_spec = { + "collisions.__pyx_scope_struct_10__contains", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_10__contains), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_9__contains_slots, + __pyx_type_10collisions___pyx_scope_struct_10__contains_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_9__contains = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_10__contains = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_9__contains", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_9__contains), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_10__contains", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_10__contains), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_9__contains, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_10__contains, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -104204,8 +107401,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_9__contains = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_9__contains, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_9__contains, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_10__contains, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_10__contains, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -104222,7 +107419,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_9__contains = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_9__contains, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_10__contains, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -104258,20 +107455,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_9__contains = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_10_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_10_genexpr[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_10_genexpr = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_11_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_11_genexpr[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_11_genexpr = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_10_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_11_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_10_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_10_genexpr)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_10_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_10_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_10_genexpr)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_11_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_11_genexpr)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_11_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_11_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_11_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -104284,11 +107481,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_10_genexpr(PyTypeO return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_10_genexpr(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_10_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_10_genexpr *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_11_genexpr(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_11_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_11_genexpr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_10_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_11_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -104298,8 +107495,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_10_genexpr(PyObject Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_p); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_10_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_10_genexpr)))) { - __pyx_freelist_10collisions___pyx_scope_struct_10_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_10_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_10_genexpr *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_11_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_11_genexpr)))) { + __pyx_freelist_10collisions___pyx_scope_struct_11_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_11_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_11_genexpr *)o); } else #endif { @@ -104314,9 +107511,9 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_10_genexpr(PyObject } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_10_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_11_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_10_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_10_genexpr *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_11_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_11_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } @@ -104329,27 +107526,27 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_10_genexpr(PyObject return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_10_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_10_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_10_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_10_genexpr}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_11_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_11_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_11_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_11_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_10_genexpr_spec = { - "collisions.__pyx_scope_struct_10_genexpr", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_10_genexpr), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_11_genexpr_spec = { + "collisions.__pyx_scope_struct_11_genexpr", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_11_genexpr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_10_genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_11_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_10_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_11_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_10_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_10_genexpr), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_11_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_11_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_10_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_11_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -104376,7 +107573,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_10_genexpr = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_10_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_11_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -104394,7 +107591,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_10_genexpr = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_10_genexpr, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_11_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -104430,20 +107627,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_10_genexpr = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo *__pyx_freelist_10collisions___pyx_scope_struct_11_closestPointTo[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_11_closestPointTo = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_12_closestPointTo *__pyx_freelist_10collisions___pyx_scope_struct_12_closestPointTo[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_12_closestPointTo = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_11_closestPointTo(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_12_closestPointTo(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_11_closestPointTo > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_11_closestPointTo[--__pyx_freecount_10collisions___pyx_scope_struct_11_closestPointTo]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_12_closestPointTo > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_12_closestPointTo)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_12_closestPointTo[--__pyx_freecount_10collisions___pyx_scope_struct_12_closestPointTo]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_12_closestPointTo)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -104456,11 +107653,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_11_closestPointTo( return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_11_closestPointTo(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_12_closestPointTo(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_12_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_12_closestPointTo *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_11_closestPointTo) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_12_closestPointTo) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -104468,8 +107665,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_11_closestPointTo(P PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_self); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_11_closestPointTo < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo)))) { - __pyx_freelist_10collisions___pyx_scope_struct_11_closestPointTo[__pyx_freecount_10collisions___pyx_scope_struct_11_closestPointTo++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_12_closestPointTo < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_12_closestPointTo)))) { + __pyx_freelist_10collisions___pyx_scope_struct_12_closestPointTo[__pyx_freecount_10collisions___pyx_scope_struct_12_closestPointTo++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_12_closestPointTo *)o); } else #endif { @@ -104484,46 +107681,46 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_11_closestPointTo(P } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_11_closestPointTo(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_12_closestPointTo(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_12_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_12_closestPointTo *)o; if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_10collisions___pyx_scope_struct_11_closestPointTo(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_12_closestPointTo(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_12_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_12_closestPointTo *)o; tmp = ((PyObject*)p->__pyx_v_self); p->__pyx_v_self = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_11_closestPointTo_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_11_closestPointTo}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_11_closestPointTo}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_11_closestPointTo}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_11_closestPointTo}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_12_closestPointTo_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_12_closestPointTo}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_12_closestPointTo}, + {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_12_closestPointTo}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_12_closestPointTo}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_11_closestPointTo_spec = { - "collisions.__pyx_scope_struct_11_closestPointTo", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_12_closestPointTo_spec = { + "collisions.__pyx_scope_struct_12_closestPointTo", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_12_closestPointTo), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_11_closestPointTo_slots, + __pyx_type_10collisions___pyx_scope_struct_12_closestPointTo_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_11_closestPointTo = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_12_closestPointTo = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_11_closestPointTo", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_11_closestPointTo), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_12_closestPointTo", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_12_closestPointTo), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_11_closestPointTo, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_12_closestPointTo, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -104550,8 +107747,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_11_closestPointTo 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_11_closestPointTo, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_11_closestPointTo, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_12_closestPointTo, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_12_closestPointTo, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -104568,7 +107765,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_11_closestPointTo #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_11_closestPointTo, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_12_closestPointTo, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -104604,20 +107801,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_11_closestPointTo #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos *__pyx_freelist_10collisions___pyx_scope_struct_12_handleCollisionsPos[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_12_handleCollisionsPos = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_13_handleCollisionsPos *__pyx_freelist_10collisions___pyx_scope_struct_13_handleCollisionsPos[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_13_handleCollisionsPos = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_12_handleCollisionsPos(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_13_handleCollisionsPos(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_12_handleCollisionsPos > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_12_handleCollisionsPos[--__pyx_freecount_10collisions___pyx_scope_struct_12_handleCollisionsPos]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_13_handleCollisionsPos > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_13_handleCollisionsPos)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_13_handleCollisionsPos[--__pyx_freecount_10collisions___pyx_scope_struct_13_handleCollisionsPos]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_13_handleCollisionsPos)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -104630,20 +107827,23 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_12_handleCollision return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_12_handleCollisionsPos(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos *p = (struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_13_handleCollisionsPos(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_13_handleCollisionsPos *p = (struct __pyx_obj_10collisions___pyx_scope_struct_13_handleCollisionsPos *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_12_handleCollisionsPos) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_13_handleCollisionsPos) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } #endif PyObject_GC_UnTrack(o); + Py_CLEAR(p->__pyx_v_closestObj); + Py_CLEAR(p->__pyx_v_newCir); Py_CLEAR(p->__pyx_v_oldCir); + Py_CLEAR(p->__pyx_v_velphi); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_12_handleCollisionsPos < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos)))) { - __pyx_freelist_10collisions___pyx_scope_struct_12_handleCollisionsPos[__pyx_freecount_10collisions___pyx_scope_struct_12_handleCollisionsPos++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_13_handleCollisionsPos < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_13_handleCollisionsPos)))) { + __pyx_freelist_10collisions___pyx_scope_struct_13_handleCollisionsPos[__pyx_freecount_10collisions___pyx_scope_struct_13_handleCollisionsPos++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_13_handleCollisionsPos *)o); } else #endif { @@ -104658,46 +107858,64 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_12_handleCollisions } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_12_handleCollisionsPos(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_13_handleCollisionsPos(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos *p = (struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_13_handleCollisionsPos *p = (struct __pyx_obj_10collisions___pyx_scope_struct_13_handleCollisionsPos *)o; + if (p->__pyx_v_closestObj) { + e = (*v)(p->__pyx_v_closestObj, a); if (e) return e; + } + if (p->__pyx_v_newCir) { + e = (*v)(p->__pyx_v_newCir, a); if (e) return e; + } if (p->__pyx_v_oldCir) { e = (*v)(p->__pyx_v_oldCir, a); if (e) return e; } + if (p->__pyx_v_velphi) { + e = (*v)(p->__pyx_v_velphi, a); if (e) return e; + } return 0; } -static int __pyx_tp_clear_10collisions___pyx_scope_struct_12_handleCollisionsPos(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_13_handleCollisionsPos(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos *p = (struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_13_handleCollisionsPos *p = (struct __pyx_obj_10collisions___pyx_scope_struct_13_handleCollisionsPos *)o; + tmp = ((PyObject*)p->__pyx_v_closestObj); + p->__pyx_v_closestObj = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_newCir); + p->__pyx_v_newCir = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); tmp = ((PyObject*)p->__pyx_v_oldCir); p->__pyx_v_oldCir = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); + tmp = ((PyObject*)p->__pyx_v_velphi); + p->__pyx_v_velphi = Py_None; Py_INCREF(Py_None); + Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_12_handleCollisionsPos_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_12_handleCollisionsPos}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_12_handleCollisionsPos}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_12_handleCollisionsPos}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_12_handleCollisionsPos}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_13_handleCollisionsPos_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_13_handleCollisionsPos}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_13_handleCollisionsPos}, + {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_13_handleCollisionsPos}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_13_handleCollisionsPos}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_12_handleCollisionsPos_spec = { - "collisions.__pyx_scope_struct_12_handleCollisionsPos", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_13_handleCollisionsPos_spec = { + "collisions.__pyx_scope_struct_13_handleCollisionsPos", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_13_handleCollisionsPos), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_12_handleCollisionsPos_slots, + __pyx_type_10collisions___pyx_scope_struct_13_handleCollisionsPos_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_12_handleCollisionsPos = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_13_handleCollisionsPos = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_12_handleCollisionsPos", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_12_handleCollisionsPos), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_13_handleCollisionsPos", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_13_handleCollisionsPos), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_12_handleCollisionsPos, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_13_handleCollisionsPos, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -104724,8 +107942,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_12_handleCollisio 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_12_handleCollisionsPos, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_12_handleCollisionsPos, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_13_handleCollisionsPos, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_13_handleCollisionsPos, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -104742,7 +107960,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_12_handleCollisio #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_12_handleCollisionsPos, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_13_handleCollisionsPos, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -104778,20 +107996,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_12_handleCollisio #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_13__collides *__pyx_freelist_10collisions___pyx_scope_struct_13__collides[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_13__collides = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_14__collides *__pyx_freelist_10collisions___pyx_scope_struct_14__collides[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_14__collides = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_13__collides(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_14__collides(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_13__collides > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_13__collides)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_13__collides[--__pyx_freecount_10collisions___pyx_scope_struct_13__collides]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_13__collides)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_14__collides > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_14__collides)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_14__collides[--__pyx_freecount_10collisions___pyx_scope_struct_14__collides]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_14__collides)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -104804,11 +108022,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_13__collides(PyTyp return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_13__collides(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_13__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_13__collides *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_14__collides(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_14__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_14__collides *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_13__collides) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_14__collides) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -104816,8 +108034,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_13__collides(PyObje PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_othershape); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_13__collides < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_13__collides)))) { - __pyx_freelist_10collisions___pyx_scope_struct_13__collides[__pyx_freecount_10collisions___pyx_scope_struct_13__collides++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_13__collides *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_14__collides < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_14__collides)))) { + __pyx_freelist_10collisions___pyx_scope_struct_14__collides[__pyx_freecount_10collisions___pyx_scope_struct_14__collides++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_14__collides *)o); } else #endif { @@ -104832,46 +108050,46 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_13__collides(PyObje } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_13__collides(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_14__collides(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_13__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_13__collides *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_14__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_14__collides *)o; if (p->__pyx_v_othershape) { e = (*v)(p->__pyx_v_othershape, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_10collisions___pyx_scope_struct_13__collides(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_14__collides(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_13__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_13__collides *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_14__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_14__collides *)o; tmp = ((PyObject*)p->__pyx_v_othershape); p->__pyx_v_othershape = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_13__collides_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_13__collides}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_13__collides}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_13__collides}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_13__collides}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_14__collides_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_14__collides}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_14__collides}, + {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_14__collides}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_14__collides}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_13__collides_spec = { - "collisions.__pyx_scope_struct_13__collides", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_13__collides), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_14__collides_spec = { + "collisions.__pyx_scope_struct_14__collides", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_14__collides), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_13__collides_slots, + __pyx_type_10collisions___pyx_scope_struct_14__collides_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_13__collides = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_14__collides = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_13__collides", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_13__collides), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_14__collides", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_14__collides), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_13__collides, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_14__collides, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -104898,8 +108116,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_13__collides = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_13__collides, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_13__collides, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_14__collides, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_14__collides, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -104916,7 +108134,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_13__collides = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_13__collides, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_14__collides, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -104952,20 +108170,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_13__collides = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_14_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_14_genexpr[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_14_genexpr = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_15_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_15_genexpr[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_15_genexpr = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_14_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_15_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_14_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_14_genexpr)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_14_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_14_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_14_genexpr)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_15_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_15_genexpr)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_15_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_15_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_15_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -104978,11 +108196,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_14_genexpr(PyTypeO return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_14_genexpr(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_14_genexpr *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_15_genexpr(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_15_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_15_genexpr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_14_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_15_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -104992,8 +108210,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_14_genexpr(PyObject Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_i); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_14_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_14_genexpr)))) { - __pyx_freelist_10collisions___pyx_scope_struct_14_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_14_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_14_genexpr *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_15_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_15_genexpr)))) { + __pyx_freelist_10collisions___pyx_scope_struct_15_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_15_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_15_genexpr *)o); } else #endif { @@ -105008,9 +108226,9 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_14_genexpr(PyObject } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_14_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_15_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_14_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_14_genexpr *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_15_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_15_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } @@ -105023,27 +108241,27 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_14_genexpr(PyObject return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_14_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_14_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_14_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_14_genexpr}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_15_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_15_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_15_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_15_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_14_genexpr_spec = { - "collisions.__pyx_scope_struct_14_genexpr", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_14_genexpr), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_15_genexpr_spec = { + "collisions.__pyx_scope_struct_15_genexpr", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_15_genexpr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_14_genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_15_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_14_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_15_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_14_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_14_genexpr), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_15_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_15_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_14_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_15_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -105070,7 +108288,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_14_genexpr = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_14_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_15_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -105088,7 +108306,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_14_genexpr = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_14_genexpr, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_15_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -105124,20 +108342,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_14_genexpr = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo *__pyx_freelist_10collisions___pyx_scope_struct_15_closestPointTo[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_15_closestPointTo = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_16_closestPointTo *__pyx_freelist_10collisions___pyx_scope_struct_16_closestPointTo[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_16_closestPointTo = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_15_closestPointTo(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_16_closestPointTo(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_15_closestPointTo > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_15_closestPointTo[--__pyx_freecount_10collisions___pyx_scope_struct_15_closestPointTo]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_16_closestPointTo > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_16_closestPointTo)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_16_closestPointTo[--__pyx_freecount_10collisions___pyx_scope_struct_16_closestPointTo]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_16_closestPointTo)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -105150,11 +108368,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_15_closestPointTo( return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_15_closestPointTo(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_16_closestPointTo(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_16_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_16_closestPointTo *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_15_closestPointTo) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_16_closestPointTo) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -105163,8 +108381,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_15_closestPointTo(P Py_CLEAR(p->__pyx_v_othershape); Py_CLEAR(p->__pyx_v_self); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_15_closestPointTo < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo)))) { - __pyx_freelist_10collisions___pyx_scope_struct_15_closestPointTo[__pyx_freecount_10collisions___pyx_scope_struct_15_closestPointTo++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_16_closestPointTo < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_16_closestPointTo)))) { + __pyx_freelist_10collisions___pyx_scope_struct_16_closestPointTo[__pyx_freecount_10collisions___pyx_scope_struct_16_closestPointTo++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_16_closestPointTo *)o); } else #endif { @@ -105179,9 +108397,9 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_15_closestPointTo(P } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_15_closestPointTo(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_16_closestPointTo(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_16_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_16_closestPointTo *)o; if (p->__pyx_v_othershape) { e = (*v)(p->__pyx_v_othershape, a); if (e) return e; } @@ -105191,9 +108409,9 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_15_closestPointTo(P return 0; } -static int __pyx_tp_clear_10collisions___pyx_scope_struct_15_closestPointTo(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_16_closestPointTo(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_16_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_16_closestPointTo *)o; tmp = ((PyObject*)p->__pyx_v_othershape); p->__pyx_v_othershape = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); @@ -105203,28 +108421,28 @@ static int __pyx_tp_clear_10collisions___pyx_scope_struct_15_closestPointTo(PyOb return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_15_closestPointTo_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_15_closestPointTo}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_15_closestPointTo}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_15_closestPointTo}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_15_closestPointTo}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_16_closestPointTo_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_16_closestPointTo}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_16_closestPointTo}, + {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_16_closestPointTo}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_16_closestPointTo}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_15_closestPointTo_spec = { - "collisions.__pyx_scope_struct_15_closestPointTo", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_16_closestPointTo_spec = { + "collisions.__pyx_scope_struct_16_closestPointTo", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_16_closestPointTo), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_15_closestPointTo_slots, + __pyx_type_10collisions___pyx_scope_struct_16_closestPointTo_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_15_closestPointTo = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_16_closestPointTo = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_15_closestPointTo", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_15_closestPointTo), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_16_closestPointTo", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_16_closestPointTo), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_15_closestPointTo, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_16_closestPointTo, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -105251,8 +108469,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_15_closestPointTo 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_15_closestPointTo, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_15_closestPointTo, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_16_closestPointTo, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_16_closestPointTo, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -105269,7 +108487,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_15_closestPointTo #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_15_closestPointTo, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_16_closestPointTo, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -105305,20 +108523,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_15_closestPointTo #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_16_tangent *__pyx_freelist_10collisions___pyx_scope_struct_16_tangent[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_16_tangent = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_17_tangent *__pyx_freelist_10collisions___pyx_scope_struct_17_tangent[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_17_tangent = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_16_tangent(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_17_tangent(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_16_tangent > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_16_tangent)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_16_tangent[--__pyx_freecount_10collisions___pyx_scope_struct_16_tangent]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_16_tangent)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_17_tangent > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_17_tangent)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_17_tangent[--__pyx_freecount_10collisions___pyx_scope_struct_17_tangent]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_17_tangent)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -105331,11 +108549,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_16_tangent(PyTypeO return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_16_tangent(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_16_tangent *p = (struct __pyx_obj_10collisions___pyx_scope_struct_16_tangent *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_17_tangent(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_17_tangent *p = (struct __pyx_obj_10collisions___pyx_scope_struct_17_tangent *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_16_tangent) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_17_tangent) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -105343,8 +108561,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_16_tangent(PyObject PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_point); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_16_tangent < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_16_tangent)))) { - __pyx_freelist_10collisions___pyx_scope_struct_16_tangent[__pyx_freecount_10collisions___pyx_scope_struct_16_tangent++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_16_tangent *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_17_tangent < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_17_tangent)))) { + __pyx_freelist_10collisions___pyx_scope_struct_17_tangent[__pyx_freecount_10collisions___pyx_scope_struct_17_tangent++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_17_tangent *)o); } else #endif { @@ -105359,46 +108577,46 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_16_tangent(PyObject } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_16_tangent(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_17_tangent(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_16_tangent *p = (struct __pyx_obj_10collisions___pyx_scope_struct_16_tangent *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_17_tangent *p = (struct __pyx_obj_10collisions___pyx_scope_struct_17_tangent *)o; if (p->__pyx_v_point) { e = (*v)(p->__pyx_v_point, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_10collisions___pyx_scope_struct_16_tangent(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_17_tangent(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_16_tangent *p = (struct __pyx_obj_10collisions___pyx_scope_struct_16_tangent *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_17_tangent *p = (struct __pyx_obj_10collisions___pyx_scope_struct_17_tangent *)o; tmp = ((PyObject*)p->__pyx_v_point); p->__pyx_v_point = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_16_tangent_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_16_tangent}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_16_tangent}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_16_tangent}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_16_tangent}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_17_tangent_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_17_tangent}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_17_tangent}, + {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_17_tangent}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_17_tangent}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_16_tangent_spec = { - "collisions.__pyx_scope_struct_16_tangent", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_16_tangent), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_17_tangent_spec = { + "collisions.__pyx_scope_struct_17_tangent", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_17_tangent), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_16_tangent_slots, + __pyx_type_10collisions___pyx_scope_struct_17_tangent_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_16_tangent = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_17_tangent = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_16_tangent", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_16_tangent), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_17_tangent", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_17_tangent), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_16_tangent, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_17_tangent, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -105425,8 +108643,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_16_tangent = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_16_tangent, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_16_tangent, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_17_tangent, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_17_tangent, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -105443,7 +108661,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_16_tangent = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_16_tangent, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_17_tangent, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -105479,20 +108697,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_16_tangent = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo *__pyx_freelist_10collisions___pyx_scope_struct_17_closestPointTo[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_17_closestPointTo = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_18_closestPointTo *__pyx_freelist_10collisions___pyx_scope_struct_18_closestPointTo[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_18_closestPointTo = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_17_closestPointTo(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_18_closestPointTo(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_17_closestPointTo > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_17_closestPointTo[--__pyx_freecount_10collisions___pyx_scope_struct_17_closestPointTo]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_18_closestPointTo > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_18_closestPointTo)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_18_closestPointTo[--__pyx_freecount_10collisions___pyx_scope_struct_18_closestPointTo]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_18_closestPointTo)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -105505,11 +108723,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_17_closestPointTo( return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_17_closestPointTo(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_18_closestPointTo(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_18_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_18_closestPointTo *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_17_closestPointTo) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_18_closestPointTo) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -105518,8 +108736,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_17_closestPointTo(P Py_CLEAR(p->__pyx_v_othershape); Py_CLEAR(p->__pyx_v_self); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_17_closestPointTo < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo)))) { - __pyx_freelist_10collisions___pyx_scope_struct_17_closestPointTo[__pyx_freecount_10collisions___pyx_scope_struct_17_closestPointTo++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_18_closestPointTo < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_18_closestPointTo)))) { + __pyx_freelist_10collisions___pyx_scope_struct_18_closestPointTo[__pyx_freecount_10collisions___pyx_scope_struct_18_closestPointTo++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_18_closestPointTo *)o); } else #endif { @@ -105534,9 +108752,9 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_17_closestPointTo(P } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_17_closestPointTo(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_18_closestPointTo(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_18_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_18_closestPointTo *)o; if (p->__pyx_v_othershape) { e = (*v)(p->__pyx_v_othershape, a); if (e) return e; } @@ -105546,9 +108764,9 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_17_closestPointTo(P return 0; } -static int __pyx_tp_clear_10collisions___pyx_scope_struct_17_closestPointTo(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_18_closestPointTo(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_18_closestPointTo *p = (struct __pyx_obj_10collisions___pyx_scope_struct_18_closestPointTo *)o; tmp = ((PyObject*)p->__pyx_v_othershape); p->__pyx_v_othershape = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); @@ -105558,28 +108776,28 @@ static int __pyx_tp_clear_10collisions___pyx_scope_struct_17_closestPointTo(PyOb return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_17_closestPointTo_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_17_closestPointTo}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_17_closestPointTo}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_17_closestPointTo}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_17_closestPointTo}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_18_closestPointTo_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_18_closestPointTo}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_18_closestPointTo}, + {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_18_closestPointTo}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_18_closestPointTo}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_17_closestPointTo_spec = { - "collisions.__pyx_scope_struct_17_closestPointTo", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_18_closestPointTo_spec = { + "collisions.__pyx_scope_struct_18_closestPointTo", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_18_closestPointTo), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_17_closestPointTo_slots, + __pyx_type_10collisions___pyx_scope_struct_18_closestPointTo_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_17_closestPointTo = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_18_closestPointTo = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_17_closestPointTo", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_17_closestPointTo), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_18_closestPointTo", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_18_closestPointTo), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_17_closestPointTo, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_18_closestPointTo, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -105606,8 +108824,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_17_closestPointTo 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_17_closestPointTo, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_17_closestPointTo, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_18_closestPointTo, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_18_closestPointTo, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -105624,7 +108842,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_17_closestPointTo #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_17_closestPointTo, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_18_closestPointTo, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -105660,20 +108878,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_17_closestPointTo #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_18__contains *__pyx_freelist_10collisions___pyx_scope_struct_18__contains[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_18__contains = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_19__contains *__pyx_freelist_10collisions___pyx_scope_struct_19__contains[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_19__contains = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_18__contains(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_19__contains(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_18__contains > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_18__contains)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_18__contains[--__pyx_freecount_10collisions___pyx_scope_struct_18__contains]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_18__contains)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_19__contains > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_19__contains)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_19__contains[--__pyx_freecount_10collisions___pyx_scope_struct_19__contains]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_19__contains)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -105686,11 +108904,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_18__contains(PyTyp return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_18__contains(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_18__contains *p = (struct __pyx_obj_10collisions___pyx_scope_struct_18__contains *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_19__contains(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_19__contains *p = (struct __pyx_obj_10collisions___pyx_scope_struct_19__contains *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_18__contains) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_19__contains) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -105698,8 +108916,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_18__contains(PyObje PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_self); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_18__contains < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_18__contains)))) { - __pyx_freelist_10collisions___pyx_scope_struct_18__contains[__pyx_freecount_10collisions___pyx_scope_struct_18__contains++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_18__contains *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_19__contains < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_19__contains)))) { + __pyx_freelist_10collisions___pyx_scope_struct_19__contains[__pyx_freecount_10collisions___pyx_scope_struct_19__contains++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_19__contains *)o); } else #endif { @@ -105714,46 +108932,46 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_18__contains(PyObje } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_18__contains(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_19__contains(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_18__contains *p = (struct __pyx_obj_10collisions___pyx_scope_struct_18__contains *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_19__contains *p = (struct __pyx_obj_10collisions___pyx_scope_struct_19__contains *)o; if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_10collisions___pyx_scope_struct_18__contains(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_19__contains(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_18__contains *p = (struct __pyx_obj_10collisions___pyx_scope_struct_18__contains *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_19__contains *p = (struct __pyx_obj_10collisions___pyx_scope_struct_19__contains *)o; tmp = ((PyObject*)p->__pyx_v_self); p->__pyx_v_self = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_18__contains_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_18__contains}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_18__contains}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_18__contains}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_18__contains}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_19__contains_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_19__contains}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_19__contains}, + {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_19__contains}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_19__contains}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_18__contains_spec = { - "collisions.__pyx_scope_struct_18__contains", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_18__contains), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_19__contains_spec = { + "collisions.__pyx_scope_struct_19__contains", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_19__contains), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_18__contains_slots, + __pyx_type_10collisions___pyx_scope_struct_19__contains_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_18__contains = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_19__contains = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_18__contains", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_18__contains), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_19__contains", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_19__contains), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_18__contains, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_19__contains, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -105780,8 +108998,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_18__contains = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_18__contains, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_18__contains, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_19__contains, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_19__contains, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -105798,7 +109016,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_18__contains = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_18__contains, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_19__contains, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -105834,20 +109052,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_18__contains = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_19_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_19_genexpr[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_19_genexpr = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_20_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_20_genexpr[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_20_genexpr = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_19_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_20_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_19_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_19_genexpr)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_19_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_19_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_19_genexpr)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_20_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_20_genexpr)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_20_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_20_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_20_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -105860,11 +109078,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_19_genexpr(PyTypeO return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_19_genexpr(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_19_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_19_genexpr *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_20_genexpr(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_20_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_20_genexpr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_19_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_20_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -105874,8 +109092,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_19_genexpr(PyObject Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_p); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_19_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_19_genexpr)))) { - __pyx_freelist_10collisions___pyx_scope_struct_19_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_19_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_19_genexpr *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_20_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_20_genexpr)))) { + __pyx_freelist_10collisions___pyx_scope_struct_20_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_20_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_20_genexpr *)o); } else #endif { @@ -105890,9 +109108,9 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_19_genexpr(PyObject } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_19_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_20_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_19_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_19_genexpr *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_20_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_20_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } @@ -105905,27 +109123,27 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_19_genexpr(PyObject return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_19_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_19_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_19_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_19_genexpr}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_20_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_20_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_20_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_20_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_19_genexpr_spec = { - "collisions.__pyx_scope_struct_19_genexpr", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_19_genexpr), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_20_genexpr_spec = { + "collisions.__pyx_scope_struct_20_genexpr", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_20_genexpr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_19_genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_20_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_19_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_20_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_19_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_19_genexpr), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_20_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_20_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_19_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_20_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -105952,7 +109170,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_19_genexpr = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_19_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_20_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -105970,7 +109188,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_19_genexpr = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_19_genexpr, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_20_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -106006,20 +109224,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_19_genexpr = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_20__collides *__pyx_freelist_10collisions___pyx_scope_struct_20__collides[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_20__collides = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_21__collides *__pyx_freelist_10collisions___pyx_scope_struct_21__collides[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_21__collides = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_20__collides(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_21__collides(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_20__collides > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_20__collides)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_20__collides[--__pyx_freecount_10collisions___pyx_scope_struct_20__collides]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_20__collides)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_21__collides > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_21__collides)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_21__collides[--__pyx_freecount_10collisions___pyx_scope_struct_21__collides]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_21__collides)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -106032,11 +109250,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_20__collides(PyTyp return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_20__collides(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_20__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_20__collides *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_21__collides(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_21__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_21__collides *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_20__collides) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_21__collides) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -106044,8 +109262,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_20__collides(PyObje PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_self); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_20__collides < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_20__collides)))) { - __pyx_freelist_10collisions___pyx_scope_struct_20__collides[__pyx_freecount_10collisions___pyx_scope_struct_20__collides++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_20__collides *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_21__collides < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_21__collides)))) { + __pyx_freelist_10collisions___pyx_scope_struct_21__collides[__pyx_freecount_10collisions___pyx_scope_struct_21__collides++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_21__collides *)o); } else #endif { @@ -106060,46 +109278,46 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_20__collides(PyObje } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_20__collides(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_21__collides(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_20__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_20__collides *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_21__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_21__collides *)o; if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_10collisions___pyx_scope_struct_20__collides(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_21__collides(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_20__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_20__collides *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_21__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_21__collides *)o; tmp = ((PyObject*)p->__pyx_v_self); p->__pyx_v_self = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_20__collides_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_20__collides}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_20__collides}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_20__collides}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_20__collides}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_21__collides_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_21__collides}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_21__collides}, + {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_21__collides}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_21__collides}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_20__collides_spec = { - "collisions.__pyx_scope_struct_20__collides", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_20__collides), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_21__collides_spec = { + "collisions.__pyx_scope_struct_21__collides", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_21__collides), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_20__collides_slots, + __pyx_type_10collisions___pyx_scope_struct_21__collides_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_20__collides = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_21__collides = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_20__collides", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_20__collides), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_21__collides", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_21__collides), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_20__collides, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_21__collides, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -106126,8 +109344,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_20__collides = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_20__collides, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_20__collides, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_21__collides, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_21__collides, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -106144,7 +109362,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_20__collides = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_20__collides, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_21__collides, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -106180,20 +109398,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_20__collides = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_21_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_21_genexpr[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_21_genexpr = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_22_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_22_genexpr[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_22_genexpr = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_21_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_22_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_21_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_21_genexpr)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_21_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_21_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_21_genexpr)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_22_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_22_genexpr)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_22_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_22_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_22_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -106206,11 +109424,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_21_genexpr(PyTypeO return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_21_genexpr(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_21_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_21_genexpr *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_22_genexpr(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_22_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_22_genexpr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_21_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_22_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -106220,8 +109438,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_21_genexpr(PyObject Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_i); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_21_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_21_genexpr)))) { - __pyx_freelist_10collisions___pyx_scope_struct_21_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_21_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_21_genexpr *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_22_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_22_genexpr)))) { + __pyx_freelist_10collisions___pyx_scope_struct_22_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_22_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_22_genexpr *)o); } else #endif { @@ -106236,9 +109454,9 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_21_genexpr(PyObject } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_21_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_22_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_21_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_21_genexpr *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_22_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_22_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } @@ -106251,27 +109469,27 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_21_genexpr(PyObject return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_21_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_21_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_21_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_21_genexpr}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_22_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_22_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_22_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_22_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_21_genexpr_spec = { - "collisions.__pyx_scope_struct_21_genexpr", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_21_genexpr), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_22_genexpr_spec = { + "collisions.__pyx_scope_struct_22_genexpr", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_22_genexpr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_21_genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_22_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_21_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_22_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_21_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_21_genexpr), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_22_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_22_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_21_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_22_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -106298,7 +109516,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_21_genexpr = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_21_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_22_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -106316,7 +109534,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_21_genexpr = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_21_genexpr, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_22_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -106352,20 +109570,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_21_genexpr = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache *__pyx_freelist_10collisions___pyx_scope_struct_22_getCache[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_22_getCache = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_23_getCache *__pyx_freelist_10collisions___pyx_scope_struct_23_getCache[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_23_getCache = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_22_getCache(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_23_getCache(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_22_getCache > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_22_getCache[--__pyx_freecount_10collisions___pyx_scope_struct_22_getCache]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_23_getCache > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_23_getCache)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_23_getCache[--__pyx_freecount_10collisions___pyx_scope_struct_23_getCache]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_23_getCache)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -106378,11 +109596,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_22_getCache(PyType return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_22_getCache(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache *p = (struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_23_getCache(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_23_getCache *p = (struct __pyx_obj_10collisions___pyx_scope_struct_23_getCache *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_22_getCache) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_23_getCache) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -106391,8 +109609,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_22_getCache(PyObjec Py_CLEAR(p->__pyx_v_cos); Py_CLEAR(p->__pyx_v_sin); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_22_getCache < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache)))) { - __pyx_freelist_10collisions___pyx_scope_struct_22_getCache[__pyx_freecount_10collisions___pyx_scope_struct_22_getCache++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_23_getCache < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_23_getCache)))) { + __pyx_freelist_10collisions___pyx_scope_struct_23_getCache[__pyx_freecount_10collisions___pyx_scope_struct_23_getCache++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_23_getCache *)o); } else #endif { @@ -106407,9 +109625,9 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_22_getCache(PyObjec } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_22_getCache(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_23_getCache(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache *p = (struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_23_getCache *p = (struct __pyx_obj_10collisions___pyx_scope_struct_23_getCache *)o; if (p->__pyx_v_cos) { e = (*v)(p->__pyx_v_cos, a); if (e) return e; } @@ -106419,9 +109637,9 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_22_getCache(PyObjec return 0; } -static int __pyx_tp_clear_10collisions___pyx_scope_struct_22_getCache(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_23_getCache(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache *p = (struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_23_getCache *p = (struct __pyx_obj_10collisions___pyx_scope_struct_23_getCache *)o; tmp = ((PyObject*)p->__pyx_v_cos); p->__pyx_v_cos = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); @@ -106431,28 +109649,28 @@ static int __pyx_tp_clear_10collisions___pyx_scope_struct_22_getCache(PyObject * return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_22_getCache_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_22_getCache}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_22_getCache}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_22_getCache}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_22_getCache}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_23_getCache_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_23_getCache}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_23_getCache}, + {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_23_getCache}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_23_getCache}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_22_getCache_spec = { - "collisions.__pyx_scope_struct_22_getCache", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_23_getCache_spec = { + "collisions.__pyx_scope_struct_23_getCache", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_23_getCache), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_22_getCache_slots, + __pyx_type_10collisions___pyx_scope_struct_23_getCache_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_22_getCache = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_23_getCache = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_22_getCache", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_22_getCache), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_23_getCache", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_23_getCache), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_22_getCache, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_23_getCache, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -106479,8 +109697,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_22_getCache = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_22_getCache, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_22_getCache, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_23_getCache, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_23_getCache, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -106497,7 +109715,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_22_getCache = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_22_getCache, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_23_getCache, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -106533,20 +109751,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_22_getCache = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_23__collides *__pyx_freelist_10collisions___pyx_scope_struct_23__collides[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_23__collides = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_24__collides *__pyx_freelist_10collisions___pyx_scope_struct_24__collides[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_24__collides = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_23__collides(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_24__collides(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_23__collides > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_23__collides)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_23__collides[--__pyx_freecount_10collisions___pyx_scope_struct_23__collides]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_23__collides)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_24__collides > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_24__collides)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_24__collides[--__pyx_freecount_10collisions___pyx_scope_struct_24__collides]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_24__collides)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -106559,11 +109777,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_23__collides(PyTyp return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_23__collides(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_23__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_23__collides *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_24__collides(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_24__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_24__collides *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_23__collides) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_24__collides) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -106571,8 +109789,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_23__collides(PyObje PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_self); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_23__collides < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_23__collides)))) { - __pyx_freelist_10collisions___pyx_scope_struct_23__collides[__pyx_freecount_10collisions___pyx_scope_struct_23__collides++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_23__collides *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_24__collides < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_24__collides)))) { + __pyx_freelist_10collisions___pyx_scope_struct_24__collides[__pyx_freecount_10collisions___pyx_scope_struct_24__collides++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_24__collides *)o); } else #endif { @@ -106587,46 +109805,46 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_23__collides(PyObje } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_23__collides(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_24__collides(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_23__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_23__collides *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_24__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_24__collides *)o; if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_10collisions___pyx_scope_struct_23__collides(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_24__collides(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_23__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_23__collides *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_24__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_24__collides *)o; tmp = ((PyObject*)p->__pyx_v_self); p->__pyx_v_self = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_23__collides_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_23__collides}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_23__collides}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_23__collides}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_23__collides}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_24__collides_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_24__collides}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_24__collides}, + {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_24__collides}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_24__collides}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_23__collides_spec = { - "collisions.__pyx_scope_struct_23__collides", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_23__collides), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_24__collides_spec = { + "collisions.__pyx_scope_struct_24__collides", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_24__collides), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_23__collides_slots, + __pyx_type_10collisions___pyx_scope_struct_24__collides_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_23__collides = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_24__collides = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_23__collides", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_23__collides), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_24__collides", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_24__collides), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_23__collides, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_24__collides, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -106653,8 +109871,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_23__collides = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_23__collides, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_23__collides, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_24__collides, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_24__collides, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -106671,7 +109889,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_23__collides = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_23__collides, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_24__collides, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -106707,20 +109925,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_23__collides = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_24_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_24_genexpr[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_24_genexpr = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_25_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_25_genexpr[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_25_genexpr = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_24_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_25_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_24_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_24_genexpr)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_24_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_24_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_24_genexpr)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_25_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_25_genexpr)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_25_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_25_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_25_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -106733,11 +109951,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_24_genexpr(PyTypeO return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_24_genexpr(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_24_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_24_genexpr *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_25_genexpr(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_25_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_25_genexpr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_24_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_25_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -106747,8 +109965,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_24_genexpr(PyObject Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_i); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_24_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_24_genexpr)))) { - __pyx_freelist_10collisions___pyx_scope_struct_24_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_24_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_24_genexpr *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_25_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_25_genexpr)))) { + __pyx_freelist_10collisions___pyx_scope_struct_25_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_25_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_25_genexpr *)o); } else #endif { @@ -106763,9 +109981,9 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_24_genexpr(PyObject } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_24_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_25_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_24_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_24_genexpr *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_25_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_25_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } @@ -106778,27 +109996,27 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_24_genexpr(PyObject return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_24_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_24_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_24_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_24_genexpr}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_25_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_25_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_25_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_25_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_24_genexpr_spec = { - "collisions.__pyx_scope_struct_24_genexpr", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_24_genexpr), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_25_genexpr_spec = { + "collisions.__pyx_scope_struct_25_genexpr", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_25_genexpr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_24_genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_25_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_24_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_25_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_24_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_24_genexpr), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_25_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_25_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_24_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_25_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -106825,7 +110043,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_24_genexpr = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_24_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_25_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -106843,7 +110061,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_24_genexpr = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_24_genexpr, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_25_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -106879,20 +110097,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_24_genexpr = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__ *__pyx_freelist_10collisions___pyx_scope_struct_25___setitem__[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_25___setitem__ = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_26___setitem__ *__pyx_freelist_10collisions___pyx_scope_struct_26___setitem__[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_26___setitem__ = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_25___setitem__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_26___setitem__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_25___setitem__ > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_25___setitem__[--__pyx_freecount_10collisions___pyx_scope_struct_25___setitem__]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_26___setitem__ > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_26___setitem__)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_26___setitem__[--__pyx_freecount_10collisions___pyx_scope_struct_26___setitem__]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_26___setitem__)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -106905,11 +110123,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_25___setitem__(PyT return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_25___setitem__(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__ *p = (struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__ *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_26___setitem__(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_26___setitem__ *p = (struct __pyx_obj_10collisions___pyx_scope_struct_26___setitem__ *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_25___setitem__) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_26___setitem__) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -106917,8 +110135,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_25___setitem__(PyOb PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_self); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_25___setitem__ < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__)))) { - __pyx_freelist_10collisions___pyx_scope_struct_25___setitem__[__pyx_freecount_10collisions___pyx_scope_struct_25___setitem__++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__ *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_26___setitem__ < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_26___setitem__)))) { + __pyx_freelist_10collisions___pyx_scope_struct_26___setitem__[__pyx_freecount_10collisions___pyx_scope_struct_26___setitem__++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_26___setitem__ *)o); } else #endif { @@ -106933,46 +110151,46 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_25___setitem__(PyOb } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_25___setitem__(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_26___setitem__(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__ *p = (struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__ *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_26___setitem__ *p = (struct __pyx_obj_10collisions___pyx_scope_struct_26___setitem__ *)o; if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_10collisions___pyx_scope_struct_25___setitem__(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_26___setitem__(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__ *p = (struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__ *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_26___setitem__ *p = (struct __pyx_obj_10collisions___pyx_scope_struct_26___setitem__ *)o; tmp = ((PyObject*)p->__pyx_v_self); p->__pyx_v_self = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_25___setitem___slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_25___setitem__}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_25___setitem__}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_25___setitem__}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_25___setitem__}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_26___setitem___slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_26___setitem__}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_26___setitem__}, + {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_26___setitem__}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_26___setitem__}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_25___setitem___spec = { - "collisions.__pyx_scope_struct_25___setitem__", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_26___setitem___spec = { + "collisions.__pyx_scope_struct_26___setitem__", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_26___setitem__), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_25___setitem___slots, + __pyx_type_10collisions___pyx_scope_struct_26___setitem___slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_25___setitem__ = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_26___setitem__ = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_25___setitem__", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_25___setitem__), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_26___setitem__", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_26___setitem__), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_25___setitem__, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_26___setitem__, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -106999,8 +110217,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_25___setitem__ = 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_25___setitem__, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_25___setitem__, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_26___setitem__, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_26___setitem__, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -107017,7 +110235,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_25___setitem__ = #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_25___setitem__, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_26___setitem__, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -107053,20 +110271,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_25___setitem__ = #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_26_area *__pyx_freelist_10collisions___pyx_scope_struct_26_area[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_26_area = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_27_area *__pyx_freelist_10collisions___pyx_scope_struct_27_area[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_27_area = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_26_area(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_27_area(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_26_area > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_26_area)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_26_area[--__pyx_freecount_10collisions___pyx_scope_struct_26_area]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_26_area)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_27_area > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_27_area)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_27_area[--__pyx_freecount_10collisions___pyx_scope_struct_27_area]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_27_area)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -107079,11 +110297,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_26_area(PyTypeObje return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_26_area(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_26_area *p = (struct __pyx_obj_10collisions___pyx_scope_struct_26_area *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_27_area(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_27_area *p = (struct __pyx_obj_10collisions___pyx_scope_struct_27_area *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_26_area) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_27_area) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -107091,8 +110309,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_26_area(PyObject *o PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_self); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_26_area < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_26_area)))) { - __pyx_freelist_10collisions___pyx_scope_struct_26_area[__pyx_freecount_10collisions___pyx_scope_struct_26_area++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_26_area *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_27_area < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_27_area)))) { + __pyx_freelist_10collisions___pyx_scope_struct_27_area[__pyx_freecount_10collisions___pyx_scope_struct_27_area++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_27_area *)o); } else #endif { @@ -107107,46 +110325,46 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_26_area(PyObject *o } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_26_area(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_27_area(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_26_area *p = (struct __pyx_obj_10collisions___pyx_scope_struct_26_area *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_27_area *p = (struct __pyx_obj_10collisions___pyx_scope_struct_27_area *)o; if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_10collisions___pyx_scope_struct_26_area(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_27_area(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_26_area *p = (struct __pyx_obj_10collisions___pyx_scope_struct_26_area *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_27_area *p = (struct __pyx_obj_10collisions___pyx_scope_struct_27_area *)o; tmp = ((PyObject*)p->__pyx_v_self); p->__pyx_v_self = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_26_area_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_26_area}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_26_area}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_26_area}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_26_area}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_27_area_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_27_area}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_27_area}, + {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_27_area}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_27_area}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_26_area_spec = { - "collisions.__pyx_scope_struct_26_area", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_26_area), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_27_area_spec = { + "collisions.__pyx_scope_struct_27_area", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_27_area), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_26_area_slots, + __pyx_type_10collisions___pyx_scope_struct_27_area_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_26_area = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_27_area = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_26_area", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_26_area), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_27_area", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_27_area), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_26_area, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_27_area, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -107173,8 +110391,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_26_area = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_26_area, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_26_area, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_27_area, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_27_area, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -107191,7 +110409,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_26_area = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_26_area, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_27_area, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -107227,20 +110445,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_26_area = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_27_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_27_genexpr[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_27_genexpr = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_28_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_28_genexpr[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_28_genexpr = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_27_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_28_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_27_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_27_genexpr)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_27_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_27_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_27_genexpr)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_28_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_28_genexpr)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_28_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_28_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_28_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -107253,11 +110471,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_27_genexpr(PyTypeO return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_27_genexpr(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_27_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_27_genexpr *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_28_genexpr(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_28_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_28_genexpr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_27_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_28_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -107268,8 +110486,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_27_genexpr(PyObject Py_CLEAR(p->__pyx_v_i); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_27_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_27_genexpr)))) { - __pyx_freelist_10collisions___pyx_scope_struct_27_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_27_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_27_genexpr *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_28_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_28_genexpr)))) { + __pyx_freelist_10collisions___pyx_scope_struct_28_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_28_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_28_genexpr *)o); } else #endif { @@ -107284,9 +110502,9 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_27_genexpr(PyObject } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_27_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_28_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_27_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_27_genexpr *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_28_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_28_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } @@ -107302,27 +110520,27 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_27_genexpr(PyObject return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_27_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_27_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_27_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_27_genexpr}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_28_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_28_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_28_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_28_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_27_genexpr_spec = { - "collisions.__pyx_scope_struct_27_genexpr", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_27_genexpr), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_28_genexpr_spec = { + "collisions.__pyx_scope_struct_28_genexpr", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_28_genexpr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_27_genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_28_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_27_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_28_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_27_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_27_genexpr), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_28_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_28_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_27_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_28_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -107349,7 +110567,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_27_genexpr = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_27_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_28_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -107367,7 +110585,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_27_genexpr = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_27_genexpr, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_28_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -107403,20 +110621,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_27_genexpr = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_28__collides *__pyx_freelist_10collisions___pyx_scope_struct_28__collides[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_28__collides = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_29__collides *__pyx_freelist_10collisions___pyx_scope_struct_29__collides[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_29__collides = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_28__collides(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_29__collides(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_28__collides > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_28__collides)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_28__collides[--__pyx_freecount_10collisions___pyx_scope_struct_28__collides]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_28__collides)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_29__collides > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_29__collides)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_29__collides[--__pyx_freecount_10collisions___pyx_scope_struct_29__collides]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_29__collides)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -107429,11 +110647,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_28__collides(PyTyp return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_28__collides(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_28__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_28__collides *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_29__collides(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_29__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_29__collides *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_28__collides) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_29__collides) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -107441,8 +110659,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_28__collides(PyObje PyObject_GC_UnTrack(o); Py_CLEAR(p->__pyx_v_self); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_28__collides < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_28__collides)))) { - __pyx_freelist_10collisions___pyx_scope_struct_28__collides[__pyx_freecount_10collisions___pyx_scope_struct_28__collides++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_28__collides *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_29__collides < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_29__collides)))) { + __pyx_freelist_10collisions___pyx_scope_struct_29__collides[__pyx_freecount_10collisions___pyx_scope_struct_29__collides++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_29__collides *)o); } else #endif { @@ -107457,46 +110675,46 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_28__collides(PyObje } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_28__collides(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_29__collides(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_28__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_28__collides *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_29__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_29__collides *)o; if (p->__pyx_v_self) { e = (*v)(p->__pyx_v_self, a); if (e) return e; } return 0; } -static int __pyx_tp_clear_10collisions___pyx_scope_struct_28__collides(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_29__collides(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_28__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_28__collides *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_29__collides *p = (struct __pyx_obj_10collisions___pyx_scope_struct_29__collides *)o; tmp = ((PyObject*)p->__pyx_v_self); p->__pyx_v_self = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_28__collides_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_28__collides}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_28__collides}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_28__collides}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_28__collides}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_29__collides_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_29__collides}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_29__collides}, + {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_29__collides}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_29__collides}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_28__collides_spec = { - "collisions.__pyx_scope_struct_28__collides", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_28__collides), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_29__collides_spec = { + "collisions.__pyx_scope_struct_29__collides", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_29__collides), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_28__collides_slots, + __pyx_type_10collisions___pyx_scope_struct_29__collides_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_28__collides = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_29__collides = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_28__collides", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_28__collides), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_29__collides", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_29__collides), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_28__collides, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_29__collides, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -107523,8 +110741,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_28__collides = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_28__collides, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_28__collides, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_29__collides, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_29__collides, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -107541,7 +110759,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_28__collides = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_28__collides, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_29__collides, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -107577,20 +110795,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_28__collides = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_29_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_29_genexpr[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_29_genexpr = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_30_genexpr[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_30_genexpr = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_29_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_30_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_29_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_29_genexpr)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_29_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_29_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_29_genexpr)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_30_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_30_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_30_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -107603,11 +110821,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_29_genexpr(PyTypeO return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_29_genexpr(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_29_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_29_genexpr *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_30_genexpr(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_29_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_30_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -107617,8 +110835,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_29_genexpr(PyObject Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_i); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_29_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_29_genexpr)))) { - __pyx_freelist_10collisions___pyx_scope_struct_29_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_29_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_29_genexpr *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_30_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr)))) { + __pyx_freelist_10collisions___pyx_scope_struct_30_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_30_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr *)o); } else #endif { @@ -107633,9 +110851,9 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_29_genexpr(PyObject } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_29_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_30_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_29_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_29_genexpr *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } @@ -107648,27 +110866,27 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_29_genexpr(PyObject return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_29_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_29_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_29_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_29_genexpr}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_30_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_30_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_30_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_30_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_29_genexpr_spec = { - "collisions.__pyx_scope_struct_29_genexpr", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_29_genexpr), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_30_genexpr_spec = { + "collisions.__pyx_scope_struct_30_genexpr", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_29_genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_30_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_29_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_30_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_29_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_29_genexpr), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_30_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_29_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_30_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -107695,7 +110913,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_29_genexpr = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_29_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_30_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -107713,7 +110931,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_29_genexpr = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_29_genexpr, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_30_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -107749,20 +110967,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_29_genexpr = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_30_genexpr[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_30_genexpr = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_31_genexpr[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_31_genexpr = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_30_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_31_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_30_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_30_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_30_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_31_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_31_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_31_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -107775,11 +110993,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_30_genexpr(PyTypeO return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_30_genexpr(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_31_genexpr(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_30_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_31_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -107789,8 +111007,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_30_genexpr(PyObject Py_CLEAR(p->__pyx_v_i); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_30_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr)))) { - __pyx_freelist_10collisions___pyx_scope_struct_30_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_30_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_31_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr)))) { + __pyx_freelist_10collisions___pyx_scope_struct_31_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_31_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr *)o); } else #endif { @@ -107805,9 +111023,9 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_30_genexpr(PyObject } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_30_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_31_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr *)o; if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } @@ -107820,27 +111038,27 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_30_genexpr(PyObject return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_30_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_30_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_30_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_30_genexpr}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_31_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_31_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_31_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_31_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_30_genexpr_spec = { - "collisions.__pyx_scope_struct_30_genexpr", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_31_genexpr_spec = { + "collisions.__pyx_scope_struct_31_genexpr", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_30_genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_31_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_30_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_31_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_30_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_30_genexpr), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_31_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_30_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_31_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -107867,7 +111085,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_30_genexpr = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_30_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_31_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -107885,7 +111103,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_30_genexpr = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_30_genexpr, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_31_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -107921,20 +111139,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_30_genexpr = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_31_genexpr[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_31_genexpr = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_32_genexpr[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_32_genexpr = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_31_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_32_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_31_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_31_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_31_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_32_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_32_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_32_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -107947,11 +111165,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_31_genexpr(PyTypeO return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_31_genexpr(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_32_genexpr(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_31_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_32_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -107961,8 +111179,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_31_genexpr(PyObject Py_CLEAR(p->__pyx_v_i); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_31_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr)))) { - __pyx_freelist_10collisions___pyx_scope_struct_31_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_31_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_32_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr)))) { + __pyx_freelist_10collisions___pyx_scope_struct_32_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_32_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr *)o); } else #endif { @@ -107977,9 +111195,9 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_31_genexpr(PyObject } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_31_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_32_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr *)o; if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } @@ -107992,27 +111210,27 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_31_genexpr(PyObject return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_31_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_31_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_31_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_31_genexpr}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_32_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_32_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_32_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_32_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_31_genexpr_spec = { - "collisions.__pyx_scope_struct_31_genexpr", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_32_genexpr_spec = { + "collisions.__pyx_scope_struct_32_genexpr", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_31_genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_32_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_31_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_32_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_31_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_31_genexpr), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_32_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_31_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_32_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -108039,7 +111257,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_31_genexpr = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_31_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_32_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -108057,7 +111275,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_31_genexpr = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_31_genexpr, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_32_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -108093,20 +111311,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_31_genexpr = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_32_genexpr[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_32_genexpr = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_33_genexpr[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_33_genexpr = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_32_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_33_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_32_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_32_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_32_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_33_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_33_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_33_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -108119,11 +111337,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_32_genexpr(PyTypeO return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_32_genexpr(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_33_genexpr(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_32_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_33_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -108133,8 +111351,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_32_genexpr(PyObject Py_CLEAR(p->__pyx_v_i); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_32_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr)))) { - __pyx_freelist_10collisions___pyx_scope_struct_32_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_32_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_33_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr)))) { + __pyx_freelist_10collisions___pyx_scope_struct_33_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_33_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr *)o); } else #endif { @@ -108149,9 +111367,9 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_32_genexpr(PyObject } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_32_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_33_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr *)o; if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } @@ -108164,27 +111382,27 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_32_genexpr(PyObject return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_32_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_32_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_32_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_32_genexpr}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_33_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_33_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_33_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_33_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_32_genexpr_spec = { - "collisions.__pyx_scope_struct_32_genexpr", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_33_genexpr_spec = { + "collisions.__pyx_scope_struct_33_genexpr", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_32_genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_33_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_32_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_33_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_32_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_32_genexpr), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_33_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_32_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_33_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -108211,7 +111429,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_32_genexpr = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_32_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_33_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -108229,7 +111447,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_32_genexpr = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_32_genexpr, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_33_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -108265,20 +111483,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_32_genexpr = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_33_genexpr[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_33_genexpr = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_34_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_34_genexpr[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_34_genexpr = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_33_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_34_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_33_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_33_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_33_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_34_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_34_genexpr)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_34_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_34_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_34_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -108291,11 +111509,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_33_genexpr(PyTypeO return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_33_genexpr(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_34_genexpr(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_34_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_34_genexpr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_33_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_34_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -108305,8 +111523,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_33_genexpr(PyObject Py_CLEAR(p->__pyx_v_i); Py_CLEAR(p->__pyx_t_0); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_33_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr)))) { - __pyx_freelist_10collisions___pyx_scope_struct_33_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_33_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_34_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_34_genexpr)))) { + __pyx_freelist_10collisions___pyx_scope_struct_34_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_34_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_34_genexpr *)o); } else #endif { @@ -108321,9 +111539,9 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_33_genexpr(PyObject } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_33_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_34_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_34_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_34_genexpr *)o; if (p->__pyx_genexpr_arg_0) { e = (*v)(p->__pyx_genexpr_arg_0, a); if (e) return e; } @@ -108336,27 +111554,27 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_33_genexpr(PyObject return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_33_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_33_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_33_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_33_genexpr}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_34_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_34_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_34_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_34_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_33_genexpr_spec = { - "collisions.__pyx_scope_struct_33_genexpr", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_34_genexpr_spec = { + "collisions.__pyx_scope_struct_34_genexpr", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_34_genexpr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_33_genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_34_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_33_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_34_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_33_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_33_genexpr), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_34_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_34_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_33_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_34_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -108383,7 +111601,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_33_genexpr = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_33_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_34_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -108401,7 +111619,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_33_genexpr = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_33_genexpr, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_34_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -108437,20 +111655,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_33_genexpr = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_34_union *__pyx_freelist_10collisions___pyx_scope_struct_34_union[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_34_union = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_35_union *__pyx_freelist_10collisions___pyx_scope_struct_35_union[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_35_union = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_34_union(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_35_union(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_34_union > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_34_union)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_34_union[--__pyx_freecount_10collisions___pyx_scope_struct_34_union]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_34_union)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_35_union > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_35_union)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_35_union[--__pyx_freecount_10collisions___pyx_scope_struct_35_union]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_35_union)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -108463,11 +111681,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_34_union(PyTypeObj return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_34_union(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_34_union *p = (struct __pyx_obj_10collisions___pyx_scope_struct_34_union *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_35_union(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_35_union *p = (struct __pyx_obj_10collisions___pyx_scope_struct_35_union *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_34_union) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_35_union) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -108477,8 +111695,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_34_union(PyObject * Py_CLEAR(p->__pyx_v_p1); Py_CLEAR(p->__pyx_v_s); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_34_union < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_34_union)))) { - __pyx_freelist_10collisions___pyx_scope_struct_34_union[__pyx_freecount_10collisions___pyx_scope_struct_34_union++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_34_union *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_35_union < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_35_union)))) { + __pyx_freelist_10collisions___pyx_scope_struct_35_union[__pyx_freecount_10collisions___pyx_scope_struct_35_union++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_35_union *)o); } else #endif { @@ -108493,9 +111711,9 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_34_union(PyObject * } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_34_union(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_35_union(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_34_union *p = (struct __pyx_obj_10collisions___pyx_scope_struct_34_union *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_35_union *p = (struct __pyx_obj_10collisions___pyx_scope_struct_35_union *)o; if (p->__pyx_9genexpr81__pyx_v_j) { e = (*v)(p->__pyx_9genexpr81__pyx_v_j, a); if (e) return e; } @@ -108508,9 +111726,9 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_34_union(PyObject * return 0; } -static int __pyx_tp_clear_10collisions___pyx_scope_struct_34_union(PyObject *o) { +static int __pyx_tp_clear_10collisions___pyx_scope_struct_35_union(PyObject *o) { PyObject* tmp; - struct __pyx_obj_10collisions___pyx_scope_struct_34_union *p = (struct __pyx_obj_10collisions___pyx_scope_struct_34_union *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_35_union *p = (struct __pyx_obj_10collisions___pyx_scope_struct_35_union *)o; tmp = ((PyObject*)p->__pyx_9genexpr81__pyx_v_j); p->__pyx_9genexpr81__pyx_v_j = Py_None; Py_INCREF(Py_None); Py_XDECREF(tmp); @@ -108523,28 +111741,28 @@ static int __pyx_tp_clear_10collisions___pyx_scope_struct_34_union(PyObject *o) return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_34_union_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_34_union}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_34_union}, - {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_34_union}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_34_union}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_35_union_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_35_union}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_35_union}, + {Py_tp_clear, (void *)__pyx_tp_clear_10collisions___pyx_scope_struct_35_union}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_35_union}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_34_union_spec = { - "collisions.__pyx_scope_struct_34_union", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_34_union), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_35_union_spec = { + "collisions.__pyx_scope_struct_35_union", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_35_union), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_34_union_slots, + __pyx_type_10collisions___pyx_scope_struct_35_union_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_34_union = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_35_union = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_34_union", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_34_union), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_35_union", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_35_union), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_34_union, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_35_union, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -108571,8 +111789,8 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_34_union = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_34_union, /*tp_traverse*/ - __pyx_tp_clear_10collisions___pyx_scope_struct_34_union, /*tp_clear*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_35_union, /*tp_traverse*/ + __pyx_tp_clear_10collisions___pyx_scope_struct_35_union, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -108589,7 +111807,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_34_union = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_34_union, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_35_union, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -108625,20 +111843,20 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_34_union = { #endif #if CYTHON_USE_FREELISTS -static struct __pyx_obj_10collisions___pyx_scope_struct_35_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_35_genexpr[8]; -static int __pyx_freecount_10collisions___pyx_scope_struct_35_genexpr = 0; +static struct __pyx_obj_10collisions___pyx_scope_struct_36_genexpr *__pyx_freelist_10collisions___pyx_scope_struct_36_genexpr[8]; +static int __pyx_freecount_10collisions___pyx_scope_struct_36_genexpr = 0; #endif -static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_35_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { +static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_36_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); o = alloc_func(t, 0); #else #if CYTHON_USE_FREELISTS - if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_35_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_35_genexpr)))) { - o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_35_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_35_genexpr]; - memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_35_genexpr)); + if (likely((int)(__pyx_freecount_10collisions___pyx_scope_struct_36_genexpr > 0) & (int)(t->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_36_genexpr)))) { + o = (PyObject*)__pyx_freelist_10collisions___pyx_scope_struct_36_genexpr[--__pyx_freecount_10collisions___pyx_scope_struct_36_genexpr]; + memset(o, 0, sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_36_genexpr)); (void) PyObject_INIT(o, t); PyObject_GC_Track(o); } else @@ -108651,11 +111869,11 @@ static PyObject *__pyx_tp_new_10collisions___pyx_scope_struct_35_genexpr(PyTypeO return o; } -static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_35_genexpr(PyObject *o) { - struct __pyx_obj_10collisions___pyx_scope_struct_35_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_35_genexpr *)o; +static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_36_genexpr(PyObject *o) { + struct __pyx_obj_10collisions___pyx_scope_struct_36_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_36_genexpr *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_35_genexpr) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_10collisions___pyx_scope_struct_36_genexpr) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -108665,8 +111883,8 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_35_genexpr(PyObject Py_CLEAR(p->__pyx_genexpr_arg_0); Py_CLEAR(p->__pyx_v_k); #if CYTHON_USE_FREELISTS - if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_35_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_35_genexpr)))) { - __pyx_freelist_10collisions___pyx_scope_struct_35_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_35_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_35_genexpr *)o); + if (((int)(__pyx_freecount_10collisions___pyx_scope_struct_36_genexpr < 8) & (int)(Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_36_genexpr)))) { + __pyx_freelist_10collisions___pyx_scope_struct_36_genexpr[__pyx_freecount_10collisions___pyx_scope_struct_36_genexpr++] = ((struct __pyx_obj_10collisions___pyx_scope_struct_36_genexpr *)o); } else #endif { @@ -108681,9 +111899,9 @@ static void __pyx_tp_dealloc_10collisions___pyx_scope_struct_35_genexpr(PyObject } } -static int __pyx_tp_traverse_10collisions___pyx_scope_struct_35_genexpr(PyObject *o, visitproc v, void *a) { +static int __pyx_tp_traverse_10collisions___pyx_scope_struct_36_genexpr(PyObject *o, visitproc v, void *a) { int e; - struct __pyx_obj_10collisions___pyx_scope_struct_35_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_35_genexpr *)o; + struct __pyx_obj_10collisions___pyx_scope_struct_36_genexpr *p = (struct __pyx_obj_10collisions___pyx_scope_struct_36_genexpr *)o; if (p->__pyx_outer_scope) { e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e; } @@ -108696,27 +111914,27 @@ static int __pyx_tp_traverse_10collisions___pyx_scope_struct_35_genexpr(PyObject return 0; } #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_35_genexpr_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_35_genexpr}, - {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_35_genexpr}, - {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_35_genexpr}, +static PyType_Slot __pyx_type_10collisions___pyx_scope_struct_36_genexpr_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_10collisions___pyx_scope_struct_36_genexpr}, + {Py_tp_traverse, (void *)__pyx_tp_traverse_10collisions___pyx_scope_struct_36_genexpr}, + {Py_tp_new, (void *)__pyx_tp_new_10collisions___pyx_scope_struct_36_genexpr}, {0, 0}, }; -static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_35_genexpr_spec = { - "collisions.__pyx_scope_struct_35_genexpr", - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_35_genexpr), +static PyType_Spec __pyx_type_10collisions___pyx_scope_struct_36_genexpr_spec = { + "collisions.__pyx_scope_struct_36_genexpr", + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_36_genexpr), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, - __pyx_type_10collisions___pyx_scope_struct_35_genexpr_slots, + __pyx_type_10collisions___pyx_scope_struct_36_genexpr_slots, }; #else -static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_35_genexpr = { +static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_36_genexpr = { PyVarObject_HEAD_INIT(0, 0) - "collisions.""__pyx_scope_struct_35_genexpr", /*tp_name*/ - sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_35_genexpr), /*tp_basicsize*/ + "collisions.""__pyx_scope_struct_36_genexpr", /*tp_name*/ + sizeof(struct __pyx_obj_10collisions___pyx_scope_struct_36_genexpr), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_10collisions___pyx_scope_struct_35_genexpr, /*tp_dealloc*/ + __pyx_tp_dealloc_10collisions___pyx_scope_struct_36_genexpr, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -108743,7 +111961,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_35_genexpr = { 0, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/ 0, /*tp_doc*/ - __pyx_tp_traverse_10collisions___pyx_scope_struct_35_genexpr, /*tp_traverse*/ + __pyx_tp_traverse_10collisions___pyx_scope_struct_36_genexpr, /*tp_traverse*/ 0, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ @@ -108761,7 +111979,7 @@ static PyTypeObject __pyx_type_10collisions___pyx_scope_struct_35_genexpr = { #endif 0, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_10collisions___pyx_scope_struct_35_genexpr, /*tp_new*/ + __pyx_tp_new_10collisions___pyx_scope_struct_36_genexpr, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -108857,8 +112075,6 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_BASEPRECISION, __pyx_k_BASEPRECISION, sizeof(__pyx_k_BASEPRECISION), 0, 0, 1, 1}, {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1}, {&__pyx_n_s_CLOSED, __pyx_k_CLOSED, sizeof(__pyx_k_CLOSED), 0, 0, 1, 1}, - {&__pyx_kp_u_Cannot_convert_BlazeSudio_shape, __pyx_k_Cannot_convert_BlazeSudio_shape, sizeof(__pyx_k_Cannot_convert_BlazeSudio_shape), 0, 1, 0, 0}, - {&__pyx_kp_u_Cannot_convert_shapely_shape_of, __pyx_k_Cannot_convert_shapely_shape_of, sizeof(__pyx_k_Cannot_convert_shapely_shape_of), 0, 1, 0, 0}, {&__pyx_kp_u_Cannot_draw_BlazeSudio_shape_of, __pyx_k_Cannot_draw_BlazeSudio_shape_of, sizeof(__pyx_k_Cannot_draw_BlazeSudio_shape_of), 0, 1, 0, 0}, {&__pyx_kp_u_Cannot_have_a_Polygon_with_less, __pyx_k_Cannot_have_a_Polygon_with_less, sizeof(__pyx_k_Cannot_have_a_Polygon_with_less), 0, 1, 0, 0}, {&__pyx_n_s_Circle, __pyx_k_Circle, sizeof(__pyx_k_Circle), 0, 0, 1, 1}, @@ -108879,8 +112095,10 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_Circle_closestPointTo, __pyx_k_Circle_closestPointTo, sizeof(__pyx_k_Circle_closestPointTo), 0, 0, 1, 1}, {&__pyx_n_s_Circle_closestPointTo_locals_lam, __pyx_k_Circle_closestPointTo_locals_lam, sizeof(__pyx_k_Circle_closestPointTo_locals_lam), 0, 0, 1, 1}, {&__pyx_n_s_Circle_copy, __pyx_k_Circle_copy, sizeof(__pyx_k_Circle_copy), 0, 0, 1, 1}, + {&__pyx_n_s_Circle_d, __pyx_k_Circle_d, sizeof(__pyx_k_Circle_d), 0, 0, 1, 1}, {&__pyx_n_s_Circle_handleCollisionsPos, __pyx_k_Circle_handleCollisionsPos, sizeof(__pyx_k_Circle_handleCollisionsPos), 0, 0, 1, 1}, {&__pyx_n_s_Circle_handleCollisionsPos_local, __pyx_k_Circle_handleCollisionsPos_local, sizeof(__pyx_k_Circle_handleCollisionsPos_local), 0, 0, 1, 1}, + {&__pyx_n_s_Circle_handleCollisionsPos_local_2, __pyx_k_Circle_handleCollisionsPos_local_2, sizeof(__pyx_k_Circle_handleCollisionsPos_local_2), 0, 0, 1, 1}, {&__pyx_n_s_Circle_handleCollisionsVel, __pyx_k_Circle_handleCollisionsVel, sizeof(__pyx_k_Circle_handleCollisionsVel), 0, 0, 1, 1}, {&__pyx_n_s_Circle_isCorner, __pyx_k_Circle_isCorner, sizeof(__pyx_k_Circle_isCorner), 0, 0, 1, 1}, {&__pyx_n_s_Circle_rect, __pyx_k_Circle_rect, sizeof(__pyx_k_Circle_rect), 0, 0, 1, 1}, @@ -108909,8 +112127,6 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_ClosedShape_toPoints, __pyx_k_ClosedShape_toPoints, sizeof(__pyx_k_ClosedShape_toPoints), 0, 0, 1, 1}, {&__pyx_kp_u_Closed_Shape, __pyx_k_Closed_Shape, sizeof(__pyx_k_Closed_Shape), 0, 1, 0, 0}, {&__pyx_n_s_D, __pyx_k_D, sizeof(__pyx_k_D), 0, 0, 1, 1}, - {&__pyx_n_s_Dict, __pyx_k_Dict, sizeof(__pyx_k_Dict), 0, 0, 1, 1}, - {&__pyx_kp_s_Dict_Union_Shape_Shapes_bool, __pyx_k_Dict_Union_Shape_Shapes_bool, sizeof(__pyx_k_Dict_Union_Shape_Shapes_bool), 0, 0, 1, 0}, {&__pyx_n_s_Dx, __pyx_k_Dx, sizeof(__pyx_k_Dx), 0, 0, 1, 1}, {&__pyx_n_s_Dy, __pyx_k_Dy, sizeof(__pyx_k_Dy), 0, 0, 1, 1}, {&__pyx_n_s_E, __pyx_k_E, sizeof(__pyx_k_E), 0, 0, 1, 1}, @@ -109058,6 +112274,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_RotatedRect_toLines, __pyx_k_RotatedRect_toLines, sizeof(__pyx_k_RotatedRect_toLines), 0, 0, 1, 1}, {&__pyx_n_s_RotatedRect_toPoints, __pyx_k_RotatedRect_toPoints, sizeof(__pyx_k_RotatedRect_toPoints), 0, 0, 1, 1}, {&__pyx_n_s_S, __pyx_k_S, sizeof(__pyx_k_S), 0, 0, 1, 1}, + {&__pyx_n_s_SPLITTABLE, __pyx_k_SPLITTABLE, sizeof(__pyx_k_SPLITTABLE), 0, 0, 1, 1}, {&__pyx_n_s_Shape, __pyx_k_Shape, sizeof(__pyx_k_Shape), 0, 0, 1, 1}, {&__pyx_n_u_Shape, __pyx_k_Shape, sizeof(__pyx_k_Shape), 0, 1, 0, 1}, {&__pyx_n_s_ShapeCombiner, __pyx_k_ShapeCombiner, sizeof(__pyx_k_ShapeCombiner), 0, 0, 1, 1}, @@ -109114,6 +112331,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_Shapes_area, __pyx_k_Shapes_area, sizeof(__pyx_k_Shapes_area), 0, 0, 1, 1}, {&__pyx_n_s_Shapes_area_locals_genexpr, __pyx_k_Shapes_area_locals_genexpr, sizeof(__pyx_k_Shapes_area_locals_genexpr), 0, 0, 1, 1}, {&__pyx_n_s_Shapes_closestPointTo, __pyx_k_Shapes_closestPointTo, sizeof(__pyx_k_Shapes_closestPointTo), 0, 0, 1, 1}, + {&__pyx_n_s_Shapes_closestPointTo_locals_sor, __pyx_k_Shapes_closestPointTo_locals_sor, sizeof(__pyx_k_Shapes_closestPointTo_locals_sor), 0, 0, 1, 1}, {&__pyx_n_s_Shapes_collides, __pyx_k_Shapes_collides, sizeof(__pyx_k_Shapes_collides), 0, 0, 1, 1}, {&__pyx_n_s_Shapes_copy, __pyx_k_Shapes_copy, sizeof(__pyx_k_Shapes_copy), 0, 0, 1, 1}, {&__pyx_n_s_Shapes_copy_leave_shapes, __pyx_k_Shapes_copy_leave_shapes, sizeof(__pyx_k_Shapes_copy_leave_shapes), 0, 0, 1, 1}, @@ -109125,6 +112343,8 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_Shapes_remove_shape, __pyx_k_Shapes_remove_shape, sizeof(__pyx_k_Shapes_remove_shape), 0, 0, 1, 1}, {&__pyx_n_s_Shapes_remove_shapes, __pyx_k_Shapes_remove_shapes, sizeof(__pyx_k_Shapes_remove_shapes), 0, 0, 1, 1}, {&__pyx_n_s_Shapes_tangent, __pyx_k_Shapes_tangent, sizeof(__pyx_k_Shapes_tangent), 0, 0, 1, 1}, + {&__pyx_n_s_Shapes_toLines, __pyx_k_Shapes_toLines, sizeof(__pyx_k_Shapes_toLines), 0, 0, 1, 1}, + {&__pyx_n_s_Shapes_toPoints, __pyx_k_Shapes_toPoints, sizeof(__pyx_k_Shapes_toPoints), 0, 0, 1, 1}, {&__pyx_n_s_Shapes_whereCollides, __pyx_k_Shapes_whereCollides, sizeof(__pyx_k_Shapes_whereCollides), 0, 0, 1, 1}, {&__pyx_kp_u_Shapes_with_shapes, __pyx_k_Shapes_with_shapes, sizeof(__pyx_k_Shapes_with_shapes), 0, 1, 0, 0}, {&__pyx_n_s_ShpGroups, __pyx_k_ShpGroups, sizeof(__pyx_k_ShpGroups), 0, 0, 1, 1}, @@ -109149,17 +112369,17 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_kp_s_Union_pointLike_Iterable_pointLi, __pyx_k_Union_pointLike_Iterable_pointLi, sizeof(__pyx_k_Union_pointLike_Iterable_pointLi), 0, 0, 1, 0}, {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, {&__pyx_n_s_W, __pyx_k_W, sizeof(__pyx_k_W), 0, 0, 1, 1}, - {&__pyx_n_s__147, __pyx_k__147, sizeof(__pyx_k__147), 0, 0, 1, 1}, - {&__pyx_kp_u__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 1, 0, 0}, - {&__pyx_kp_u__25, __pyx_k__25, sizeof(__pyx_k__25), 0, 1, 0, 0}, - {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0}, - {&__pyx_n_s__324, __pyx_k__324, sizeof(__pyx_k__324), 0, 0, 1, 1}, - {&__pyx_n_s__36, __pyx_k__36, sizeof(__pyx_k__36), 0, 0, 1, 1}, - {&__pyx_kp_u__37, __pyx_k__37, sizeof(__pyx_k__37), 0, 1, 0, 0}, - {&__pyx_kp_u__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0, 0}, + {&__pyx_n_s__156, __pyx_k__156, sizeof(__pyx_k__156), 0, 0, 1, 1}, + {&__pyx_kp_u__28, __pyx_k__28, sizeof(__pyx_k__28), 0, 1, 0, 0}, + {&__pyx_kp_u__29, __pyx_k__29, sizeof(__pyx_k__29), 0, 1, 0, 0}, + {&__pyx_n_s__337, __pyx_k__337, sizeof(__pyx_k__337), 0, 0, 1, 1}, + {&__pyx_n_s__40, __pyx_k__40, sizeof(__pyx_k__40), 0, 0, 1, 1}, + {&__pyx_kp_u__41, __pyx_k__41, sizeof(__pyx_k__41), 0, 1, 0, 0}, {&__pyx_kp_u__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 1, 0, 0}, {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0}, {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0}, + {&__pyx_kp_u__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0, 0}, + {&__pyx_kp_u__9, __pyx_k__9, sizeof(__pyx_k__9), 0, 1, 0, 0}, {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1}, {&__pyx_n_s_add_shape, __pyx_k_add_shape, sizeof(__pyx_k_add_shape), 0, 0, 1, 1}, {&__pyx_n_s_add_shapes, __pyx_k_add_shapes, sizeof(__pyx_k_add_shapes), 0, 0, 1, 1}, @@ -109210,6 +112430,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_closestP, __pyx_k_closestP, sizeof(__pyx_k_closestP), 0, 0, 1, 1}, {&__pyx_n_s_closestPointTo, __pyx_k_closestPointTo, sizeof(__pyx_k_closestPointTo), 0, 0, 1, 1}, {&__pyx_n_s_closests, __pyx_k_closests, sizeof(__pyx_k_closests), 0, 0, 1, 1}, + {&__pyx_n_s_collP, __pyx_k_collP, sizeof(__pyx_k_collP), 0, 0, 1, 1}, {&__pyx_n_s_collShape, __pyx_k_collShape, sizeof(__pyx_k_collShape), 0, 0, 1, 1}, {&__pyx_n_s_collToShapely, __pyx_k_collToShapely, sizeof(__pyx_k_collToShapely), 0, 0, 1, 1}, {&__pyx_n_u_collToShapely, __pyx_k_collToShapely, sizeof(__pyx_k_collToShapely), 0, 1, 0, 1}, @@ -109271,6 +112492,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_errorOnLT3, __pyx_k_errorOnLT3, sizeof(__pyx_k_errorOnLT3), 0, 0, 1, 1}, {&__pyx_n_s_extend, __pyx_k_extend, sizeof(__pyx_k_extend), 0, 0, 1, 1}, {&__pyx_n_s_exterior, __pyx_k_exterior, sizeof(__pyx_k_exterior), 0, 0, 1, 1}, + {&__pyx_n_s_factor, __pyx_k_factor, sizeof(__pyx_k_factor), 0, 0, 1, 1}, {&__pyx_n_s_fixangle, __pyx_k_fixangle, sizeof(__pyx_k_fixangle), 0, 0, 1, 1}, {&__pyx_n_s_flip, __pyx_k_flip, sizeof(__pyx_k_flip), 0, 0, 1, 1}, {&__pyx_n_s_float, __pyx_k_float, sizeof(__pyx_k_float), 0, 0, 1, 1}, @@ -109317,12 +112539,14 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_kp_s_lib_collisions_py, __pyx_k_lib_collisions_py, sizeof(__pyx_k_lib_collisions_py), 0, 0, 1, 0}, {&__pyx_n_s_line, __pyx_k_line, sizeof(__pyx_k_line), 0, 0, 1, 1}, {&__pyx_n_s_line_mag, __pyx_k_line_mag, sizeof(__pyx_k_line_mag), 0, 0, 1, 1}, + {&__pyx_n_s_lines, __pyx_k_lines, sizeof(__pyx_k_lines), 0, 0, 1, 1}, {&__pyx_kp_s_list_Point, __pyx_k_list_Point, sizeof(__pyx_k_list_Point), 0, 0, 1, 0}, {&__pyx_n_s_ln, __pyx_k_ln, sizeof(__pyx_k_ln), 0, 0, 1, 1}, {&__pyx_n_s_lns, __pyx_k_lns, sizeof(__pyx_k_lns), 0, 0, 1, 1}, {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_math, __pyx_k_math, sizeof(__pyx_k_math), 0, 0, 1, 1}, {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1}, + {&__pyx_n_s_maxTries, __pyx_k_maxTries, sizeof(__pyx_k_maxTries), 0, 0, 1, 1}, {&__pyx_n_s_maxs, __pyx_k_maxs, sizeof(__pyx_k_maxs), 0, 0, 1, 1}, {&__pyx_n_s_merged, __pyx_k_merged, sizeof(__pyx_k_merged), 0, 0, 1, 1}, {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, @@ -109336,6 +112560,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_mycp, __pyx_k_mycp, sizeof(__pyx_k_mycp), 0, 0, 1, 1}, {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, + {&__pyx_n_s_nd, __pyx_k_nd, sizeof(__pyx_k_nd), 0, 0, 1, 1}, {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1}, {&__pyx_n_s_newCir, __pyx_k_newCir, sizeof(__pyx_k_newCir), 0, 0, 1, 1}, {&__pyx_n_s_newLine, __pyx_k_newLine, sizeof(__pyx_k_newLine), 0, 0, 1, 1}, @@ -109348,6 +112573,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_newp2, __pyx_k_newp2, sizeof(__pyx_k_newp2), 0, 0, 1, 1}, {&__pyx_n_s_newpts, __pyx_k_newpts, sizeof(__pyx_k_newpts), 0, 0, 1, 1}, {&__pyx_n_s_normal, __pyx_k_normal, sizeof(__pyx_k_normal), 0, 0, 1, 1}, + {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, {&__pyx_n_s_o, __pyx_k_o, sizeof(__pyx_k_o), 0, 0, 1, 1}, {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1}, {&__pyx_n_s_objs, __pyx_k_objs, sizeof(__pyx_k_objs), 0, 0, 1, 1}, @@ -109466,6 +112692,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_smallness, __pyx_k_smallness, sizeof(__pyx_k_smallness), 0, 0, 1, 1}, {&__pyx_n_s_snd, __pyx_k_snd, sizeof(__pyx_k_snd), 0, 0, 1, 1}, {&__pyx_n_s_sort, __pyx_k_sort, sizeof(__pyx_k_sort), 0, 0, 1, 1}, + {&__pyx_n_s_sortFunc, __pyx_k_sortFunc, sizeof(__pyx_k_sortFunc), 0, 0, 1, 1}, {&__pyx_n_s_sorted, __pyx_k_sorted, sizeof(__pyx_k_sorted), 0, 0, 1, 1}, {&__pyx_n_s_sortedOtherLn, __pyx_k_sortedOtherLn, sizeof(__pyx_k_sortedOtherLn), 0, 0, 1, 1}, {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1}, @@ -109494,9 +112721,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_toLines, __pyx_k_toLines, sizeof(__pyx_k_toLines), 0, 0, 1, 1}, {&__pyx_n_s_toPoint, __pyx_k_toPoint, sizeof(__pyx_k_toPoint), 0, 0, 1, 1}, {&__pyx_n_s_toPoints, __pyx_k_toPoints, sizeof(__pyx_k_toPoints), 0, 0, 1, 1}, - {&__pyx_kp_u_to_BlazeSudio_Shape, __pyx_k_to_BlazeSudio_Shape, sizeof(__pyx_k_to_BlazeSudio_Shape), 0, 1, 0, 0}, {&__pyx_kp_u_to_have_points, __pyx_k_to_have_points, sizeof(__pyx_k_to_have_points), 0, 1, 0, 0}, - {&__pyx_kp_u_to_shapely_shape, __pyx_k_to_shapely_shape, sizeof(__pyx_k_to_shapely_shape), 0, 1, 0, 0}, {&__pyx_n_s_tries, __pyx_k_tries, sizeof(__pyx_k_tries), 0, 0, 1, 1}, {&__pyx_kp_s_tuple_Circle_pointLike_verboseOu, __pyx_k_tuple_Circle_pointLike_verboseOu, sizeof(__pyx_k_tuple_Circle_pointLike_verboseOu), 0, 0, 1, 0}, {&__pyx_kp_s_tuple_ClosedShape_pointLike_verb, __pyx_k_tuple_ClosedShape_pointLike_verb, sizeof(__pyx_k_tuple_ClosedShape_pointLike_verb), 0, 0, 1, 0}, @@ -109511,6 +112736,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 0, 1, 1}, {&__pyx_n_s_unary_union, __pyx_k_unary_union, sizeof(__pyx_k_unary_union), 0, 0, 1, 1}, {&__pyx_n_s_union, __pyx_k_union, sizeof(__pyx_k_union), 0, 0, 1, 1}, + {&__pyx_n_s_unstuckable, __pyx_k_unstuckable, sizeof(__pyx_k_unstuckable), 0, 0, 1, 1}, {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1}, {&__pyx_n_s_vel, __pyx_k_vel, sizeof(__pyx_k_vel), 0, 0, 1, 1}, {&__pyx_n_s_velDiff, __pyx_k_velDiff, sizeof(__pyx_k_velDiff), 0, 0, 1, 1}, @@ -109541,6 +112767,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_xj, __pyx_k_xj, sizeof(__pyx_k_xj), 0, 0, 1, 1}, {&__pyx_n_s_xk, __pyx_k_xk, sizeof(__pyx_k_xk), 0, 0, 1, 1}, {&__pyx_n_s_xpt, __pyx_k_xpt, sizeof(__pyx_k_xpt), 0, 0, 1, 1}, + {&__pyx_n_s_xs, __pyx_k_xs, sizeof(__pyx_k_xs), 0, 0, 1, 1}, {&__pyx_n_s_xy, __pyx_k_xy, sizeof(__pyx_k_xy), 0, 0, 1, 1}, {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1}, {&__pyx_n_s_y1, __pyx_k_y1, sizeof(__pyx_k_y1), 0, 0, 1, 1}, @@ -109555,6 +112782,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_yi, __pyx_k_yi, sizeof(__pyx_k_yi), 0, 0, 1, 1}, {&__pyx_n_s_yj, __pyx_k_yj, sizeof(__pyx_k_yj), 0, 0, 1, 1}, {&__pyx_n_s_yk, __pyx_k_yk, sizeof(__pyx_k_yk), 0, 0, 1, 1}, + {&__pyx_n_s_ys, __pyx_k_ys, sizeof(__pyx_k_ys), 0, 0, 1, 1}, {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} }; @@ -109563,19 +112791,19 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { /* #### Code section: cached_builtins ### */ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 8, __pyx_L1_error) - __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 941, __pyx_L1_error) - __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 963, __pyx_L1_error) - __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 183, __pyx_L1_error) - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 188, __pyx_L1_error) - __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 475, __pyx_L1_error) - __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 669, __pyx_L1_error) - __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_n_s_min); if (!__pyx_builtin_min) __PYX_ERR(0, 679, __pyx_L1_error) - __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) __PYX_ERR(0, 679, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 827, __pyx_L1_error) - __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 898, __pyx_L1_error) - __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_n_s_round); if (!__pyx_builtin_round) __PYX_ERR(0, 1141, __pyx_L1_error) - __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s_sorted); if (!__pyx_builtin_sorted) __PYX_ERR(0, 1201, __pyx_L1_error) - __pyx_builtin_any = __Pyx_GetBuiltinName(__pyx_n_s_any); if (!__pyx_builtin_any) __PYX_ERR(0, 2484, __pyx_L1_error) + __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 974, __pyx_L1_error) + __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 996, __pyx_L1_error) + __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 479, __pyx_L1_error) + __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s_sorted); if (!__pyx_builtin_sorted) __PYX_ERR(0, 613, __pyx_L1_error) + __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 702, __pyx_L1_error) + __pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_n_s_min); if (!__pyx_builtin_min) __PYX_ERR(0, 712, __pyx_L1_error) + __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) __PYX_ERR(0, 712, __pyx_L1_error) + __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 860, __pyx_L1_error) + __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 931, __pyx_L1_error) + __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_n_s_round); if (!__pyx_builtin_round) __PYX_ERR(0, 1174, __pyx_L1_error) + __pyx_builtin_any = __Pyx_GetBuiltinName(__pyx_n_s_any); if (!__pyx_builtin_any) __PYX_ERR(0, 2570, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -109597,184 +112825,208 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple_); __Pyx_GIVEREF(__pyx_tuple_); - /* "collisions.py":377 + /* "collisions.py":381 * """ * if returnAll: * return [(0, 0)] # <<<<<<<<<<<<<< * return (0, 0) * */ - __pyx_tuple__2 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 377, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "collisions.py":1011 + /* "collisions.py":610 + * for s in self.shapes: + * points.extend(s.closestPointTo(othershape, True)) + * def sortFunc(p): # <<<<<<<<<<<<<< + * op = othershape.closestPointTo(Point(*p), False) + * return math.hypot(p[0]-op[0], p[1]-op[1]) + */ + __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_s_p, __pyx_n_s_op); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 610, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); + __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_sortFunc, 610, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 610, __pyx_L1_error) + + /* "collisions.py":1044 * return False * # Calculate the direction of the lines * def direction(xi, yi, xj, yj, xk, yk): # <<<<<<<<<<<<<< * return (xk - xi) * (yj - yi) - (yk - yi) * (xj - xi) * */ - __pyx_tuple__8 = PyTuple_Pack(6, __pyx_n_s_xi, __pyx_n_s_yi, __pyx_n_s_xj, __pyx_n_s_yj, __pyx_n_s_xk, __pyx_n_s_yk); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 1011, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__8); - __Pyx_GIVEREF(__pyx_tuple__8); - __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_direction, 1011, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 1011, __pyx_L1_error) + __pyx_tuple__10 = PyTuple_Pack(6, __pyx_n_s_xi, __pyx_n_s_yi, __pyx_n_s_xj, __pyx_n_s_yj, __pyx_n_s_xk, __pyx_n_s_yk); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 1044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__10); + __Pyx_GIVEREF(__pyx_tuple__10); + __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_direction, 1044, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 1044, __pyx_L1_error) - /* "collisions.py":1038 + /* "collisions.py":1071 * return [] * # This finds where the lines are colliding if they are infinite, which is why we check if they collide first * def line(p1, p2): # <<<<<<<<<<<<<< * A = (p1[1] - p2[1]) * B = (p2[0] - p1[0]) */ - __pyx_tuple__10 = PyTuple_Pack(5, __pyx_n_s_p1, __pyx_n_s_p2, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_C); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 1038, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__10); - __Pyx_GIVEREF(__pyx_tuple__10); - __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_line, 1038, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 1038, __pyx_L1_error) + __pyx_tuple__12 = PyTuple_Pack(5, __pyx_n_s_p1, __pyx_n_s_p2, __pyx_n_s_A, __pyx_n_s_B, __pyx_n_s_C); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 1071, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__12); + __Pyx_GIVEREF(__pyx_tuple__12); + __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_line, 1071, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 1071, __pyx_L1_error) - /* "collisions.py":1083 + /* "collisions.py":1116 * return colls * return colls[0] * def calculate(ln, point, recalculate): # <<<<<<<<<<<<<< * p2 = ln.closestPointTo(Point(*point)) * olineP = point */ - __pyx_tuple__12 = PyTuple_Pack(5, __pyx_n_s_ln, __pyx_n_s_point, __pyx_n_s_recalculate, __pyx_n_s_p2, __pyx_n_s_olineP); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 1083, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__12); - __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_calculate, 1083, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 1083, __pyx_L1_error) + __pyx_tuple__14 = PyTuple_Pack(5, __pyx_n_s_ln, __pyx_n_s_point, __pyx_n_s_recalculate, __pyx_n_s_p2, __pyx_n_s_olineP); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 1116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__14); + __Pyx_GIVEREF(__pyx_tuple__14); + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_calculate, 1116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 1116, __pyx_L1_error) - /* "collisions.py":1110 + /* "collisions.py":1143 * return colls * return colls[0] * def calculate(ln, point, recalculate): # <<<<<<<<<<<<<< * p2 = ln.closestPointTo(Point(*point)) * olineP = point */ - __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_calculate, 1110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 1110, __pyx_L1_error) + __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_calculate, 1143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 1143, __pyx_L1_error) - /* "collisions.py":1140 + /* "collisions.py":1173 * bool: Whether the point is on a corner of this shape * """ * def rountTuple(x): # <<<<<<<<<<<<<< * return (round(x[0], precision), round(x[1], precision)) * return rountTuple(self.p1) == rountTuple(point) or rountTuple(self.p2) == rountTuple(point) */ - __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 1140, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__15); - __Pyx_GIVEREF(__pyx_tuple__15); - __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rountTuple, 1140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 1140, __pyx_L1_error) + __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 1173, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__17); + __Pyx_GIVEREF(__pyx_tuple__17); + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rountTuple, 1173, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 1173, __pyx_L1_error) - /* "collisions.py":1159 + /* "collisions.py":1192 * elif point == self.p2: * return math.degrees(math.atan2(self.p1[1] - self.p2[1], self.p1[0] - self.p2[0])) * def fixangle(angle): # <<<<<<<<<<<<<< * angle = angle % 360 * if angle > 180: */ - __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_angle); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 1159, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__17); - __Pyx_GIVEREF(__pyx_tuple__17); - __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_fixangle, 1159, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 1159, __pyx_L1_error) + __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_angle); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 1192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__19); + __Pyx_GIVEREF(__pyx_tuple__19); + __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_fixangle, 1192, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 1192, __pyx_L1_error) - /* "collisions.py":1444 + /* "collisions.py":1486 * if not self.check_rects(othershape): * return [] * def sign(x): # <<<<<<<<<<<<<< * return -1 if x < 0 else 1 * x1 = othershape.p1[0] - self.x */ - __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_sign, 1444, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 1444, __pyx_L1_error) + __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_sign, 1486, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 1486, __pyx_L1_error) - /* "collisions.py":1867 + /* "collisions.py":1681 + * else: + * closestObj = points[0][1] + * def calculate(point): # <<<<<<<<<<<<<< + * cpoMvemnt = Line((oldCir.x + oldCir.r * math.cos(velphi-math.pi), oldCir.y + oldCir.r * math.sin(velphi-math.pi)), + * (newCir.x + newCir.r * math.cos(velphi), newCir.y + newCir.r * math.sin(velphi)) + */ + __pyx_tuple__22 = PyTuple_Pack(5, __pyx_n_s_point, __pyx_n_s_cpoMvemnt, __pyx_n_s_dist_to, __pyx_n_s_dist_left, __pyx_n_s_ThisClosestP); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 1681, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__22); + __Pyx_GIVEREF(__pyx_tuple__22); + __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_calculate, 1681, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 1681, __pyx_L1_error) + + /* "collisions.py":1953 * cirO = Circle(self.x, self.y, self.r) * if cirO.collides(othershape): * def checkP(p, this): # <<<<<<<<<<<<<< * if not this: * p = self.closestPointTo(Point(*p)) */ - __pyx_tuple__20 = PyTuple_Pack(3, __pyx_n_s_p, __pyx_n_s_this, __pyx_n_s_op); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 1867, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__20); - __Pyx_GIVEREF(__pyx_tuple__20); - __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_checkP, 1867, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 1867, __pyx_L1_error) + __pyx_tuple__24 = PyTuple_Pack(3, __pyx_n_s_p, __pyx_n_s_this, __pyx_n_s_op); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 1953, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__24); + __Pyx_GIVEREF(__pyx_tuple__24); + __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_checkP, 1953, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 1953, __pyx_L1_error) - /* "collisions.py":1925 + /* "collisions.py":2011 * self.startAng, self.endAng = self.startAng % 360, self.endAng % 360 * phi = phi % 360 * def angular_distance(a, b): # <<<<<<<<<<<<<< * return min(abs(a - b), 360 - abs(a - b)) * if self.endAng < self.startAng: */ - __pyx_tuple__22 = PyTuple_Pack(2, __pyx_n_s_a, __pyx_n_s_b); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 1925, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__22); - __Pyx_GIVEREF(__pyx_tuple__22); - __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_angular_distance, 1925, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 1925, __pyx_L1_error) + __pyx_tuple__26 = PyTuple_Pack(2, __pyx_n_s_a, __pyx_n_s_b); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 2011, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__26); + __Pyx_GIVEREF(__pyx_tuple__26); + __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_angular_distance, 2011, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 2011, __pyx_L1_error) - /* "collisions.py":2104 + /* "collisions.py":2190 * ps.sort(key=lambda x: abs(x[1][0]-point[0])**2+abs(x[1][1]-point[1])**2) * if ps[0][1] == ps[1][1]: * def degrees_to_vector(angle): # <<<<<<<<<<<<<< * # Convert an angle to a unit vector * radians = math.radians(angle) */ - __pyx_tuple__26 = PyTuple_Pack(2, __pyx_n_s_angle, __pyx_n_s_radians); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 2104, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__26); - __Pyx_GIVEREF(__pyx_tuple__26); - __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_degrees_to_vector, 2104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 2104, __pyx_L1_error) + __pyx_tuple__30 = PyTuple_Pack(2, __pyx_n_s_angle, __pyx_n_s_radians); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 2190, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__30); + __Pyx_GIVEREF(__pyx_tuple__30); + __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_degrees_to_vector, 2190, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 2190, __pyx_L1_error) - /* "collisions.py":2143 + /* "collisions.py":2229 * return colls * return colls[0] * def calculate(ln, oln, recalculate): # <<<<<<<<<<<<<< * p2 = oln.closestPointTo(ln) * p = ln.closestPointTo(Point(*p2)) */ - __pyx_tuple__28 = PyTuple_Pack(6, __pyx_n_s_ln, __pyx_n_s_oln, __pyx_n_s_recalculate, __pyx_n_s_p2, __pyx_n_s_p, __pyx_n_s_p3); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 2143, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__28); - __Pyx_GIVEREF(__pyx_tuple__28); - __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_calculate, 2143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 2143, __pyx_L1_error) + __pyx_tuple__32 = PyTuple_Pack(6, __pyx_n_s_ln, __pyx_n_s_oln, __pyx_n_s_recalculate, __pyx_n_s_p2, __pyx_n_s_p, __pyx_n_s_p3); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 2229, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__32); + __Pyx_GIVEREF(__pyx_tuple__32); + __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_calculate, 2229, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 2229, __pyx_L1_error) - /* "collisions.py":2179 + /* "collisions.py":2265 * return colls * return colls[0] * def calculate(ln, point, recalculate): # <<<<<<<<<<<<<< * p2 = ln.closestPointTo(Point(*point)) * olineP = point */ - __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_calculate, 2179, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 2179, __pyx_L1_error) + __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_calculate, 2265, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 2265, __pyx_L1_error) - /* "collisions.py":2588 + /* "collisions.py":2674 * cos = math.cos(angle) * sin = math.sin(angle) * def rot(x, y): # <<<<<<<<<<<<<< * return cos * x - sin * y, sin * x + cos * y * self.cache = [ */ - __pyx_tuple__31 = PyTuple_Pack(2, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 2588, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__31); - __Pyx_GIVEREF(__pyx_tuple__31); - __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rot, 2588, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 2588, __pyx_L1_error) + __pyx_tuple__35 = PyTuple_Pack(2, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 2674, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__35); + __Pyx_GIVEREF(__pyx_tuple__35); + __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rot, 2674, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 2674, __pyx_L1_error) - /* "collisions.py":2680 + /* "collisions.py":2766 * * def __setitem__(self, item: int, new: pointLike) -> None: * def rot(x, y): # <<<<<<<<<<<<<< * return rotate([self.x, self.y], [x, y], self.rot) * if item == 0: */ - __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rot, 2680, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 2680, __pyx_L1_error) + __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rot, 2766, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 2766, __pyx_L1_error) - /* "collisions.py":2927 + /* "collisions.py":3013 * if not shapes: * return Shapes() * def reformat(obj): # <<<<<<<<<<<<<< * if checkShpType(obj, ShpGroups.CLOSED): * return obj */ - __pyx_tuple__34 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 2927, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__34); - __Pyx_GIVEREF(__pyx_tuple__34); - __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_reformat, 2927, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 2927, __pyx_L1_error) + __pyx_tuple__38 = PyTuple_Pack(1, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 3013, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__38); + __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_reformat, 3013, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 3013, __pyx_L1_error) /* "collisions.py":11 * pygame = None # Remember to `checkForPygame()`! @@ -109783,9 +113035,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * import shapely.ops as shapelyOps * */ - __pyx_tuple__38 = PyTuple_Pack(2, __pyx_n_s_shapely, __pyx_n_s_geometry); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 11, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__38); - __Pyx_GIVEREF(__pyx_tuple__38); + __pyx_tuple__42 = PyTuple_Pack(2, __pyx_n_s_shapely, __pyx_n_s_geometry); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 11, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__42); + __Pyx_GIVEREF(__pyx_tuple__42); /* "collisions.py":12 * import shapely @@ -109794,9 +113046,9 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * * Number = Union[int, float] */ - __pyx_tuple__39 = PyTuple_Pack(2, __pyx_n_s_shapely, __pyx_n_s_ops); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 12, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__39); - __Pyx_GIVEREF(__pyx_tuple__39); + __pyx_tuple__43 = PyTuple_Pack(2, __pyx_n_s_shapely, __pyx_n_s_ops); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 12, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__43); + __Pyx_GIVEREF(__pyx_tuple__43); /* "collisions.py":49 * ] @@ -109805,7 +113057,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * if pygame is None: * raise ImportError( */ - __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_checkForPygame, 49, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_checkForPygame, 49, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 49, __pyx_L1_error) /* "collisions.py":55 * ) @@ -109814,10 +113066,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """ * Rotate a point clockwise by a given angle around a given origin. */ - __pyx_tuple__41 = PyTuple_Pack(9, __pyx_n_s_origin, __pyx_n_s_point, __pyx_n_s_angle, __pyx_n_s_cos, __pyx_n_s_sin, __pyx_n_s_ydiff, __pyx_n_s_xdiff, __pyx_n_s_qx, __pyx_n_s_qy); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 55, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__41); - __Pyx_GIVEREF(__pyx_tuple__41); - __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rotate, 55, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_tuple__45 = PyTuple_Pack(9, __pyx_n_s_origin, __pyx_n_s_point, __pyx_n_s_angle, __pyx_n_s_cos, __pyx_n_s_sin, __pyx_n_s_ydiff, __pyx_n_s_xdiff, __pyx_n_s_qx, __pyx_n_s_qy); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 55, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__45); + __Pyx_GIVEREF(__pyx_tuple__45); + __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rotate, 55, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 55, __pyx_L1_error) /* "collisions.py":78 * return qx, qy @@ -109826,10 +113078,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """ * Rotate a point clockwise by a given angle around the origin. */ - __pyx_tuple__43 = PyTuple_Pack(6, __pyx_n_s_point, __pyx_n_s_angle, __pyx_n_s_cos, __pyx_n_s_sin, __pyx_n_s_qx, __pyx_n_s_qy); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 78, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__43); - __Pyx_GIVEREF(__pyx_tuple__43); - __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rotateBy0, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_tuple__47 = PyTuple_Pack(6, __pyx_n_s_point, __pyx_n_s_angle, __pyx_n_s_cos, __pyx_n_s_sin, __pyx_n_s_qx, __pyx_n_s_qy); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 78, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__47); + __Pyx_GIVEREF(__pyx_tuple__47); + __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rotateBy0, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 78, __pyx_L1_error) /* "collisions.py":97 * return qx, qy @@ -109838,10 +113090,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """ * Finds the direction of `toPoint` from the origin of `fromPoint` */ - __pyx_tuple__45 = PyTuple_Pack(2, __pyx_n_s_fromPoint, __pyx_n_s_toPoint); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 97, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__45); - __Pyx_GIVEREF(__pyx_tuple__45); - __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_direction, 97, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_tuple__49 = PyTuple_Pack(2, __pyx_n_s_fromPoint, __pyx_n_s_toPoint); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 97, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__49); + __Pyx_GIVEREF(__pyx_tuple__49); + __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_direction, 97, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 97, __pyx_L1_error) /* "collisions.py":110 * return math.atan2(toPoint[1]-fromPoint[1], toPoint[0]-fromPoint[0]) @@ -109850,1924 +113102,1975 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { * """ * Finds the point on the unit circle at a given angle with a given strength */ - __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_s_angle, __pyx_n_s_strength); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__47); - __Pyx_GIVEREF(__pyx_tuple__47); - __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_pointOnCircle, 110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 110, __pyx_L1_error) - __pyx_tuple__49 = PyTuple_Pack(1, ((PyObject *)__pyx_int_1)); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 110, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__49); - __Pyx_GIVEREF(__pyx_tuple__49); + __pyx_tuple__51 = PyTuple_Pack(2, __pyx_n_s_angle, __pyx_n_s_strength); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__51); + __Pyx_GIVEREF(__pyx_tuple__51); + __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_pointOnCircle, 110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 110, __pyx_L1_error) + __pyx_tuple__53 = PyTuple_Pack(1, ((PyObject *)__pyx_int_1)); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__53); + __Pyx_GIVEREF(__pyx_tuple__53); - /* "collisions.py":150 + /* "collisions.py":152 * Polygon = -9 * * def checkShpType(shape: Union['Shape', 'Shapes'], *typs: Union[ShpTyps, ShpGroups]) -> bool: # <<<<<<<<<<<<<< * """ * Checks to see if a shape is of a certain type or group. */ - __pyx_tuple__50 = PyTuple_Pack(3, __pyx_n_s_shape, __pyx_n_s_typs, __pyx_n_s_typ_set); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 150, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__50); - __Pyx_GIVEREF(__pyx_tuple__50); - __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_checkShpType, 150, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_tuple__54 = PyTuple_Pack(3, __pyx_n_s_shape, __pyx_n_s_typs, __pyx_n_s_typ_set); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__54); + __Pyx_GIVEREF(__pyx_tuple__54); + __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_checkShpType, 152, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 152, __pyx_L1_error) - /* "collisions.py":168 + /* "collisions.py":170 * return False * * def shapelyToColl(shapelyShape: shapelyGeom.base.BaseGeometry) -> Union['Shape', 'Shapes']: # <<<<<<<<<<<<<< * """ * Converts a shapely shape to a BlazeSudio Shape. */ - __pyx_tuple__52 = PyTuple_Pack(4, __pyx_n_s_shapelyShape, __pyx_n_s_i, __pyx_n_s_i, __pyx_n_s_i); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 168, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__52); - __Pyx_GIVEREF(__pyx_tuple__52); - __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_shapelyToColl, 168, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_tuple__56 = PyTuple_Pack(4, __pyx_n_s_shapelyShape, __pyx_n_s_i, __pyx_n_s_i, __pyx_n_s_i); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 170, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__56); + __Pyx_GIVEREF(__pyx_tuple__56); + __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_shapelyToColl, 170, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 170, __pyx_L1_error) - /* "collisions.py":190 + /* "collisions.py":193 * raise ValueError(f'Cannot convert shapely shape of type {type(shapelyShape)} to BlazeSudio Shape') * * def collToShapely(collShape: 'Shape') -> shapelyGeom.base.BaseGeometry: # <<<<<<<<<<<<<< * """ * Converts a BlazeSudio Shape to a shapely shape. */ - __pyx_tuple__54 = PyTuple_Pack(3, __pyx_n_s_collShape, __pyx_n_s_i, __pyx_n_s_i); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 190, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__54); - __Pyx_GIVEREF(__pyx_tuple__54); - __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collToShapely, 190, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_tuple__58 = PyTuple_Pack(3, __pyx_n_s_collShape, __pyx_n_s_i, __pyx_n_s_i); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__58); + __Pyx_GIVEREF(__pyx_tuple__58); + __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collToShapely, 193, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 193, __pyx_L1_error) - /* "collisions.py":212 + /* "collisions.py":216 * raise ValueError(f'Cannot convert BlazeSudio shape of type {type(collShape)} to shapely shape') * * def drawShape(surface: Any, shape: 'Shape', colour: tuple[int, int, int], width: int = 0): # <<<<<<<<<<<<<< * """ * Draws a BlazeSudio shape to a Pygame surface. */ - __pyx_tuple__56 = PyTuple_Pack(10, __pyx_n_s_surface, __pyx_n_s_shape, __pyx_n_s_colour, __pyx_n_s_width, __pyx_n_s_ps, __pyx_n_s_psset, __pyx_n_s_fst, __pyx_n_s_snd, __pyx_n_s_i, __pyx_n_s_i); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 212, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__56); - __Pyx_GIVEREF(__pyx_tuple__56); - __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_drawShape, 212, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_tuple__60 = PyTuple_Pack(10, __pyx_n_s_surface, __pyx_n_s_shape, __pyx_n_s_colour, __pyx_n_s_width, __pyx_n_s_ps, __pyx_n_s_psset, __pyx_n_s_fst, __pyx_n_s_snd, __pyx_n_s_i, __pyx_n_s_i); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 216, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__60); + __Pyx_GIVEREF(__pyx_tuple__60); + __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_drawShape, 216, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 216, __pyx_L1_error) - /* "collisions.py":266 + /* "collisions.py":270 * x: Number = 0 * y: Number = 0 * def __init__(self, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< * """ * Args: */ - __pyx_tuple__58 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_bounciness); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__58); - __Pyx_GIVEREF(__pyx_tuple__58); - __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_init, 266, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_tuple__62 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_bounciness); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 270, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__62); + __Pyx_GIVEREF(__pyx_tuple__62); + __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_init, 270, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 270, __pyx_L1_error) - /* "collisions.py":273 + /* "collisions.py":277 * self.bounciness: Number = bounciness * * def collides(self, othershape: Union['Shape','Shapes',Iterable['Shape']]) -> bool: # <<<<<<<<<<<<<< * """ * Whether this shape collides with another shape(s) */ - __pyx_tuple__60 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_s); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 273, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__60); - __Pyx_GIVEREF(__pyx_tuple__60); - __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collides_2, 273, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_tuple__64 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_s); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 277, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__64); + __Pyx_GIVEREF(__pyx_tuple__64); + __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collides_2, 277, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 277, __pyx_L1_error) - /* "collisions.py":290 + /* "collisions.py":294 * return False * * def whereCollides(self, othershape: Union['Shape','Shapes',Iterable['Shape']]) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Finds where this shape collides with another shape(s) */ - __pyx_tuple__62 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_points_2, __pyx_n_s_s); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 290, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__62); - __Pyx_GIVEREF(__pyx_tuple__62); - __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_whereCollides, 290, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_tuple__66 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_points_2, __pyx_n_s_s); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 294, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__66); + __Pyx_GIVEREF(__pyx_tuple__66); + __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_whereCollides, 294, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 294, __pyx_L1_error) - /* "collisions.py":307 + /* "collisions.py":311 * return points * * def isContaining(self, othershape: Union['Shape','Shapes',Iterable['Shape']]) -> bool: # <<<<<<<<<<<<<< * """ * Finds whether this shape fully encloses `othershape`; if `whereCollides` returns `[]` but `collides` returns True. But (most of the time) more optimised than that. */ - __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_isContaining, 307, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__64)) __PYX_ERR(0, 307, __pyx_L1_error) + __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_isContaining, 311, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 311, __pyx_L1_error) - /* "collisions.py":324 + /* "collisions.py":328 * return False * * def distance_to(self, othershape: 'Shape') -> Number: # <<<<<<<<<<<<<< * """ * Finds the distance between this shape and another shape. */ - __pyx_tuple__65 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_thisP, __pyx_n_s_otherP); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 324, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__65); - __Pyx_GIVEREF(__pyx_tuple__65); - __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_distance_to, 324, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(0, 324, __pyx_L1_error) + __pyx_tuple__69 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_thisP, __pyx_n_s_otherP); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 328, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__69); + __Pyx_GIVEREF(__pyx_tuple__69); + __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_distance_to, 328, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 328, __pyx_L1_error) - /* "collisions.py":338 + /* "collisions.py":342 * return math.hypot(thisP[0]-otherP[0], thisP[1]-otherP[1]) * * def check_rects(self, othershape: 'Shape') -> bool: # <<<<<<<<<<<<<< * """ * Check whether this shape's bounding box collides with the other shape's. */ - __pyx_tuple__67 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_thisr, __pyx_n_s_otherr); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 338, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__67); - __Pyx_GIVEREF(__pyx_tuple__67); - __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_check_rects, 338, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__68)) __PYX_ERR(0, 338, __pyx_L1_error) + __pyx_tuple__71 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_thisr, __pyx_n_s_otherr); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__71); + __Pyx_GIVEREF(__pyx_tuple__71); + __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_check_rects, 342, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 342, __pyx_L1_error) - /* "collisions.py":353 + /* "collisions.py":357 * return thisr[0] <= otherr[2] and thisr[2] >= otherr[0] and thisr[1] <= otherr[3] and thisr[3] >= otherr[1] * * def __repr__(self): return str(self) # <<<<<<<<<<<<<< * * # Replace these */ - __pyx_tuple__69 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__69); - __Pyx_GIVEREF(__pyx_tuple__69); - __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_repr, 353, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_tuple__73 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 357, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__73); + __Pyx_GIVEREF(__pyx_tuple__73); + __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_repr, 357, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 357, __pyx_L1_error) - /* "collisions.py":356 + /* "collisions.py":360 * * # Replace these * def _collides(self, othershape: 'Shape') -> bool: # <<<<<<<<<<<<<< * return True * */ - __pyx_tuple__71 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_othershape); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(0, 356, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__71); - __Pyx_GIVEREF(__pyx_tuple__71); - __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collides, 356, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__72)) __PYX_ERR(0, 356, __pyx_L1_error) + __pyx_tuple__75 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_othershape); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 360, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__75); + __Pyx_GIVEREF(__pyx_tuple__75); + __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collides, 360, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 360, __pyx_L1_error) - /* "collisions.py":359 + /* "collisions.py":363 * return True * * def _where(self, othershape: 'Shape') -> Iterable[pointLike]: # <<<<<<<<<<<<<< * return [] * */ - __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_where, 359, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 359, __pyx_L1_error) + __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_where, 363, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 363, __pyx_L1_error) - /* "collisions.py":362 + /* "collisions.py":366 * return [] * * def _contains(self, othershape: 'Shape') -> bool: # <<<<<<<<<<<<<< * return True * */ - __pyx_codeobj__74 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_contains, 362, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__74)) __PYX_ERR(0, 362, __pyx_L1_error) + __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_contains, 366, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(0, 366, __pyx_L1_error) - /* "collisions.py":365 + /* "collisions.py":369 * return True * * def closestPointTo(self, othershape: 'Shape', returnAll: bool = False) -> pointLike|Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Finds the closest point ON THIS OBJECT **TO** the other object */ - __pyx_tuple__75 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_returnAll); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 365, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__75); - __Pyx_GIVEREF(__pyx_tuple__75); - __pyx_codeobj__76 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_closestPointTo, 365, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__76)) __PYX_ERR(0, 365, __pyx_L1_error) - __pyx_tuple__77 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 365, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__77); - __Pyx_GIVEREF(__pyx_tuple__77); + __pyx_tuple__79 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_returnAll); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__79); + __Pyx_GIVEREF(__pyx_tuple__79); + __pyx_codeobj__80 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_closestPointTo, 369, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__80)) __PYX_ERR(0, 369, __pyx_L1_error) + __pyx_tuple__81 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__81); + __Pyx_GIVEREF(__pyx_tuple__81); - /* "collisions.py":380 + /* "collisions.py":384 * return (0, 0) * * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< * """ * Finds whether a point is on a corner of this shape. */ - __pyx_tuple__78 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_point, __pyx_n_s_precision); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 380, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__78); - __Pyx_GIVEREF(__pyx_tuple__78); - __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_isCorner, 380, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 380, __pyx_L1_error) + __pyx_tuple__82 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_point, __pyx_n_s_precision); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 384, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__82); + __Pyx_GIVEREF(__pyx_tuple__82); + __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_isCorner, 384, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 384, __pyx_L1_error) - /* "collisions.py":393 + /* "collisions.py":397 * return True * * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< * """ * Finds the tangent on this surface to a point with a given velocity */ - __pyx_tuple__80 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_point, __pyx_n_s_vel); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 393, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__80); - __Pyx_GIVEREF(__pyx_tuple__80); - __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_tangent, 393, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 393, __pyx_L1_error) + __pyx_tuple__84 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_point, __pyx_n_s_vel); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__84); + __Pyx_GIVEREF(__pyx_tuple__84); + __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_tangent, 397, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 397, __pyx_L1_error) - /* "collisions.py":406 + /* "collisions.py":410 * return math.degrees(math.atan2(vel[1], vel[0])) % 360 * * def toLines(self) -> Iterable['Line']: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_codeobj__82 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toLines, 406, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__82)) __PYX_ERR(0, 406, __pyx_L1_error) + __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toLines, 410, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(0, 410, __pyx_L1_error) - /* "collisions.py":413 + /* "collisions.py":417 * return [] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toPoints, 413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toPoints, 417, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(0, 417, __pyx_L1_error) - /* "collisions.py":420 + /* "collisions.py":424 * return [] * * def area(self) -> Number: # <<<<<<<<<<<<<< * """ * Gets the area of the shape. */ - __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_area, 420, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(0, 420, __pyx_L1_error) + __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_area, 424, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(0, 424, __pyx_L1_error) - /* "collisions.py":429 + /* "collisions.py":433 * return float('inf') * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ * Returns the rectangle bounding box surrounding this object. */ - __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rect, 429, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rect, 433, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(0, 433, __pyx_L1_error) - /* "collisions.py":438 + /* "collisions.py":442 * return -float('inf'), -float('inf'), float('inf'), float('inf') * * def handleCollisionsPos(self, oldP: 'Shape', newP: 'Shape', objs: Union['Shapes',Iterable['Shape']], vel: pointLike = [0,0], verbose: bool = False) -> tuple['Shape', pointLike, verboseOutput]: # <<<<<<<<<<<<<< * """ * This is called to modify objects' positions to bounce off objects. */ - __pyx_tuple__86 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_oldP, __pyx_n_s_newP, __pyx_n_s_objs, __pyx_n_s_vel, __pyx_n_s_verbose); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 438, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__86); - __Pyx_GIVEREF(__pyx_tuple__86); - __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_handleCollisionsPos, 438, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(0, 438, __pyx_L1_error) + __pyx_tuple__90 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_oldP, __pyx_n_s_newP, __pyx_n_s_objs, __pyx_n_s_vel, __pyx_n_s_verbose); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 442, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__90); + __Pyx_GIVEREF(__pyx_tuple__90); + __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_handleCollisionsPos, 442, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(0, 442, __pyx_L1_error) - /* "collisions.py":446 + /* "collisions.py":450 * return newP, vel * * def handleCollisionsVel(self, vel: pointLike, objs: Union['Shapes',Iterable['Shape']], verbose: bool = False) -> tuple['Shape', pointLike, verboseOutput]: # <<<<<<<<<<<<<< * """ * This is a wrapper for `handleCollisionsPos` to handle velocity instead of position. */ - __pyx_tuple__88 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_vel, __pyx_n_s_objs, __pyx_n_s_verbose); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 446, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__88); - __Pyx_GIVEREF(__pyx_tuple__88); - __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_handleCollisionsVel, 446, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(0, 446, __pyx_L1_error) + __pyx_tuple__92 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_vel, __pyx_n_s_objs, __pyx_n_s_verbose); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 450, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__92); + __Pyx_GIVEREF(__pyx_tuple__92); + __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_handleCollisionsVel, 450, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(0, 450, __pyx_L1_error) - /* "collisions.py":454 + /* "collisions.py":458 * return self, vel * * def copy(self) -> 'Shape': # <<<<<<<<<<<<<< * """ * Copy this shape to return another with the same properties */ - __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_copy, 454, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_copy, 458, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(0, 458, __pyx_L1_error) - /* "collisions.py":460 + /* "collisions.py":464 * return Shape(self.bounciness) * * def __getitem__(self, it: int) -> None: # <<<<<<<<<<<<<< * return 0 * */ - __pyx_tuple__91 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_it); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(0, 460, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__91); - __Pyx_GIVEREF(__pyx_tuple__91); - __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_getitem, 460, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_tuple__95 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_it); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 464, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__95); + __Pyx_GIVEREF(__pyx_tuple__95); + __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_getitem, 464, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(0, 464, __pyx_L1_error) - /* "collisions.py":463 + /* "collisions.py":467 * return 0 * * def __setitem__(self, it: int, new: Number) -> None: # <<<<<<<<<<<<<< * pass * */ - __pyx_tuple__93 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_it, __pyx_n_s_new); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(0, 463, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__93); - __Pyx_GIVEREF(__pyx_tuple__93); - __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_setitem, 463, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_tuple__97 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_it, __pyx_n_s_new); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 467, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__97); + __Pyx_GIVEREF(__pyx_tuple__97); + __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_setitem, 467, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(0, 467, __pyx_L1_error) - /* "collisions.py":466 + /* "collisions.py":470 * pass * * def __iter__(self): # <<<<<<<<<<<<<< * return iter([]) * */ - __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_iter, 466, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) __PYX_ERR(0, 466, __pyx_L1_error) + __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_iter, 470, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 470, __pyx_L1_error) - /* "collisions.py":469 + /* "collisions.py":473 * return iter([]) * * def __str__(self): # <<<<<<<<<<<<<< * return '' * */ - __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_str, 469, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(0, 469, __pyx_L1_error) + __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_str, 473, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(0, 473, __pyx_L1_error) - /* "collisions.py":474 + /* "collisions.py":478 * class NoShape(Shape): * """A class to represent no shape. This is useful for when you want to have a shape that doesn't collide with anything.""" * def __init__(self): # <<<<<<<<<<<<<< * super().__init__(0) * */ - __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_init, 474, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_init, 478, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 478, __pyx_L1_error) - /* "collisions.py":477 + /* "collisions.py":481 * super().__init__(0) * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * return False * */ - __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collides, 477, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(0, 477, __pyx_L1_error) + __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collides, 481, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(0, 481, __pyx_L1_error) - /* "collisions.py":480 + /* "collisions.py":484 * return False * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * return [] * */ - __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_where, 480, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) __PYX_ERR(0, 480, __pyx_L1_error) + __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_where, 484, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(0, 484, __pyx_L1_error) - /* "collisions.py":483 + /* "collisions.py":487 * return [] * * def _contains(self, othershape: 'Shape') -> bool: # <<<<<<<<<<<<<< * return False * */ - __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_contains, 483, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(0, 483, __pyx_L1_error) + __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_contains, 487, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) __PYX_ERR(0, 487, __pyx_L1_error) - /* "collisions.py":486 + /* "collisions.py":490 * return False * * def area(self) -> Number: # <<<<<<<<<<<<<< * """ * Gets the area of the shape; 0. */ - __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_area, 486, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) __PYX_ERR(0, 486, __pyx_L1_error) + __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_area, 490, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(0, 490, __pyx_L1_error) - /* "collisions.py":495 + /* "collisions.py":499 * return 0 * * def copy(self) -> 'NoShape': # <<<<<<<<<<<<<< * """Make a copy of this non-existant shape""" * return NoShape() */ - __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_copy, 495, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(0, 495, __pyx_L1_error) + __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_copy, 499, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(0, 499, __pyx_L1_error) - /* "collisions.py":499 + /* "collisions.py":503 * return NoShape() * * def __str__(self): # <<<<<<<<<<<<<< * return '' * */ - __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_str, 499, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_str, 503, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(0, 503, __pyx_L1_error) - /* "collisions.py":506 + /* "collisions.py":510 * GROUPS = {ShpGroups.GROUP} * TYPE = ShpTyps.Group - * def __init__(self, *shapes: Shape): # <<<<<<<<<<<<<< + * def __init__(self, *shapes: Shape, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< * """ * Args: */ - __pyx_tuple__104 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_shapes); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(0, 506, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__104); - __Pyx_GIVEREF(__pyx_tuple__104); - __pyx_codeobj__105 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__104, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_init, 506, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__105)) __PYX_ERR(0, 506, __pyx_L1_error) + __pyx_tuple__108 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_bounciness, __pyx_n_s_shapes); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__108); + __Pyx_GIVEREF(__pyx_tuple__108); + __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__108, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_init, 510, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(0, 510, __pyx_L1_error) - /* "collisions.py":516 + /* "collisions.py":522 * self.shapes = list(shapes) * * def add_shape(self, shape: Shape) -> None: # <<<<<<<<<<<<<< * """ * Adds a shape to this Shapes object. */ - __pyx_tuple__106 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_shape); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(0, 516, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__106); - __Pyx_GIVEREF(__pyx_tuple__106); - __pyx_codeobj__107 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__106, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_add_shape, 516, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__107)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_tuple__110 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_shape); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(0, 522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__110); + __Pyx_GIVEREF(__pyx_tuple__110); + __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__110, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_add_shape, 522, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) __PYX_ERR(0, 522, __pyx_L1_error) - /* "collisions.py":525 + /* "collisions.py":531 * self.shapes.append(shape) * * def add_shapes(self, *shapes: Shape) -> None: # <<<<<<<<<<<<<< * """ * Adds multiple shapes to this object. */ - __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__104, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_add_shapes, 525, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_tuple__112 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_shapes); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(0, 531, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__112); + __Pyx_GIVEREF(__pyx_tuple__112); + __pyx_codeobj__113 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__112, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_add_shapes, 531, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__113)) __PYX_ERR(0, 531, __pyx_L1_error) - /* "collisions.py":537 + /* "collisions.py":543 * self.shapes.extend(list(shapes)) * * def remove_shape(self, shape: Shape) -> None: # <<<<<<<<<<<<<< * """ * Removes a specific shape from this object. */ - __pyx_codeobj__109 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__106, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_remove_shape, 537, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__109)) __PYX_ERR(0, 537, __pyx_L1_error) + __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__110, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_remove_shape, 543, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(0, 543, __pyx_L1_error) - /* "collisions.py":546 + /* "collisions.py":552 * self.shapes.remove(shape) * * def remove_shapes(self, *shapes: Shape) -> None: # <<<<<<<<<<<<<< * """ * Removes multiple shapes from this object. */ - __pyx_tuple__110 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_shapes, __pyx_n_s_s); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(0, 546, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__110); - __Pyx_GIVEREF(__pyx_tuple__110); - __pyx_codeobj__111 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__110, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_remove_shapes, 546, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__111)) __PYX_ERR(0, 546, __pyx_L1_error) + __pyx_tuple__115 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_shapes, __pyx_n_s_s); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(0, 552, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__115); + __Pyx_GIVEREF(__pyx_tuple__115); + __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__115, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_remove_shapes, 552, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(0, 552, __pyx_L1_error) - /* "collisions.py":559 + /* "collisions.py":565 * self.shapes.remove(s) * * def collides(self, shapes: Union[Shape,'Shapes',Iterable[Shape]]) -> bool: # <<<<<<<<<<<<<< * """ * Checks for collisions between all the shapes in this object and the input shape(s). */ - __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__110, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collides_2, 559, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(0, 559, __pyx_L1_error) + __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__115, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collides_2, 565, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(0, 565, __pyx_L1_error) - /* "collisions.py":574 + /* "collisions.py":580 * return False * * def whereCollides(self, shapes: Union[Shape,'Shapes',Iterable[Shape]]) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Find the points where this object collides with the input shape(s). */ - __pyx_tuple__113 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_shapes, __pyx_n_s_points_2, __pyx_n_s_s); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 574, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__113); - __Pyx_GIVEREF(__pyx_tuple__113); - __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_whereCollides, 574, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(0, 574, __pyx_L1_error) + __pyx_tuple__118 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_shapes, __pyx_n_s_points_2, __pyx_n_s_s); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(0, 580, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__118); + __Pyx_GIVEREF(__pyx_tuple__118); + __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__118, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_whereCollides, 580, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(0, 580, __pyx_L1_error) - /* "collisions.py":589 + /* "collisions.py":595 * return points * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ - * Finds the closest point ON all of these objects TO the input shape. + * Finds the closest point ON ANY of these objects TO the input shape. */ - __pyx_tuple__115 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_returnAll, __pyx_n_s_points_2, __pyx_n_s_s); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(0, 589, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__115); - __Pyx_GIVEREF(__pyx_tuple__115); - __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__115, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_closestPointTo, 589, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_tuple__120 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_returnAll, __pyx_n_s_points_2, __pyx_n_s_s, __pyx_n_s_sortFunc, __pyx_n_s_sortFunc, __pyx_n_s_point, __pyx_n_s_d, __pyx_n_s_np, __pyx_n_s_op, __pyx_n_s_nd); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(0, 595, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__120); + __Pyx_GIVEREF(__pyx_tuple__120); + __pyx_codeobj__121 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__120, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_closestPointTo, 595, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__121)) __PYX_ERR(0, 595, __pyx_L1_error) - /* "collisions.py":609 - * return points + /* "collisions.py":626 + * return point * * def isContaining(self, othershape: Union[Shape,'Shapes',Iterable[Shape]]) -> bool: # <<<<<<<<<<<<<< * """ * Finds whether this shape fully encloses `othershape`; if `whereCollides` returns `[]` but `collides` returns True. But more optimised than that. */ - __pyx_codeobj__117 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_isContaining, 609, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__117)) __PYX_ERR(0, 609, __pyx_L1_error) + __pyx_codeobj__122 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_isContaining, 626, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__122)) __PYX_ERR(0, 626, __pyx_L1_error) - /* "collisions.py":626 - * # TODO: Pick one method: either the dict or the list, not both (see below 2 funcs) + /* "collisions.py":641 + * return False * - * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> Dict[Union[Shape,'Shapes'], bool]: # <<<<<<<<<<<<<< + * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< * """ - * Takes each object and finds whether the input point is on the corner of that object. + * Finds if the point is a corner on any of the objects. */ - __pyx_tuple__118 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_point, __pyx_n_s_precision, __pyx_n_s_cs, __pyx_n_s_s); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(0, 626, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__118); - __Pyx_GIVEREF(__pyx_tuple__118); - __pyx_codeobj__119 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__118, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_isCorner, 626, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__119)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_tuple__123 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_point, __pyx_n_s_precision, __pyx_n_s_s); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(0, 641, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__123); + __Pyx_GIVEREF(__pyx_tuple__123); + __pyx_codeobj__124 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__123, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_isCorner, 641, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__124)) __PYX_ERR(0, 641, __pyx_L1_error) - /* "collisions.py":642 - * return cs + /* "collisions.py":657 + * return False * - * def tangent(self, point: pointLike, vel: pointLike) -> Iterable[Number]: # <<<<<<<<<<<<<< + * def tangent(self, point: pointLike, vel: pointLike) -> Iterable[Number]: # TODO: Make it return just one number # <<<<<<<<<<<<<< * """ * Finds the tangent on each of these objects for the specified point. -90 = normal. */ - __pyx_tuple__120 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_point, __pyx_n_s_vel, __pyx_n_s_points_2, __pyx_n_s_s); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(0, 642, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__120); - __Pyx_GIVEREF(__pyx_tuple__120); - __pyx_codeobj__121 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__120, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_tangent, 642, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__121)) __PYX_ERR(0, 642, __pyx_L1_error) + __pyx_tuple__125 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_point, __pyx_n_s_vel, __pyx_n_s_points_2, __pyx_n_s_s); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(0, 657, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__125); + __Pyx_GIVEREF(__pyx_tuple__125); + __pyx_codeobj__126 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__125, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_tangent, 657, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__126)) __PYX_ERR(0, 657, __pyx_L1_error) + + /* "collisions.py":675 + * # TODO: handleCollisions + * + * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< + * """ + * Returns: + */ + __pyx_tuple__127 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_points_2, __pyx_n_s_s); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(0, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__127); + __Pyx_GIVEREF(__pyx_tuple__127); + __pyx_codeobj__128 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toPoints, 675, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__128)) __PYX_ERR(0, 675, __pyx_L1_error) + + /* "collisions.py":685 + * return points + * + * def toLines(self) -> Iterable['Line']: # <<<<<<<<<<<<<< + * """ + * Returns: + */ + __pyx_tuple__129 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_lines, __pyx_n_s_s); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(0, 685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__129); + __Pyx_GIVEREF(__pyx_tuple__129); + __pyx_codeobj__130 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__129, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toLines, 685, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__130)) __PYX_ERR(0, 685, __pyx_L1_error) - /* "collisions.py":662 - * # TODO: to_points and to_lines + /* "collisions.py":695 + * return lines * * def area(self) -> Number: # <<<<<<<<<<<<<< * """ * Gets the combined area of all the shapes. */ - __pyx_tuple__122 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(0, 662, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__122); - __Pyx_GIVEREF(__pyx_tuple__122); - __pyx_codeobj__123 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_area, 662, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__123)) __PYX_ERR(0, 662, __pyx_L1_error) + __pyx_tuple__131 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(0, 695, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__131); + __Pyx_GIVEREF(__pyx_tuple__131); + __pyx_codeobj__132 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__131, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_area, 695, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__132)) __PYX_ERR(0, 695, __pyx_L1_error) - /* "collisions.py":671 + /* "collisions.py":704 * return sum(s.area() for s in self.shapes) * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ * Returns the rectangle bounding box surrounding every one of these objects. */ - __pyx_tuple__124 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_rs, __pyx_n_s_s, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(0, 671, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__124); - __Pyx_GIVEREF(__pyx_tuple__124); - __pyx_codeobj__125 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__124, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rect, 671, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__125)) __PYX_ERR(0, 671, __pyx_L1_error) + __pyx_tuple__133 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_rs, __pyx_n_s_s, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(0, 704, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__133); + __Pyx_GIVEREF(__pyx_tuple__133); + __pyx_codeobj__134 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__133, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rect, 704, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__134)) __PYX_ERR(0, 704, __pyx_L1_error) - /* "collisions.py":681 + /* "collisions.py":714 * return min(i[0] for i in rs), min(i[1] for i in rs), max(i[2] for i in rs), max(i[3] for i in rs) * * def copy(self) -> 'Shapes': # <<<<<<<<<<<<<< * """ * Make a copy of this class with a copy of each shape in it. */ - __pyx_codeobj__126 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_copy, 681, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__126)) __PYX_ERR(0, 681, __pyx_L1_error) + __pyx_codeobj__135 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__131, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_copy, 714, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__135)) __PYX_ERR(0, 714, __pyx_L1_error) - /* "collisions.py":687 + /* "collisions.py":720 * return Shapes(s.copy() for s in self.shapes) * * def copy_leave_shapes(self) -> 'Shapes': # <<<<<<<<<<<<<< * """ * Makes a copy of this class but keeps the same shapes. */ - __pyx_codeobj__127 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_copy_leave_shapes, 687, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__127)) __PYX_ERR(0, 687, __pyx_L1_error) + __pyx_codeobj__136 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_copy_leave_shapes, 720, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__136)) __PYX_ERR(0, 720, __pyx_L1_error) - /* "collisions.py":693 + /* "collisions.py":726 * return Shapes(*self.shapes) * * def __iter__(self): # <<<<<<<<<<<<<< * return iter(self.shapes) * */ - __pyx_codeobj__128 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_iter, 693, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__128)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_codeobj__137 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_iter, 726, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__137)) __PYX_ERR(0, 726, __pyx_L1_error) - /* "collisions.py":696 + /* "collisions.py":729 * return iter(self.shapes) * * def __len__(self): # <<<<<<<<<<<<<< * return len(self.shapes) * */ - __pyx_codeobj__129 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_len, 696, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__129)) __PYX_ERR(0, 696, __pyx_L1_error) + __pyx_codeobj__138 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_len, 729, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__138)) __PYX_ERR(0, 729, __pyx_L1_error) - /* "collisions.py":699 + /* "collisions.py":732 * return len(self.shapes) * * def __getitem__(self, index: int) -> Union[Shape,'Shapes']: # <<<<<<<<<<<<<< * return self.shapes[index] * */ - __pyx_tuple__130 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_index); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(0, 699, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__130); - __Pyx_GIVEREF(__pyx_tuple__130); - __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_getitem, 699, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) __PYX_ERR(0, 699, __pyx_L1_error) + __pyx_tuple__139 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_index); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(0, 732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__139); + __Pyx_GIVEREF(__pyx_tuple__139); + __pyx_codeobj__140 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__139, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_getitem, 732, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__140)) __PYX_ERR(0, 732, __pyx_L1_error) - /* "collisions.py":702 + /* "collisions.py":735 * return self.shapes[index] * * def __setitem__(self, index: int, new: Union[Shape,'Shapes']) -> None: # <<<<<<<<<<<<<< * self.shapes[index] = new * */ - __pyx_tuple__132 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_index, __pyx_n_s_new); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(0, 702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__132); - __Pyx_GIVEREF(__pyx_tuple__132); - __pyx_codeobj__133 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_setitem, 702, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) __PYX_ERR(0, 702, __pyx_L1_error) + __pyx_tuple__141 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_index, __pyx_n_s_new); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(0, 735, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__141); + __Pyx_GIVEREF(__pyx_tuple__141); + __pyx_codeobj__142 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__141, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_setitem, 735, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__142)) __PYX_ERR(0, 735, __pyx_L1_error) - /* "collisions.py":705 + /* "collisions.py":738 * self.shapes[index] = new * * def __repr__(self): return str(self) # <<<<<<<<<<<<<< * * def __str__(self): */ - __pyx_codeobj__134 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_repr, 705, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__134)) __PYX_ERR(0, 705, __pyx_L1_error) + __pyx_codeobj__143 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_repr, 738, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__143)) __PYX_ERR(0, 738, __pyx_L1_error) - /* "collisions.py":707 + /* "collisions.py":740 * def __repr__(self): return str(self) * * def __str__(self): # <<<<<<<<<<<<<< * shpTyps = str([i.__class__.__name__ for i in self.shapes]).replace("'", "") * return f'' */ - __pyx_tuple__135 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_shpTyps, __pyx_n_s_i); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(0, 707, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__135); - __Pyx_GIVEREF(__pyx_tuple__135); - __pyx_codeobj__136 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__135, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_str, 707, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__136)) __PYX_ERR(0, 707, __pyx_L1_error) + __pyx_tuple__144 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_shpTyps, __pyx_n_s_i); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(0, 740, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__144); + __Pyx_GIVEREF(__pyx_tuple__144); + __pyx_codeobj__145 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__144, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_str, 740, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__145)) __PYX_ERR(0, 740, __pyx_L1_error) - /* "collisions.py":718 + /* "collisions.py":751 * TYPE = ShpTyps.Point * """An infintesimally small point in space defined by an x and y coordinate.""" * def __init__(self, x: Number, y: Number, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< * """ * Args: */ - __pyx_tuple__137 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_bounciness); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(0, 718, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__137); - __Pyx_GIVEREF(__pyx_tuple__137); - __pyx_codeobj__138 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__137, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_init, 718, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__138)) __PYX_ERR(0, 718, __pyx_L1_error) + __pyx_tuple__146 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_bounciness); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(0, 751, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__146); + __Pyx_GIVEREF(__pyx_tuple__146); + __pyx_codeobj__147 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__146, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_init, 751, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__147)) __PYX_ERR(0, 751, __pyx_L1_error) - /* "collisions.py":728 + /* "collisions.py":761 * self.x, self.y = x, y * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ * Returns the rectangle bounding box surrounding this point. */ - __pyx_codeobj__139 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rect, 728, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__139)) __PYX_ERR(0, 728, __pyx_L1_error) + __pyx_codeobj__148 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rect, 761, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__148)) __PYX_ERR(0, 761, __pyx_L1_error) - /* "collisions.py":737 + /* "collisions.py":770 * return self.x, self.y, self.x, self.y * * def area(self) -> Number: # <<<<<<<<<<<<<< * """ * Gets the area of the shape; 0. */ - __pyx_codeobj__140 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_area, 737, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__140)) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_codeobj__149 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_area, 770, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__149)) __PYX_ERR(0, 770, __pyx_L1_error) - /* "collisions.py":746 + /* "collisions.py":779 * return 0.0 * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_codeobj__141 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toPoints, 746, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__141)) __PYX_ERR(0, 746, __pyx_L1_error) + __pyx_codeobj__150 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toPoints, 779, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__150)) __PYX_ERR(0, 779, __pyx_L1_error) - /* "collisions.py":753 + /* "collisions.py":786 * return [self] * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * if checkShpType(othershape, ShpTyps.Point): * return self.x == othershape.x and self.y == othershape.y */ - __pyx_codeobj__142 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collides, 753, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__142)) __PYX_ERR(0, 753, __pyx_L1_error) + __pyx_codeobj__151 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collides, 786, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__151)) __PYX_ERR(0, 786, __pyx_L1_error) - /* "collisions.py":758 + /* "collisions.py":791 * return othershape._collides(self) * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * if checkShpType(othershape, ShpTyps.Point): * return [[self.x, self.y]] if (self.x == othershape.x and self.y == othershape.y) else [] */ - __pyx_codeobj__143 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_where, 758, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__143)) __PYX_ERR(0, 758, __pyx_L1_error) + __pyx_codeobj__152 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_where, 791, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__152)) __PYX_ERR(0, 791, __pyx_L1_error) - /* "collisions.py":763 + /* "collisions.py":796 * return othershape._where(self) * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike, Iterable[pointLike]]: # <<<<<<<<<<<<<< * """ * Finds the closest point ON this object TO the other shape */ - __pyx_codeobj__144 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_closestPointTo, 763, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__144)) __PYX_ERR(0, 763, __pyx_L1_error) + __pyx_codeobj__153 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__79, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_closestPointTo, 796, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__153)) __PYX_ERR(0, 796, __pyx_L1_error) - /* "collisions.py":778 + /* "collisions.py":811 * return (self.x, self.y) * * def getTuple(self) -> tuple[Number]: # <<<<<<<<<<<<<< * """ * Gets this object in a tuple format: (x, y). */ - __pyx_codeobj__145 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_getTuple, 778, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__145)) __PYX_ERR(0, 778, __pyx_L1_error) + __pyx_codeobj__154 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_getTuple, 811, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__154)) __PYX_ERR(0, 811, __pyx_L1_error) - /* "collisions.py":785 + /* "collisions.py":818 * return (self.x, self.y) * * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * return False * */ - __pyx_codeobj__146 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_contains, 785, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__146)) __PYX_ERR(0, 785, __pyx_L1_error) + __pyx_codeobj__155 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_contains, 818, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__155)) __PYX_ERR(0, 818, __pyx_L1_error) - /* "collisions.py":788 + /* "collisions.py":821 * return False * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< * oldPoint: Union['Point',pointLike], * newPoint: Union['Point', pointLike], */ - __pyx_tuple__148 = PyTuple_Pack(26, __pyx_n_s_self, __pyx_n_s_oldPoint, __pyx_n_s_newPoint, __pyx_n_s_objs, __pyx_n_s_vel, __pyx_n_s_replaceSelf, __pyx_n_s_precision, __pyx_n_s_verbose, __pyx_n_s_mvement, __pyx_n_s_points_2, __pyx_n_s_o, __pyx_n_s_cs, __pyx_n_s_closestP, __pyx_n_s_closestObj, __pyx_n_s_t, __pyx_n_s_normal, __pyx_n_s_dist_left, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_phi, __pyx_n_s_diff, __pyx_n_s_pos, __pyx_n_s_smallness, __pyx_n_s_out, __pyx_n_s_outvel, __pyx_n_s__147); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(0, 788, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__148); - __Pyx_GIVEREF(__pyx_tuple__148); - __pyx_codeobj__149 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 26, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__148, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_handleCollisionsPos, 788, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__149)) __PYX_ERR(0, 788, __pyx_L1_error) + __pyx_tuple__157 = PyTuple_Pack(26, __pyx_n_s_self, __pyx_n_s_oldPoint, __pyx_n_s_newPoint, __pyx_n_s_objs, __pyx_n_s_vel, __pyx_n_s_replaceSelf, __pyx_n_s_precision, __pyx_n_s_verbose, __pyx_n_s_mvement, __pyx_n_s_points_2, __pyx_n_s_o, __pyx_n_s_cs, __pyx_n_s_closestP, __pyx_n_s_closestObj, __pyx_n_s_t, __pyx_n_s_normal, __pyx_n_s_dist_left, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_phi, __pyx_n_s_diff, __pyx_n_s_pos, __pyx_n_s_smallness, __pyx_n_s_out, __pyx_n_s_outvel, __pyx_n_s__156); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(0, 821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__157); + __Pyx_GIVEREF(__pyx_tuple__157); + __pyx_codeobj__158 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 26, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__157, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_handleCollisionsPos, 821, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__158)) __PYX_ERR(0, 821, __pyx_L1_error) - /* "collisions.py":856 + /* "collisions.py":889 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< * vel: pointLike, * objs: Union[Shapes,Iterable[Shape]], */ - __pyx_tuple__150 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_vel, __pyx_n_s_objs, __pyx_n_s_replaceSelf, __pyx_n_s_precision, __pyx_n_s_verbose, __pyx_n_s_o); if (unlikely(!__pyx_tuple__150)) __PYX_ERR(0, 856, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__150); - __Pyx_GIVEREF(__pyx_tuple__150); - __pyx_codeobj__151 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__150, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_handleCollisionsVel, 856, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__151)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_tuple__159 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_vel, __pyx_n_s_objs, __pyx_n_s_replaceSelf, __pyx_n_s_precision, __pyx_n_s_verbose, __pyx_n_s_o); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(0, 889, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__159); + __Pyx_GIVEREF(__pyx_tuple__159); + __pyx_codeobj__160 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__159, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_handleCollisionsVel, 889, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__160)) __PYX_ERR(0, 889, __pyx_L1_error) - /* "collisions.py":886 + /* "collisions.py":919 * return o[0], o[1] * * def copy(self) -> 'Point': # <<<<<<<<<<<<<< * """ * Make a brand new Point with the same values! */ - __pyx_codeobj__152 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_copy, 886, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__152)) __PYX_ERR(0, 886, __pyx_L1_error) + __pyx_codeobj__161 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_copy, 919, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__161)) __PYX_ERR(0, 919, __pyx_L1_error) - /* "collisions.py":892 + /* "collisions.py":925 * return Point(self.x, self.y, self.bounciness) * * def __getitem__(self, item: int) -> Number: # <<<<<<<<<<<<<< * if item == 0: * return self.x */ - __pyx_tuple__153 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(0, 892, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__153); - __Pyx_GIVEREF(__pyx_tuple__153); - __pyx_codeobj__154 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_getitem, 892, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__154)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_tuple__162 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_item); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(0, 925, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__162); + __Pyx_GIVEREF(__pyx_tuple__162); + __pyx_codeobj__163 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__162, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_getitem, 925, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__163)) __PYX_ERR(0, 925, __pyx_L1_error) - /* "collisions.py":902 + /* "collisions.py":935 * ) * * def __setitem__(self, item: int, new: Number) -> None: # <<<<<<<<<<<<<< * if item == 0: * self.x = new */ - __pyx_tuple__155 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_item, __pyx_n_s_new); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(0, 902, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__155); - __Pyx_GIVEREF(__pyx_tuple__155); - __pyx_codeobj__156 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_setitem, 902, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__156)) __PYX_ERR(0, 902, __pyx_L1_error) + __pyx_tuple__164 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_item, __pyx_n_s_new); if (unlikely(!__pyx_tuple__164)) __PYX_ERR(0, 935, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__164); + __Pyx_GIVEREF(__pyx_tuple__164); + __pyx_codeobj__165 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__164, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_setitem, 935, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__165)) __PYX_ERR(0, 935, __pyx_L1_error) - /* "collisions.py":912 + /* "collisions.py":945 * ) * * def __iter__(self): # <<<<<<<<<<<<<< * return iter([self.x, self.y]) * */ - __pyx_codeobj__157 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_iter, 912, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__157)) __PYX_ERR(0, 912, __pyx_L1_error) + __pyx_codeobj__166 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_iter, 945, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__166)) __PYX_ERR(0, 945, __pyx_L1_error) - /* "collisions.py":915 + /* "collisions.py":948 * return iter([self.x, self.y]) * * def __str__(self): # <<<<<<<<<<<<<< * return f'' * */ - __pyx_codeobj__158 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_str, 915, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__158)) __PYX_ERR(0, 915, __pyx_L1_error) + __pyx_codeobj__167 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_str, 948, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__167)) __PYX_ERR(0, 948, __pyx_L1_error) - /* "collisions.py":922 + /* "collisions.py":955 * GROUPS = {ShpGroups.LINES} * TYPE = ShpTyps.Line * def __init__(self, p1: pointLike, p2: pointLike, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< * """ * Args: */ - __pyx_tuple__159 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_p1, __pyx_n_s_p2, __pyx_n_s_bounciness); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(0, 922, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__159); - __Pyx_GIVEREF(__pyx_tuple__159); - __pyx_codeobj__160 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__159, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_init, 922, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__160)) __PYX_ERR(0, 922, __pyx_L1_error) + __pyx_tuple__168 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_p1, __pyx_n_s_p2, __pyx_n_s_bounciness); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(0, 955, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__168); + __Pyx_GIVEREF(__pyx_tuple__168); + __pyx_codeobj__169 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__168, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_init, 955, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__169)) __PYX_ERR(0, 955, __pyx_L1_error) - /* "collisions.py":932 + /* "collisions.py":965 * self.p1, self.p2 = p1, p2 * * def area(self) -> Number: # <<<<<<<<<<<<<< * """ * Gets the area of the shape; the distance between the 2 points making up the line. */ - __pyx_codeobj__161 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_area, 932, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__161)) __PYX_ERR(0, 932, __pyx_L1_error) + __pyx_codeobj__170 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_area, 965, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__170)) __PYX_ERR(0, 965, __pyx_L1_error) - /* "collisions.py":941 + /* "collisions.py":974 * return math.hypot(self.p1[0]-self.p2[0], self.p1[1]-self.p2[1]) * * @property # <<<<<<<<<<<<<< * def x(self): * """One of the line's points' x value. Changing this will move the other point by the difference!""" */ - __pyx_codeobj__162 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_x, 941, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__162)) __PYX_ERR(0, 941, __pyx_L1_error) + __pyx_codeobj__171 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_x, 974, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__171)) __PYX_ERR(0, 974, __pyx_L1_error) - /* "collisions.py":945 + /* "collisions.py":978 * """One of the line's points' x value. Changing this will move the other point by the difference!""" * return self.p1[0] * @x.setter # <<<<<<<<<<<<<< * def x(self, value): * diff = value - self.p1[0] */ - __pyx_tuple__163 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_value, __pyx_n_s_diff); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(0, 945, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__163); - __Pyx_GIVEREF(__pyx_tuple__163); - __pyx_codeobj__164 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__163, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_x, 945, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__164)) __PYX_ERR(0, 945, __pyx_L1_error) + __pyx_tuple__172 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_value, __pyx_n_s_diff); if (unlikely(!__pyx_tuple__172)) __PYX_ERR(0, 978, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__172); + __Pyx_GIVEREF(__pyx_tuple__172); + __pyx_codeobj__173 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__172, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_x, 978, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__173)) __PYX_ERR(0, 978, __pyx_L1_error) - /* "collisions.py":951 + /* "collisions.py":984 * self.p2 = [self.p2[0]+diff, self.p2[1]] * * @property # <<<<<<<<<<<<<< * def y(self): * """One of the line's points' y value. Changing this will move the other point by the difference!""" */ - __pyx_codeobj__165 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_y, 951, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__165)) __PYX_ERR(0, 951, __pyx_L1_error) + __pyx_codeobj__174 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_y, 984, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__174)) __PYX_ERR(0, 984, __pyx_L1_error) - /* "collisions.py":955 + /* "collisions.py":988 * """One of the line's points' y value. Changing this will move the other point by the difference!""" * return self.p1[1] * @y.setter # <<<<<<<<<<<<<< * def y(self, value): * diff = value - self.p1[1] */ - __pyx_codeobj__166 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__163, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_y, 955, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__166)) __PYX_ERR(0, 955, __pyx_L1_error) + __pyx_codeobj__175 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__172, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_y, 988, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__175)) __PYX_ERR(0, 988, __pyx_L1_error) - /* "collisions.py":963 + /* "collisions.py":996 * # Some code yoinked off of https://www.geeksforgeeks.org/check-if-two-given-line-segments-intersect/ modified for this use case and debugged * * @staticmethod # <<<<<<<<<<<<<< * def _onSegment(p, a, b): * """ */ - __pyx_tuple__167 = PyTuple_Pack(4, __pyx_n_s_p, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_cross_product); if (unlikely(!__pyx_tuple__167)) __PYX_ERR(0, 963, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__167); - __Pyx_GIVEREF(__pyx_tuple__167); - __pyx_codeobj__168 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__167, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_onSegment, 963, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__168)) __PYX_ERR(0, 963, __pyx_L1_error) + __pyx_tuple__176 = PyTuple_Pack(4, __pyx_n_s_p, __pyx_n_s_a, __pyx_n_s_b, __pyx_n_s_cross_product); if (unlikely(!__pyx_tuple__176)) __PYX_ERR(0, 996, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__176); + __Pyx_GIVEREF(__pyx_tuple__176); + __pyx_codeobj__177 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__176, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_onSegment, 996, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__177)) __PYX_ERR(0, 996, __pyx_L1_error) - /* "collisions.py":978 + /* "collisions.py":1011 * return min(a[0], b[0]) <= p[0] <= max(a[0], b[0]) and min(a[1], b[1]) <= p[1] <= max(a[1], b[1]) * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ * Returns the rectangle bounding box surrounding this line. */ - __pyx_codeobj__169 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rect, 978, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__169)) __PYX_ERR(0, 978, __pyx_L1_error) + __pyx_codeobj__178 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rect, 1011, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__178)) __PYX_ERR(0, 1011, __pyx_L1_error) - /* "collisions.py":987 + /* "collisions.py":1020 * return min(self.p1[0], self.p2[0]), min(self.p1[1], self.p2[1]), max(self.p1[0], self.p2[0]), max(self.p1[1], self.p2[1]) * * def toLines(self) -> Iterable['Line']: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_codeobj__170 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toLines, 987, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__170)) __PYX_ERR(0, 987, __pyx_L1_error) + __pyx_codeobj__179 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toLines, 1020, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__179)) __PYX_ERR(0, 1020, __pyx_L1_error) - /* "collisions.py":994 + /* "collisions.py":1027 * return [self] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_codeobj__171 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toPoints, 994, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__171)) __PYX_ERR(0, 994, __pyx_L1_error) + __pyx_codeobj__180 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toPoints, 1027, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__180)) __PYX_ERR(0, 1027, __pyx_L1_error) - /* "collisions.py":1001 + /* "collisions.py":1034 * return [self.p1, self.p2] * * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * return False * */ - __pyx_codeobj__172 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_contains, 1001, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__172)) __PYX_ERR(0, 1001, __pyx_L1_error) + __pyx_codeobj__181 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_contains, 1034, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__181)) __PYX_ERR(0, 1034, __pyx_L1_error) - /* "collisions.py":1004 + /* "collisions.py":1037 * return False * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * if checkShpType(othershape, ShpTyps.Point): * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) */ - __pyx_tuple__173 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_direction, __pyx_n_s_direction, __pyx_n_s_d1, __pyx_n_s_d2, __pyx_n_s_d3, __pyx_n_s_d4); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(0, 1004, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__173); - __Pyx_GIVEREF(__pyx_tuple__173); - __pyx_codeobj__174 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__173, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collides, 1004, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__174)) __PYX_ERR(0, 1004, __pyx_L1_error) + __pyx_tuple__182 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_direction, __pyx_n_s_direction, __pyx_n_s_d1, __pyx_n_s_d2, __pyx_n_s_d3, __pyx_n_s_d4); if (unlikely(!__pyx_tuple__182)) __PYX_ERR(0, 1037, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__182); + __Pyx_GIVEREF(__pyx_tuple__182); + __pyx_codeobj__183 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__182, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collides, 1037, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__183)) __PYX_ERR(0, 1037, __pyx_L1_error) - /* "collisions.py":1031 + /* "collisions.py":1064 * return othershape._collides(self) * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * if checkShpType(othershape, ShpTyps.Point): * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] */ - __pyx_tuple__175 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_line, __pyx_n_s_line, __pyx_n_s_L1, __pyx_n_s_L2, __pyx_n_s_D, __pyx_n_s_Dx, __pyx_n_s_Dy, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(0, 1031, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__175); - __Pyx_GIVEREF(__pyx_tuple__175); - __pyx_codeobj__176 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__175, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_where, 1031, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__176)) __PYX_ERR(0, 1031, __pyx_L1_error) + __pyx_tuple__184 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_line, __pyx_n_s_line, __pyx_n_s_L1, __pyx_n_s_L2, __pyx_n_s_D, __pyx_n_s_Dx, __pyx_n_s_Dy, __pyx_n_s_x, __pyx_n_s_y); if (unlikely(!__pyx_tuple__184)) __PYX_ERR(0, 1064, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__184); + __Pyx_GIVEREF(__pyx_tuple__184); + __pyx_codeobj__185 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__184, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_where, 1064, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__185)) __PYX_ERR(0, 1064, __pyx_L1_error) - /* "collisions.py":1055 + /* "collisions.py":1088 * return othershape._where(self) * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLike|Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Find the closest point ON this object TO another object. */ - __pyx_tuple__177 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_returnAll, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_det, __pyx_n_s_a, __pyx_n_s_p, __pyx_n_s_colls, __pyx_n_s_calculate, __pyx_n_s_calculate, __pyx_n_s_tries, __pyx_n_s_calculate, __pyx_n_s_i, __pyx_n_s_p, __pyx_n_s_ln, __pyx_n_s_ln, __pyx_n_s_i); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(0, 1055, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__177); - __Pyx_GIVEREF(__pyx_tuple__177); - __pyx_codeobj__178 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__177, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_closestPointTo, 1055, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__178)) __PYX_ERR(0, 1055, __pyx_L1_error) + __pyx_tuple__186 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_returnAll, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_det, __pyx_n_s_a, __pyx_n_s_p, __pyx_n_s_colls, __pyx_n_s_calculate, __pyx_n_s_calculate, __pyx_n_s_tries, __pyx_n_s_calculate, __pyx_n_s_i, __pyx_n_s_p, __pyx_n_s_ln, __pyx_n_s_ln, __pyx_n_s_i); if (unlikely(!__pyx_tuple__186)) __PYX_ERR(0, 1088, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__186); + __Pyx_GIVEREF(__pyx_tuple__186); + __pyx_codeobj__187 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__186, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_closestPointTo, 1088, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__187)) __PYX_ERR(0, 1088, __pyx_L1_error) - /* "collisions.py":1129 + /* "collisions.py":1162 * return tries[0][0] * * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< * """ * Finds whether a point is on a corner of this shape. */ - __pyx_tuple__179 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_point, __pyx_n_s_precision, __pyx_n_s_rountTuple, __pyx_n_s_rountTuple); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(0, 1129, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__179); - __Pyx_GIVEREF(__pyx_tuple__179); - __pyx_codeobj__180 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_isCorner, 1129, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__180)) __PYX_ERR(0, 1129, __pyx_L1_error) + __pyx_tuple__188 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_point, __pyx_n_s_precision, __pyx_n_s_rountTuple, __pyx_n_s_rountTuple); if (unlikely(!__pyx_tuple__188)) __PYX_ERR(0, 1162, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__188); + __Pyx_GIVEREF(__pyx_tuple__188); + __pyx_codeobj__189 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__188, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_isCorner, 1162, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__189)) __PYX_ERR(0, 1162, __pyx_L1_error) - /* "collisions.py":1144 + /* "collisions.py":1177 * return rountTuple(self.p1) == rountTuple(point) or rountTuple(self.p2) == rountTuple(point) * * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< * """ * Finds the tangent on this surface to a point with a given velocity. */ - __pyx_tuple__181 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_point, __pyx_n_s_vel, __pyx_n_s_fixangle, __pyx_n_s_fixangle, __pyx_n_s_toDeg, __pyx_n_s_phi, __pyx_n_s_tries); if (unlikely(!__pyx_tuple__181)) __PYX_ERR(0, 1144, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__181); - __Pyx_GIVEREF(__pyx_tuple__181); - __pyx_codeobj__182 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_tangent, 1144, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__182)) __PYX_ERR(0, 1144, __pyx_L1_error) + __pyx_tuple__190 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_point, __pyx_n_s_vel, __pyx_n_s_fixangle, __pyx_n_s_fixangle, __pyx_n_s_toDeg, __pyx_n_s_phi, __pyx_n_s_tries); if (unlikely(!__pyx_tuple__190)) __PYX_ERR(0, 1177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__190); + __Pyx_GIVEREF(__pyx_tuple__190); + __pyx_codeobj__191 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__190, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_tangent, 1177, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__191)) __PYX_ERR(0, 1177, __pyx_L1_error) - /* "collisions.py":1169 + /* "collisions.py":1202 * return [(phi-180)%360, phi % 360][tries.index(min(tries))] * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< * oldLine: 'Line', * newLine: 'Line', */ - __pyx_tuple__183 = PyTuple_Pack(42, __pyx_n_s_self, __pyx_n_s_oldLine, __pyx_n_s_newLine, __pyx_n_s_objs, __pyx_n_s_vel, __pyx_n_s_replaceSelf, __pyx_n_s_precision, __pyx_n_s_verbose, __pyx_n_s_mvement, __pyx_n_s_points_2, __pyx_n_s_hit, __pyx_n_s_o, __pyx_n_s_ps, __pyx_n_s_p, __pyx_n_s_cPoint, __pyx_n_s_closestP, __pyx_n_s_closestObj, __pyx_n_s_newPoint, __pyx_n_s_thisNormal, __pyx_n_s_paralell, __pyx_n_s_thisIsOnP, __pyx_n_s_cLine, __pyx_n_s_colllidingLns, __pyx_n_s_sortedOtherLn, __pyx_n_s_otherLnNormal, __pyx_n_s_velDiff, __pyx_n_s_collTyp, __pyx_n_s_normal, __pyx_n_s_phi, __pyx_n_s_otherIsOnP, __pyx_n_s_dist_left, __pyx_n_s_diff, __pyx_n_s_pos, __pyx_n_s_diff2Point, __pyx_n_s_odiff, __pyx_n_s_smallness, __pyx_n_s_newp1, __pyx_n_s_newp2, __pyx_n_s_out, __pyx_n_s_outvel, __pyx_n_s_i, __pyx_n_s_i); if (unlikely(!__pyx_tuple__183)) __PYX_ERR(0, 1169, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__183); - __Pyx_GIVEREF(__pyx_tuple__183); - __pyx_codeobj__184 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 42, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__183, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_handleCollisionsPos, 1169, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__184)) __PYX_ERR(0, 1169, __pyx_L1_error) + __pyx_tuple__192 = PyTuple_Pack(42, __pyx_n_s_self, __pyx_n_s_oldLine, __pyx_n_s_newLine, __pyx_n_s_objs, __pyx_n_s_vel, __pyx_n_s_replaceSelf, __pyx_n_s_precision, __pyx_n_s_verbose, __pyx_n_s_mvement, __pyx_n_s_points_2, __pyx_n_s_hit, __pyx_n_s_o, __pyx_n_s_ps, __pyx_n_s_p, __pyx_n_s_cPoint, __pyx_n_s_closestP, __pyx_n_s_closestObj, __pyx_n_s_newPoint, __pyx_n_s_thisNormal, __pyx_n_s_paralell, __pyx_n_s_thisIsOnP, __pyx_n_s_cLine, __pyx_n_s_colllidingLns, __pyx_n_s_sortedOtherLn, __pyx_n_s_otherLnNormal, __pyx_n_s_velDiff, __pyx_n_s_collTyp, __pyx_n_s_normal, __pyx_n_s_phi, __pyx_n_s_otherIsOnP, __pyx_n_s_dist_left, __pyx_n_s_diff, __pyx_n_s_pos, __pyx_n_s_diff2Point, __pyx_n_s_odiff, __pyx_n_s_smallness, __pyx_n_s_newp1, __pyx_n_s_newp2, __pyx_n_s_out, __pyx_n_s_outvel, __pyx_n_s_i, __pyx_n_s_i); if (unlikely(!__pyx_tuple__192)) __PYX_ERR(0, 1202, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__192); + __Pyx_GIVEREF(__pyx_tuple__192); + __pyx_codeobj__193 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 42, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__192, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_handleCollisionsPos, 1202, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__193)) __PYX_ERR(0, 1202, __pyx_L1_error) - /* "collisions.py":1306 + /* "collisions.py":1339 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< * vel: pointLike, * objs: Union[Shapes, Iterable[Shape]], */ - __pyx_tuple__185 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_vel, __pyx_n_s_objs, __pyx_n_s_replaceSelf, __pyx_n_s_precision, __pyx_n_s_verbose, __pyx_n_s_o, __pyx_n_s_out, __pyx_n_s_outvel); if (unlikely(!__pyx_tuple__185)) __PYX_ERR(0, 1306, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__185); - __Pyx_GIVEREF(__pyx_tuple__185); - __pyx_codeobj__186 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__185, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_handleCollisionsVel, 1306, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__186)) __PYX_ERR(0, 1306, __pyx_L1_error) + __pyx_tuple__194 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_vel, __pyx_n_s_objs, __pyx_n_s_replaceSelf, __pyx_n_s_precision, __pyx_n_s_verbose, __pyx_n_s_o, __pyx_n_s_out, __pyx_n_s_outvel); if (unlikely(!__pyx_tuple__194)) __PYX_ERR(0, 1339, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__194); + __Pyx_GIVEREF(__pyx_tuple__194); + __pyx_codeobj__195 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__194, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_handleCollisionsVel, 1339, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__195)) __PYX_ERR(0, 1339, __pyx_L1_error) - /* "collisions.py":1338 + /* "collisions.py":1371 * return out, outvel * * def copy(self) -> 'Line': # <<<<<<<<<<<<<< * """ * Make a copy of the Line with the same values! */ - __pyx_codeobj__187 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_copy, 1338, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__187)) __PYX_ERR(0, 1338, __pyx_L1_error) + __pyx_codeobj__196 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_copy, 1371, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__196)) __PYX_ERR(0, 1371, __pyx_L1_error) - /* "collisions.py":1344 + /* "collisions.py":1377 * return Line(self.p1, self.p2, self.bounciness) * * def __getitem__(self, item: int) -> pointLike: # <<<<<<<<<<<<<< * if item == 0: * return self.p1 */ - __pyx_codeobj__188 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_getitem, 1344, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__188)) __PYX_ERR(0, 1344, __pyx_L1_error) + __pyx_codeobj__197 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__162, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_getitem, 1377, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__197)) __PYX_ERR(0, 1377, __pyx_L1_error) - /* "collisions.py":1354 + /* "collisions.py":1387 * ) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< * if item == 0: * self.p1 = new */ - __pyx_codeobj__189 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_setitem, 1354, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__189)) __PYX_ERR(0, 1354, __pyx_L1_error) + __pyx_codeobj__198 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__164, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_setitem, 1387, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__198)) __PYX_ERR(0, 1387, __pyx_L1_error) - /* "collisions.py":1364 + /* "collisions.py":1397 * ) * * def __iter__(self): # <<<<<<<<<<<<<< * return iter((self.p1, self.p2)) * */ - __pyx_codeobj__190 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_iter, 1364, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__190)) __PYX_ERR(0, 1364, __pyx_L1_error) + __pyx_codeobj__199 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_iter, 1397, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__199)) __PYX_ERR(0, 1397, __pyx_L1_error) - /* "collisions.py":1367 + /* "collisions.py":1400 * return iter((self.p1, self.p2)) * * def __str__(self): # <<<<<<<<<<<<<< * return f'' * */ - __pyx_codeobj__191 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_str, 1367, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__191)) __PYX_ERR(0, 1367, __pyx_L1_error) + __pyx_codeobj__200 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_str, 1400, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__200)) __PYX_ERR(0, 1400, __pyx_L1_error) - /* "collisions.py":1376 + /* "collisions.py":1409 * GROUPS = {ShpGroups.CLOSED, ShpGroups.NOTSTRAIGHT} * TYPE = ShpTyps.Circle * def __init__(self, x: Number, y: Number, r: Number, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< * """ * Args: */ - __pyx_tuple__192 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_bounciness); if (unlikely(!__pyx_tuple__192)) __PYX_ERR(0, 1376, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__192); - __Pyx_GIVEREF(__pyx_tuple__192); - __pyx_codeobj__193 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__192, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_init, 1376, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__193)) __PYX_ERR(0, 1376, __pyx_L1_error) + __pyx_tuple__201 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_r, __pyx_n_s_bounciness); if (unlikely(!__pyx_tuple__201)) __PYX_ERR(0, 1409, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__201); + __Pyx_GIVEREF(__pyx_tuple__201); + __pyx_codeobj__202 = (PyObject*)__Pyx_PyCode_New(5, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__201, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_init, 1409, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__202)) __PYX_ERR(0, 1409, __pyx_L1_error) - /* "collisions.py":1387 + /* "collisions.py":1420 * self.x, self.y, self.r = x, y, r * + * @property # <<<<<<<<<<<<<< + * def d(self): + * """The diameter of the circle.""" + */ + __pyx_codeobj__203 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_d, 1420, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__203)) __PYX_ERR(0, 1420, __pyx_L1_error) + + /* "collisions.py":1425 + * return self.r*2 + * + * @d.setter # <<<<<<<<<<<<<< + * def d(self, value): + * self.r = value/2 + */ + __pyx_tuple__204 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__204)) __PYX_ERR(0, 1425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__204); + __Pyx_GIVEREF(__pyx_tuple__204); + __pyx_codeobj__205 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__204, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_d, 1425, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__205)) __PYX_ERR(0, 1425, __pyx_L1_error) + + /* "collisions.py":1429 + * self.r = value/2 + * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ * Returns the rectangle bounding box surrounding this circle. */ - __pyx_codeobj__194 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rect, 1387, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__194)) __PYX_ERR(0, 1387, __pyx_L1_error) + __pyx_codeobj__206 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rect, 1429, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__206)) __PYX_ERR(0, 1429, __pyx_L1_error) - /* "collisions.py":1396 + /* "collisions.py":1438 * return self.x - self.r, self.y - self.r, self.x + self.r, self.y + self.r * * def area(self) -> Number: # <<<<<<<<<<<<<< * """ * Gets the area of the circle. */ - __pyx_codeobj__195 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_area, 1396, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__195)) __PYX_ERR(0, 1396, __pyx_L1_error) + __pyx_codeobj__207 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_area, 1438, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__207)) __PYX_ERR(0, 1438, __pyx_L1_error) - /* "collisions.py":1405 + /* "collisions.py":1447 * return math.pi * self.r**2 * * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * if checkShpType(othershape, ShpTyps.Point): * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < self.r**2 */ - __pyx_tuple__196 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_ps, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__196)) __PYX_ERR(0, 1405, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__196); - __Pyx_GIVEREF(__pyx_tuple__196); - __pyx_codeobj__197 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__196, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_contains, 1405, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__197)) __PYX_ERR(0, 1405, __pyx_L1_error) + __pyx_tuple__208 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_ps, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__208)) __PYX_ERR(0, 1447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__208); + __Pyx_GIVEREF(__pyx_tuple__208); + __pyx_codeobj__209 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__208, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_contains, 1447, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__209)) __PYX_ERR(0, 1447, __pyx_L1_error) - /* "collisions.py":1418 + /* "collisions.py":1460 * return all(self._contains(Point(*p)) for p in othershape.toPoints()) * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * if checkShpType(othershape, ShpTyps.Point): * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 <= self.r**2 */ - __pyx_tuple__198 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_line_mag, __pyx_n_s_u, __pyx_n_s_ix, __pyx_n_s_iy); if (unlikely(!__pyx_tuple__198)) __PYX_ERR(0, 1418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__198); - __Pyx_GIVEREF(__pyx_tuple__198); - __pyx_codeobj__199 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__198, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collides, 1418, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__199)) __PYX_ERR(0, 1418, __pyx_L1_error) + __pyx_tuple__210 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_line_mag, __pyx_n_s_u, __pyx_n_s_ix, __pyx_n_s_iy); if (unlikely(!__pyx_tuple__210)) __PYX_ERR(0, 1460, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__210); + __Pyx_GIVEREF(__pyx_tuple__210); + __pyx_codeobj__211 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__210, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collides, 1460, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__211)) __PYX_ERR(0, 1460, __pyx_L1_error) - /* "collisions.py":1438 + /* "collisions.py":1480 * return othershape._collides(self) * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * if checkShpType(othershape, ShpTyps.Point): * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] */ - __pyx_tuple__200 = PyTuple_Pack(29, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_sign, __pyx_n_s_sign, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_dr, __pyx_n_s_D, __pyx_n_s_discriminant, __pyx_n_s_xa, __pyx_n_s_ya, __pyx_n_s_ta, __pyx_n_s_discRoot, __pyx_n_s_xpt, __pyx_n_s_xb, __pyx_n_s_yb, __pyx_n_s_tb, __pyx_n_s_d, __pyx_n_s_r2, __pyx_n_s_a, __pyx_n_s_h, __pyx_n_s_x3, __pyx_n_s_y3, __pyx_n_s_x4, __pyx_n_s_y4); if (unlikely(!__pyx_tuple__200)) __PYX_ERR(0, 1438, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__200); - __Pyx_GIVEREF(__pyx_tuple__200); - __pyx_codeobj__201 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 29, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__200, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_where, 1438, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__201)) __PYX_ERR(0, 1438, __pyx_L1_error) + __pyx_tuple__212 = PyTuple_Pack(29, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_sign, __pyx_n_s_sign, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_dx, __pyx_n_s_dy, __pyx_n_s_dr, __pyx_n_s_D, __pyx_n_s_discriminant, __pyx_n_s_xa, __pyx_n_s_ya, __pyx_n_s_ta, __pyx_n_s_discRoot, __pyx_n_s_xpt, __pyx_n_s_xb, __pyx_n_s_yb, __pyx_n_s_tb, __pyx_n_s_d, __pyx_n_s_r2, __pyx_n_s_a, __pyx_n_s_h, __pyx_n_s_x3, __pyx_n_s_y3, __pyx_n_s_x4, __pyx_n_s_y4); if (unlikely(!__pyx_tuple__212)) __PYX_ERR(0, 1480, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__212); + __Pyx_GIVEREF(__pyx_tuple__212); + __pyx_codeobj__213 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 29, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__212, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_where, 1480, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__213)) __PYX_ERR(0, 1480, __pyx_L1_error) - /* "collisions.py":1509 + /* "collisions.py":1551 * return othershape._where(self) * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike,Iterable[pointLike]]: # <<<<<<<<<<<<<< * """ * Find the closest point ON this object TO another object. */ - __pyx_tuple__202 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_returnAll, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_phi, __pyx_n_s_angle, __pyx_n_s_qx, __pyx_n_s_qy, __pyx_n_s_wheres, __pyx_n_s_sort, __pyx_n_s_ps, __pyx_n_s_ln, __pyx_n_s_p); if (unlikely(!__pyx_tuple__202)) __PYX_ERR(0, 1509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__202); - __Pyx_GIVEREF(__pyx_tuple__202); - __pyx_codeobj__203 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__202, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_closestPointTo, 1509, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__203)) __PYX_ERR(0, 1509, __pyx_L1_error) + __pyx_tuple__214 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_returnAll, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_phi, __pyx_n_s_angle, __pyx_n_s_qx, __pyx_n_s_qy, __pyx_n_s_wheres, __pyx_n_s_sort, __pyx_n_s_ps, __pyx_n_s_ln, __pyx_n_s_p); if (unlikely(!__pyx_tuple__214)) __PYX_ERR(0, 1551, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__214); + __Pyx_GIVEREF(__pyx_tuple__214); + __pyx_codeobj__215 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__214, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_closestPointTo, 1551, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__215)) __PYX_ERR(0, 1551, __pyx_L1_error) - /* "collisions.py":1558 + /* "collisions.py":1600 * return self.closestPointTo(Point(*ps[0])) * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< * oldCir: 'Circle', * newCir: 'Circle', */ - __pyx_tuple__204 = PyTuple_Pack(33, __pyx_n_s_self, __pyx_n_s_oldCir, __pyx_n_s_newCir, __pyx_n_s_objs, __pyx_n_s_vel, __pyx_n_s_replaceSelf, __pyx_n_s_precision, __pyx_n_s_verbose, __pyx_n_s_velphi, __pyx_n_s_quart, __pyx_n_s_mvement, __pyx_n_s_points_2, __pyx_n_s_o, __pyx_n_s_cs, __pyx_n_s_closestP, __pyx_n_s_closestObj, __pyx_n_s_t, __pyx_n_s_normal, __pyx_n_s_cpoMvemnt, __pyx_n_s_dist_left, __pyx_n_s_dist_to, __pyx_n_s_ThisClosestP, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_phi, __pyx_n_s_diff, __pyx_n_s_pos, __pyx_n_s_smallness, __pyx_n_s_out, __pyx_n_s_outvel, __pyx_n_s_j, __pyx_n_s_i, __pyx_n_s__147); if (unlikely(!__pyx_tuple__204)) __PYX_ERR(0, 1558, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__204); - __Pyx_GIVEREF(__pyx_tuple__204); - __pyx_codeobj__205 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 33, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__204, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_handleCollisionsPos, 1558, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__205)) __PYX_ERR(0, 1558, __pyx_L1_error) + __pyx_tuple__216 = PyTuple_Pack(44, __pyx_n_s_self, __pyx_n_s_oldCir, __pyx_n_s_newCir, __pyx_n_s_objs, __pyx_n_s_vel, __pyx_n_s_unstuckable, __pyx_n_s_maxTries, __pyx_n_s_replaceSelf, __pyx_n_s_precision, __pyx_n_s_verbose, __pyx_n_s_velphi, __pyx_n_s_quart, __pyx_n_s_mvement, __pyx_n_s_points_2, __pyx_n_s_o, __pyx_n_s_cs, __pyx_n_s_closestP, __pyx_n_s_lns, __pyx_n_s_collP, __pyx_n_s_factor, __pyx_n_s_ln, __pyx_n_s_p, __pyx_n_s_closestObj, __pyx_n_s_calculate, __pyx_n_s_calculate, __pyx_n_s_ThisClosestP, __pyx_n_s_dist_left, __pyx_n_s_tries, __pyx_n_s_ps, __pyx_n_s_xs, __pyx_n_s_ys, __pyx_n_s_diff, __pyx_n_s_normal, __pyx_n_s_phi, __pyx_n_s_pos, __pyx_n_s_angle, __pyx_n_s_qx, __pyx_n_s_qy, __pyx_n_s_smallness, __pyx_n_s_out, __pyx_n_s_outvel, __pyx_n_s_j, __pyx_n_s_i, __pyx_n_s__156); if (unlikely(!__pyx_tuple__216)) __PYX_ERR(0, 1600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__216); + __Pyx_GIVEREF(__pyx_tuple__216); + __pyx_codeobj__217 = (PyObject*)__Pyx_PyCode_New(10, 0, 0, 44, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__216, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_handleCollisionsPos, 1600, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__217)) __PYX_ERR(0, 1600, __pyx_L1_error) - /* "collisions.py":1654 + /* "collisions.py":1732 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< * vel: pointLike, * objs: Union[Shapes,Iterable[Shape]], */ - __pyx_codeobj__206 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__150, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_handleCollisionsVel, 1654, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__206)) __PYX_ERR(0, 1654, __pyx_L1_error) + __pyx_tuple__218 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_vel, __pyx_n_s_objs, __pyx_n_s_replaceSelf, __pyx_n_s_unstuckable, __pyx_n_s_maxTries, __pyx_n_s_precision, __pyx_n_s_verbose, __pyx_n_s_o); if (unlikely(!__pyx_tuple__218)) __PYX_ERR(0, 1732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__218); + __Pyx_GIVEREF(__pyx_tuple__218); + __pyx_codeobj__219 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__218, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_handleCollisionsVel, 1732, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__219)) __PYX_ERR(0, 1732, __pyx_L1_error) - /* "collisions.py":1684 + /* "collisions.py":1768 * return o[0], o[1] * * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< * """ * Finds whether a point is on a corner of this shape. But because circles don't have any corners, this will return False. */ - __pyx_codeobj__207 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_isCorner, 1684, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__207)) __PYX_ERR(0, 1684, __pyx_L1_error) + __pyx_codeobj__220 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_isCorner, 1768, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__220)) __PYX_ERR(0, 1768, __pyx_L1_error) - /* "collisions.py":1697 + /* "collisions.py":1781 * return False * * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< * """ * Finds the tangent on this surface to a point with a given velocity. */ - __pyx_codeobj__208 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_tangent, 1697, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__208)) __PYX_ERR(0, 1697, __pyx_L1_error) + __pyx_codeobj__221 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_tangent, 1781, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__221)) __PYX_ERR(0, 1781, __pyx_L1_error) - /* "collisions.py":1712 + /* "collisions.py":1796 * return math.degrees(math.atan((point[1]-self.y)/(point[0]-self.x))) + (0 if self.x>point[0] else 180) * * def copy(self) -> 'Circle': # <<<<<<<<<<<<<< * """ * Make a replica of this object with the same object. */ - __pyx_codeobj__209 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_copy, 1712, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__209)) __PYX_ERR(0, 1712, __pyx_L1_error) + __pyx_codeobj__222 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_copy, 1796, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__222)) __PYX_ERR(0, 1796, __pyx_L1_error) - /* "collisions.py":1718 + /* "collisions.py":1802 * return Circle(self.x, self.y, self.r, self.bounciness) * * def __getitem__(self, item: int) -> Number: # <<<<<<<<<<<<<< * if item == 0: * return self.x */ - __pyx_codeobj__210 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_getitem, 1718, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__210)) __PYX_ERR(0, 1718, __pyx_L1_error) + __pyx_codeobj__223 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__162, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_getitem, 1802, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__223)) __PYX_ERR(0, 1802, __pyx_L1_error) - /* "collisions.py":1730 + /* "collisions.py":1814 * ) * * def __setitem__(self, item: int, new: Number) -> None: # <<<<<<<<<<<<<< * if item == 0: * self.x = new */ - __pyx_codeobj__211 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_setitem, 1730, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__211)) __PYX_ERR(0, 1730, __pyx_L1_error) + __pyx_codeobj__224 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__164, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_setitem, 1814, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__224)) __PYX_ERR(0, 1814, __pyx_L1_error) - /* "collisions.py":1742 + /* "collisions.py":1826 * ) * * def __iter__(self): # <<<<<<<<<<<<<< * return iter((self.x, self.y, self.r)) * */ - __pyx_codeobj__212 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_iter, 1742, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__212)) __PYX_ERR(0, 1742, __pyx_L1_error) + __pyx_codeobj__225 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_iter, 1826, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__225)) __PYX_ERR(0, 1826, __pyx_L1_error) - /* "collisions.py":1745 + /* "collisions.py":1829 * return iter((self.x, self.y, self.r)) * * def __str__(self): # <<<<<<<<<<<<<< * return f'' * */ - __pyx_codeobj__213 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_str, 1745, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__213)) __PYX_ERR(0, 1745, __pyx_L1_error) + __pyx_codeobj__226 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_str, 1829, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__226)) __PYX_ERR(0, 1829, __pyx_L1_error) - /* "collisions.py":1755 + /* "collisions.py":1841 * GROUPS = {ShpGroups.LINES, ShpGroups.NOTSTRAIGHT} * TYPE = ShpTyps.Arc * def __init__(self, # <<<<<<<<<<<<<< * x: Number, * y: Number, */ - __pyx_tuple__214 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_rad, __pyx_n_s_startAngle, __pyx_n_s_endAngle, __pyx_n_s_precision, __pyx_n_s_bounciness); if (unlikely(!__pyx_tuple__214)) __PYX_ERR(0, 1755, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__214); - __Pyx_GIVEREF(__pyx_tuple__214); - __pyx_codeobj__215 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__214, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_init, 1755, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__215)) __PYX_ERR(0, 1755, __pyx_L1_error) + __pyx_tuple__227 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_rad, __pyx_n_s_startAngle, __pyx_n_s_endAngle, __pyx_n_s_precision, __pyx_n_s_bounciness); if (unlikely(!__pyx_tuple__227)) __PYX_ERR(0, 1841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__227); + __Pyx_GIVEREF(__pyx_tuple__227); + __pyx_codeobj__228 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__227, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_init, 1841, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__228)) __PYX_ERR(0, 1841, __pyx_L1_error) - /* "collisions.py":1781 + /* "collisions.py":1867 * self.bounciness = bounciness * * def area(self) -> Number: # <<<<<<<<<<<<<< * """ * Gets the area of the shape; the length of the arc. */ - __pyx_tuple__216 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_diff); if (unlikely(!__pyx_tuple__216)) __PYX_ERR(0, 1781, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__216); - __Pyx_GIVEREF(__pyx_tuple__216); - __pyx_codeobj__217 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__216, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_area, 1781, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__217)) __PYX_ERR(0, 1781, __pyx_L1_error) + __pyx_tuple__229 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_diff); if (unlikely(!__pyx_tuple__229)) __PYX_ERR(0, 1867, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__229); + __Pyx_GIVEREF(__pyx_tuple__229); + __pyx_codeobj__230 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__229, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_area, 1867, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__230)) __PYX_ERR(0, 1867, __pyx_L1_error) - /* "collisions.py":1794 + /* "collisions.py":1880 * return (diff/360) * 2*math.pi * self.r * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * if checkShpType(othershape, ShpTyps.Point): * if round((self.x - othershape.x)**2 + (self.y - othershape.y)**2, self.precision) != round(self.r**2, self.precision): */ - __pyx_tuple__218 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_angle, __pyx_n_s_intersections, __pyx_n_s_pt, __pyx_n_s_p, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__218)) __PYX_ERR(0, 1794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__218); - __Pyx_GIVEREF(__pyx_tuple__218); - __pyx_codeobj__219 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__218, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collides, 1794, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__219)) __PYX_ERR(0, 1794, __pyx_L1_error) + __pyx_tuple__231 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_angle, __pyx_n_s_intersections, __pyx_n_s_pt, __pyx_n_s_p, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__231)) __PYX_ERR(0, 1880, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__231); + __Pyx_GIVEREF(__pyx_tuple__231); + __pyx_codeobj__232 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__231, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collides, 1880, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__232)) __PYX_ERR(0, 1880, __pyx_L1_error) - /* "collisions.py":1818 + /* "collisions.py":1904 * return othershape._collides(self) * * def flip(self): # <<<<<<<<<<<<<< * """ * Flips the portion taken to make the arc; so an arc covering 90 degrees of the circle will now cover 270, and vice versa. */ - __pyx_codeobj__220 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_flip, 1818, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__220)) __PYX_ERR(0, 1818, __pyx_L1_error) + __pyx_codeobj__233 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_flip, 1904, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__233)) __PYX_ERR(0, 1904, __pyx_L1_error) - /* "collisions.py":1824 + /* "collisions.py":1910 * self.startAng, self.endAng = self.endAng, self.startAng * * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * return False * */ - __pyx_codeobj__221 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_contains, 1824, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__221)) __PYX_ERR(0, 1824, __pyx_L1_error) + __pyx_codeobj__234 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__75, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_contains, 1910, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__234)) __PYX_ERR(0, 1910, __pyx_L1_error) - /* "collisions.py":1827 + /* "collisions.py":1913 * return False * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * if checkShpType(othershape, ShpTyps.Point): * if self._collides(othershape): */ - __pyx_tuple__222 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_intersections, __pyx_n_s_pt, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__222)) __PYX_ERR(0, 1827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__222); - __Pyx_GIVEREF(__pyx_tuple__222); - __pyx_codeobj__223 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__222, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_where, 1827, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__223)) __PYX_ERR(0, 1827, __pyx_L1_error) + __pyx_tuple__235 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_intersections, __pyx_n_s_pt, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__235)) __PYX_ERR(0, 1913, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__235); + __Pyx_GIVEREF(__pyx_tuple__235); + __pyx_codeobj__236 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__235, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_where, 1913, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__236)) __PYX_ERR(0, 1913, __pyx_L1_error) - /* "collisions.py":1840 + /* "collisions.py":1926 * return othershape._where(self) * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLike|Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Finds the closest point ON THIS OBJECT **TO** the other object */ - __pyx_tuple__224 = PyTuple_Pack(24, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_returnAll, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_phi, __pyx_n_s_angle, __pyx_n_s_qx, __pyx_n_s_qy, __pyx_n_s_cirO, __pyx_n_s_checkP, __pyx_n_s_checkP, __pyx_n_s_alls, __pyx_n_s_wheres, __pyx_n_s_closests, __pyx_n_s_ln, __pyx_n_s_cp, __pyx_n_s_ocp, __pyx_n_s_d, __pyx_n_s_i, __pyx_n_s_i, __pyx_n_s_i, __pyx_n_s_i, __pyx_n_s_i); if (unlikely(!__pyx_tuple__224)) __PYX_ERR(0, 1840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__224); - __Pyx_GIVEREF(__pyx_tuple__224); - __pyx_codeobj__225 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 24, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__224, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_closestPointTo, 1840, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__225)) __PYX_ERR(0, 1840, __pyx_L1_error) + __pyx_tuple__237 = PyTuple_Pack(24, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_returnAll, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_phi, __pyx_n_s_angle, __pyx_n_s_qx, __pyx_n_s_qy, __pyx_n_s_cirO, __pyx_n_s_checkP, __pyx_n_s_checkP, __pyx_n_s_alls, __pyx_n_s_wheres, __pyx_n_s_closests, __pyx_n_s_ln, __pyx_n_s_cp, __pyx_n_s_ocp, __pyx_n_s_d, __pyx_n_s_i, __pyx_n_s_i, __pyx_n_s_i, __pyx_n_s_i, __pyx_n_s_i); if (unlikely(!__pyx_tuple__237)) __PYX_ERR(0, 1926, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__237); + __Pyx_GIVEREF(__pyx_tuple__237); + __pyx_codeobj__238 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 24, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__237, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_closestPointTo, 1926, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__238)) __PYX_ERR(0, 1926, __pyx_L1_error) - /* "collisions.py":1922 + /* "collisions.py":2008 * return closests[0][0] * * def constrainAng(self, phi: Number) -> Number: # <<<<<<<<<<<<<< * self.startAng, self.endAng = self.startAng % 360, self.endAng % 360 * phi = phi % 360 */ - __pyx_tuple__226 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_phi, __pyx_n_s_angular_distance, __pyx_n_s_angular_distance, __pyx_n_s_dist_to_start, __pyx_n_s_dist_to_end); if (unlikely(!__pyx_tuple__226)) __PYX_ERR(0, 1922, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__226); - __Pyx_GIVEREF(__pyx_tuple__226); - __pyx_codeobj__227 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__226, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_constrainAng, 1922, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__227)) __PYX_ERR(0, 1922, __pyx_L1_error) + __pyx_tuple__239 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_phi, __pyx_n_s_angular_distance, __pyx_n_s_angular_distance, __pyx_n_s_dist_to_start, __pyx_n_s_dist_to_end); if (unlikely(!__pyx_tuple__239)) __PYX_ERR(0, 2008, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__239); + __Pyx_GIVEREF(__pyx_tuple__239); + __pyx_codeobj__240 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__239, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_constrainAng, 2008, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__240)) __PYX_ERR(0, 2008, __pyx_L1_error) - /* "collisions.py":1942 + /* "collisions.py":2028 * return phi * * def angleInRange(self, angle: Number) -> bool: # <<<<<<<<<<<<<< * """ * Check to see if an angle is in the range of this arc. */ - __pyx_tuple__228 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_angle); if (unlikely(!__pyx_tuple__228)) __PYX_ERR(0, 1942, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__228); - __Pyx_GIVEREF(__pyx_tuple__228); - __pyx_codeobj__229 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__228, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_angleInRange, 1942, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__229)) __PYX_ERR(0, 1942, __pyx_L1_error) + __pyx_tuple__241 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_angle); if (unlikely(!__pyx_tuple__241)) __PYX_ERR(0, 2028, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__241); + __Pyx_GIVEREF(__pyx_tuple__241); + __pyx_codeobj__242 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__241, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_angleInRange, 2028, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__242)) __PYX_ERR(0, 2028, __pyx_L1_error) - /* "collisions.py":1958 + /* "collisions.py":2044 * return self.startAng <= angle%360 <= self.endAng * * def endPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Gets the end points of the arc */ - __pyx_tuple__230 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_startAng, __pyx_n_s_endAng); if (unlikely(!__pyx_tuple__230)) __PYX_ERR(0, 1958, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__230); - __Pyx_GIVEREF(__pyx_tuple__230); - __pyx_codeobj__231 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__230, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_endPoints, 1958, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__231)) __PYX_ERR(0, 1958, __pyx_L1_error) + __pyx_tuple__243 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_startAng, __pyx_n_s_endAng); if (unlikely(!__pyx_tuple__243)) __PYX_ERR(0, 2044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__243); + __Pyx_GIVEREF(__pyx_tuple__243); + __pyx_codeobj__244 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__243, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_endPoints, 2044, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__244)) __PYX_ERR(0, 2044, __pyx_L1_error) - /* "collisions.py":1970 + /* "collisions.py":2056 * (self.x + self.r * math.cos(endAng), self.y + self.r * math.sin(endAng)) * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ * Returns the rectangle bounding box surrounding this object. */ - __pyx_tuple__232 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_eps, __pyx_n_s_N, __pyx_n_s_E, __pyx_n_s_S, __pyx_n_s_W); if (unlikely(!__pyx_tuple__232)) __PYX_ERR(0, 1970, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__232); - __Pyx_GIVEREF(__pyx_tuple__232); - __pyx_codeobj__233 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__232, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rect, 1970, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__233)) __PYX_ERR(0, 1970, __pyx_L1_error) + __pyx_tuple__245 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_eps, __pyx_n_s_N, __pyx_n_s_E, __pyx_n_s_S, __pyx_n_s_W); if (unlikely(!__pyx_tuple__245)) __PYX_ERR(0, 2056, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__245); + __Pyx_GIVEREF(__pyx_tuple__245); + __pyx_codeobj__246 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__245, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rect, 2056, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__246)) __PYX_ERR(0, 2056, __pyx_L1_error) - /* "collisions.py":1997 + /* "collisions.py":2083 * return E, N, W, S * * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< * """ * Finds whether a point is on a corner of this shape. */ - __pyx_tuple__234 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_point, __pyx_n_s_precision, __pyx_n_s_p); if (unlikely(!__pyx_tuple__234)) __PYX_ERR(0, 1997, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__234); - __Pyx_GIVEREF(__pyx_tuple__234); - __pyx_codeobj__235 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__234, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_isCorner, 1997, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__235)) __PYX_ERR(0, 1997, __pyx_L1_error) + __pyx_tuple__247 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_point, __pyx_n_s_precision, __pyx_n_s_p); if (unlikely(!__pyx_tuple__247)) __PYX_ERR(0, 2083, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__247); + __Pyx_GIVEREF(__pyx_tuple__247); + __pyx_codeobj__248 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__247, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_isCorner, 2083, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__248)) __PYX_ERR(0, 2083, __pyx_L1_error) - /* "collisions.py":2014 + /* "collisions.py":2100 * return False * * def toPoints(self): # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_codeobj__236 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toPoints, 2014, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__236)) __PYX_ERR(0, 2014, __pyx_L1_error) + __pyx_codeobj__249 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toPoints, 2100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__249)) __PYX_ERR(0, 2100, __pyx_L1_error) - /* "collisions.py":2024 + /* "collisions.py":2110 * ] * * def copy(self) -> 'Arc': # <<<<<<<<<<<<<< * """ * Because Noah's first arc broke, now you need another one. */ - __pyx_codeobj__237 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_copy, 2024, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__237)) __PYX_ERR(0, 2024, __pyx_L1_error) + __pyx_codeobj__250 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_copy, 2110, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__250)) __PYX_ERR(0, 2110, __pyx_L1_error) - /* "collisions.py":2030 + /* "collisions.py":2116 * return Arc(self.x, self.y, self.r, self.startAng, self.endAng, self.precision, self.bounciness) * * def __getitem__(self, item: int) -> Union[Number, pointLike]: # <<<<<<<<<<<<<< * if item == 0: * return self.x */ - __pyx_codeobj__238 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_getitem, 2030, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__238)) __PYX_ERR(0, 2030, __pyx_L1_error) + __pyx_codeobj__251 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__162, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_getitem, 2116, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__251)) __PYX_ERR(0, 2116, __pyx_L1_error) - /* "collisions.py":2046 + /* "collisions.py":2132 * ) * * def __setitem__(self, item: int, new: Union[Number, pointLike]) -> None: # <<<<<<<<<<<<<< * if item == 0: * self.x = new */ - __pyx_codeobj__239 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_setitem, 2046, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__239)) __PYX_ERR(0, 2046, __pyx_L1_error) + __pyx_codeobj__252 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__164, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_setitem, 2132, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__252)) __PYX_ERR(0, 2132, __pyx_L1_error) - /* "collisions.py":2062 + /* "collisions.py":2148 * ) * * def __iter__(self): # <<<<<<<<<<<<<< * return iter((self.x, self.y, self.r, self.startAng, self.endAng)) * */ - __pyx_codeobj__240 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_iter, 2062, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__240)) __PYX_ERR(0, 2062, __pyx_L1_error) + __pyx_codeobj__253 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_iter, 2148, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__253)) __PYX_ERR(0, 2148, __pyx_L1_error) - /* "collisions.py":2065 + /* "collisions.py":2151 * return iter((self.x, self.y, self.r, self.startAng, self.endAng)) * * def __str__(self): # <<<<<<<<<<<<<< * return f'' * */ - __pyx_codeobj__241 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_str, 2065, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__241)) __PYX_ERR(0, 2065, __pyx_L1_error) + __pyx_codeobj__254 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_str, 2151, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__254)) __PYX_ERR(0, 2151, __pyx_L1_error) - /* "collisions.py":2072 + /* "collisions.py":2158 * Please do not use this class as it is just a building block for subclasses and to provide them with some basic methods.""" - * GROUPS = {ShpGroups.CLOSED} + * GROUPS = {ShpGroups.CLOSED, ShpGroups.SPLITTABLE} * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * if not self.check_rects(othershape): * return [] */ - __pyx_tuple__242 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_i, __pyx_n_s_points_2); if (unlikely(!__pyx_tuple__242)) __PYX_ERR(0, 2072, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__242); - __Pyx_GIVEREF(__pyx_tuple__242); - __pyx_codeobj__243 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__242, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_where, 2072, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__243)) __PYX_ERR(0, 2072, __pyx_L1_error) + __pyx_tuple__255 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_i, __pyx_n_s_points_2); if (unlikely(!__pyx_tuple__255)) __PYX_ERR(0, 2158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__255); + __Pyx_GIVEREF(__pyx_tuple__255); + __pyx_codeobj__256 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__255, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_where, 2158, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__256)) __PYX_ERR(0, 2158, __pyx_L1_error) - /* "collisions.py":2086 + /* "collisions.py":2172 * return points * * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< * """ * Finds the tangent on this surface to a point with a given velocity. */ - __pyx_tuple__244 = PyTuple_Pack(16, __pyx_n_s_self, __pyx_n_s_point, __pyx_n_s_vel, __pyx_n_s_p, __pyx_n_s_ps, __pyx_n_s_origps, __pyx_n_s_degrees_to_vector, __pyx_n_s_degrees_to_vector, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_avg_x, __pyx_n_s_avg_y, __pyx_n_s_i, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__244)) __PYX_ERR(0, 2086, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__244); - __Pyx_GIVEREF(__pyx_tuple__244); - __pyx_codeobj__245 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__244, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_tangent, 2086, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__245)) __PYX_ERR(0, 2086, __pyx_L1_error) + __pyx_tuple__257 = PyTuple_Pack(16, __pyx_n_s_self, __pyx_n_s_point, __pyx_n_s_vel, __pyx_n_s_p, __pyx_n_s_ps, __pyx_n_s_origps, __pyx_n_s_degrees_to_vector, __pyx_n_s_degrees_to_vector, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_avg_x, __pyx_n_s_avg_y, __pyx_n_s_i, __pyx_n_s_pt); if (unlikely(!__pyx_tuple__257)) __PYX_ERR(0, 2172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__257); + __Pyx_GIVEREF(__pyx_tuple__257); + __pyx_codeobj__258 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 16, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__257, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_tangent, 2172, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__258)) __PYX_ERR(0, 2172, __pyx_L1_error) - /* "collisions.py":2120 + /* "collisions.py":2206 * return ps[0][0] * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike, Iterable[pointLike]]: # <<<<<<<<<<<<<< * """ * Find the closest point ON this object TO another object. */ - __pyx_tuple__246 = PyTuple_Pack(27, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_returnAll, __pyx_n_s_ps, __pyx_n_s_colls, __pyx_n_s_calculate, __pyx_n_s_calculate, __pyx_n_s_tries, __pyx_n_s_closests, __pyx_n_s_ln, __pyx_n_s_cp, __pyx_n_s_mycp, __pyx_n_s_d, __pyx_n_s_calculate, __pyx_n_s_olns, __pyx_n_s_slns, __pyx_n_s_oln, __pyx_n_s_i, __pyx_n_s_p, __pyx_n_s_ln, __pyx_n_s_i, __pyx_n_s_i, __pyx_n_s_oln, __pyx_n_s_oln, __pyx_n_s_ln, __pyx_n_s_ln, __pyx_n_s_i); if (unlikely(!__pyx_tuple__246)) __PYX_ERR(0, 2120, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__246); - __Pyx_GIVEREF(__pyx_tuple__246); - __pyx_codeobj__247 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 27, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__246, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_closestPointTo, 2120, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__247)) __PYX_ERR(0, 2120, __pyx_L1_error) + __pyx_tuple__259 = PyTuple_Pack(27, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_returnAll, __pyx_n_s_ps, __pyx_n_s_colls, __pyx_n_s_calculate, __pyx_n_s_calculate, __pyx_n_s_tries, __pyx_n_s_closests, __pyx_n_s_ln, __pyx_n_s_cp, __pyx_n_s_mycp, __pyx_n_s_d, __pyx_n_s_calculate, __pyx_n_s_olns, __pyx_n_s_slns, __pyx_n_s_oln, __pyx_n_s_i, __pyx_n_s_p, __pyx_n_s_ln, __pyx_n_s_i, __pyx_n_s_i, __pyx_n_s_oln, __pyx_n_s_oln, __pyx_n_s_ln, __pyx_n_s_ln, __pyx_n_s_i); if (unlikely(!__pyx_tuple__259)) __PYX_ERR(0, 2206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__259); + __Pyx_GIVEREF(__pyx_tuple__259); + __pyx_codeobj__260 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 27, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__259, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_closestPointTo, 2206, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__260)) __PYX_ERR(0, 2206, __pyx_L1_error) - /* "collisions.py":2200 + /* "collisions.py":2286 * return tries[0][0] * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< * oldShp: 'ClosedShape', * newShp: 'ClosedShape', */ - __pyx_tuple__248 = PyTuple_Pack(45, __pyx_n_s_self, __pyx_n_s_oldShp, __pyx_n_s_newShp, __pyx_n_s_objs, __pyx_n_s_vel, __pyx_n_s_replaceSelf, __pyx_n_s_precision, __pyx_n_s_verbose, __pyx_n_s_points_2, __pyx_n_s_hit, __pyx_n_s_oldLine, __pyx_n_s_newLine, __pyx_n_s_mvement, __pyx_n_s_o, __pyx_n_s_ps, __pyx_n_s_p, __pyx_n_s_cPoint, __pyx_n_s_pdists, __pyx_n_s_closestP, __pyx_n_s_closestObj, __pyx_n_s_newPoint, __pyx_n_s_thisNormal, __pyx_n_s_paralell, __pyx_n_s_thisIsOnP, __pyx_n_s_cLines, __pyx_n_s_cLine, __pyx_n_s_sortedOtherLn, __pyx_n_s_otherLnNormal, __pyx_n_s_velDiff, __pyx_n_s_collTyp, __pyx_n_s_normal, __pyx_n_s_phi, __pyx_n_s_otherIsOnP, __pyx_n_s_dist_left, __pyx_n_s_diff, __pyx_n_s_pos, __pyx_n_s_diff2Point, __pyx_n_s_odiff, __pyx_n_s_smallness, __pyx_n_s_newobj, __pyx_n_s_intermediateObj, __pyx_n_s_out, __pyx_n_s_outvel, __pyx_n_s_i, __pyx_n_s_i); if (unlikely(!__pyx_tuple__248)) __PYX_ERR(0, 2200, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__248); - __Pyx_GIVEREF(__pyx_tuple__248); - __pyx_codeobj__249 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 45, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__248, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_handleCollisionsPos, 2200, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__249)) __PYX_ERR(0, 2200, __pyx_L1_error) + __pyx_tuple__261 = PyTuple_Pack(45, __pyx_n_s_self, __pyx_n_s_oldShp, __pyx_n_s_newShp, __pyx_n_s_objs, __pyx_n_s_vel, __pyx_n_s_replaceSelf, __pyx_n_s_precision, __pyx_n_s_verbose, __pyx_n_s_points_2, __pyx_n_s_hit, __pyx_n_s_oldLine, __pyx_n_s_newLine, __pyx_n_s_mvement, __pyx_n_s_o, __pyx_n_s_ps, __pyx_n_s_p, __pyx_n_s_cPoint, __pyx_n_s_pdists, __pyx_n_s_closestP, __pyx_n_s_closestObj, __pyx_n_s_newPoint, __pyx_n_s_thisNormal, __pyx_n_s_paralell, __pyx_n_s_thisIsOnP, __pyx_n_s_cLines, __pyx_n_s_cLine, __pyx_n_s_sortedOtherLn, __pyx_n_s_otherLnNormal, __pyx_n_s_velDiff, __pyx_n_s_collTyp, __pyx_n_s_normal, __pyx_n_s_phi, __pyx_n_s_otherIsOnP, __pyx_n_s_dist_left, __pyx_n_s_diff, __pyx_n_s_pos, __pyx_n_s_diff2Point, __pyx_n_s_odiff, __pyx_n_s_smallness, __pyx_n_s_newobj, __pyx_n_s_intermediateObj, __pyx_n_s_out, __pyx_n_s_outvel, __pyx_n_s_i, __pyx_n_s_i); if (unlikely(!__pyx_tuple__261)) __PYX_ERR(0, 2286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__261); + __Pyx_GIVEREF(__pyx_tuple__261); + __pyx_codeobj__262 = (PyObject*)__Pyx_PyCode_New(8, 0, 0, 45, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__261, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_handleCollisionsPos, 2286, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__262)) __PYX_ERR(0, 2286, __pyx_L1_error) - /* "collisions.py":2353 + /* "collisions.py":2439 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< * vel: pointLike, * objs: Union[Shapes, Iterable[Shape]], */ - __pyx_tuple__250 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_vel, __pyx_n_s_objs, __pyx_n_s_replaceSelf, __pyx_n_s_precision, __pyx_n_s_verbose, __pyx_n_s_n, __pyx_n_s_o, __pyx_n_s_out, __pyx_n_s_outvel); if (unlikely(!__pyx_tuple__250)) __PYX_ERR(0, 2353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__250); - __Pyx_GIVEREF(__pyx_tuple__250); - __pyx_codeobj__251 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__250, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_handleCollisionsVel, 2353, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__251)) __PYX_ERR(0, 2353, __pyx_L1_error) + __pyx_tuple__263 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_vel, __pyx_n_s_objs, __pyx_n_s_replaceSelf, __pyx_n_s_precision, __pyx_n_s_verbose, __pyx_n_s_n, __pyx_n_s_o, __pyx_n_s_out, __pyx_n_s_outvel); if (unlikely(!__pyx_tuple__263)) __PYX_ERR(0, 2439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__263); + __Pyx_GIVEREF(__pyx_tuple__263); + __pyx_codeobj__264 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__263, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_handleCollisionsVel, 2439, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__264)) __PYX_ERR(0, 2439, __pyx_L1_error) - /* "collisions.py":2387 + /* "collisions.py":2473 * return out, outvel * * def _containsPoint(self, point: Point) -> bool: # <<<<<<<<<<<<<< * return self._collides(point) and self.whereCollides(point) == [] * */ - __pyx_tuple__252 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_point); if (unlikely(!__pyx_tuple__252)) __PYX_ERR(0, 2387, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__252); - __Pyx_GIVEREF(__pyx_tuple__252); - __pyx_codeobj__253 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__252, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_containsPoint, 2387, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__253)) __PYX_ERR(0, 2387, __pyx_L1_error) + __pyx_tuple__265 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_point); if (unlikely(!__pyx_tuple__265)) __PYX_ERR(0, 2473, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__265); + __Pyx_GIVEREF(__pyx_tuple__265); + __pyx_codeobj__266 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__265, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_containsPoint, 2473, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__266)) __PYX_ERR(0, 2473, __pyx_L1_error) - /* "collisions.py":2390 + /* "collisions.py":2476 * return self._collides(point) and self.whereCollides(point) == [] * * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * if checkShpType(othershape, ShpTyps.Point): * return self._containsPoint(othershape) */ - __pyx_tuple__254 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__254)) __PYX_ERR(0, 2390, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__254); - __Pyx_GIVEREF(__pyx_tuple__254); - __pyx_codeobj__255 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__254, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_contains, 2390, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__255)) __PYX_ERR(0, 2390, __pyx_L1_error) + __pyx_tuple__267 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__267)) __PYX_ERR(0, 2476, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__267); + __Pyx_GIVEREF(__pyx_tuple__267); + __pyx_codeobj__268 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__267, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_contains, 2476, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__268)) __PYX_ERR(0, 2476, __pyx_L1_error) - /* "collisions.py":2400 + /* "collisions.py":2486 * return all(self._contains(Point(*p)) for p in othershape.toPoints()) * * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< * """ * Finds whether a point is on a corner of this shape. */ - __pyx_tuple__256 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_point, __pyx_n_s_precision, __pyx_n_s_i); if (unlikely(!__pyx_tuple__256)) __PYX_ERR(0, 2400, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__256); - __Pyx_GIVEREF(__pyx_tuple__256); - __pyx_codeobj__257 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__256, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_isCorner, 2400, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__257)) __PYX_ERR(0, 2400, __pyx_L1_error) + __pyx_tuple__269 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_point, __pyx_n_s_precision, __pyx_n_s_i); if (unlikely(!__pyx_tuple__269)) __PYX_ERR(0, 2486, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__269); + __Pyx_GIVEREF(__pyx_tuple__269); + __pyx_codeobj__270 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__269, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_isCorner, 2486, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__270)) __PYX_ERR(0, 2486, __pyx_L1_error) - /* "collisions.py":2416 + /* "collisions.py":2502 * return False * * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_codeobj__258 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toLines, 2416, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__258)) __PYX_ERR(0, 2416, __pyx_L1_error) + __pyx_codeobj__271 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toLines, 2502, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__271)) __PYX_ERR(0, 2502, __pyx_L1_error) - /* "collisions.py":2423 + /* "collisions.py":2509 * return [] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_codeobj__259 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toPoints, 2423, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__259)) __PYX_ERR(0, 2423, __pyx_L1_error) + __pyx_codeobj__272 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toPoints, 2509, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__272)) __PYX_ERR(0, 2509, __pyx_L1_error) - /* "collisions.py":2430 + /* "collisions.py":2516 * return [] * * def __getitem__(self, item: int) -> pointLike: # <<<<<<<<<<<<<< * return self.toPoints()[item] * */ - __pyx_codeobj__260 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_getitem, 2430, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__260)) __PYX_ERR(0, 2430, __pyx_L1_error) + __pyx_codeobj__273 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__162, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_getitem, 2516, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__273)) __PYX_ERR(0, 2516, __pyx_L1_error) - /* "collisions.py":2433 + /* "collisions.py":2519 * return self.toPoints()[item] * * def __iter__(self): # <<<<<<<<<<<<<< * return iter(self.toPoints()) * */ - __pyx_codeobj__261 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_iter, 2433, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__261)) __PYX_ERR(0, 2433, __pyx_L1_error) + __pyx_codeobj__274 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_iter, 2519, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__274)) __PYX_ERR(0, 2519, __pyx_L1_error) - /* "collisions.py":2436 + /* "collisions.py":2522 * return iter(self.toPoints()) * * def __str__(self): # <<<<<<<<<<<<<< * return '' * */ - __pyx_codeobj__262 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_str, 2436, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__262)) __PYX_ERR(0, 2436, __pyx_L1_error) + __pyx_codeobj__275 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_str, 2522, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__275)) __PYX_ERR(0, 2522, __pyx_L1_error) - /* "collisions.py":2442 + /* "collisions.py":2528 * """A Rectangle. It is defined with an x, y, width and height.""" * TYPE = ShpTyps.Rect * def __init__(self, x: Number, y: Number, w: Number, h: Number, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< * """ * Args: */ - __pyx_tuple__263 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_w, __pyx_n_s_h, __pyx_n_s_bounciness); if (unlikely(!__pyx_tuple__263)) __PYX_ERR(0, 2442, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__263); - __Pyx_GIVEREF(__pyx_tuple__263); - __pyx_codeobj__264 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__263, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_init, 2442, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__264)) __PYX_ERR(0, 2442, __pyx_L1_error) + __pyx_tuple__276 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_w, __pyx_n_s_h, __pyx_n_s_bounciness); if (unlikely(!__pyx_tuple__276)) __PYX_ERR(0, 2528, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__276); + __Pyx_GIVEREF(__pyx_tuple__276); + __pyx_codeobj__277 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__276, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_init, 2528, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__277)) __PYX_ERR(0, 2528, __pyx_L1_error) - /* "collisions.py":2454 + /* "collisions.py":2540 * self.x, self.y, self.w, self.h = x, y, w, h * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ * Returns the rectangle bounding box surrounding this rectangle, which is virtually just the rectangle itself in a different form. */ - __pyx_codeobj__265 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rect, 2454, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__265)) __PYX_ERR(0, 2454, __pyx_L1_error) + __pyx_codeobj__278 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rect, 2540, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__278)) __PYX_ERR(0, 2540, __pyx_L1_error) - /* "collisions.py":2463 + /* "collisions.py":2549 * return min(self.x, self.x + self.w), min(self.y, self.y + self.h), max(self.x, self.x + self.w), max(self.y, self.y + self.h) * * def area(self) -> Number: # <<<<<<<<<<<<<< * """ * Gets the area of the shape; width * height. */ - __pyx_codeobj__266 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_area, 2463, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__266)) __PYX_ERR(0, 2463, __pyx_L1_error) + __pyx_codeobj__279 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_area, 2549, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__279)) __PYX_ERR(0, 2549, __pyx_L1_error) - /* "collisions.py":2472 + /* "collisions.py":2558 * return self.w * self.h * * def _containsPoint(self, point: Point) -> bool: # <<<<<<<<<<<<<< * x, y, mx, my = self.rect() * return x < point.x < mx and y < point.y and my > point.y */ - __pyx_tuple__267 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_point, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_mx, __pyx_n_s_my); if (unlikely(!__pyx_tuple__267)) __PYX_ERR(0, 2472, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__267); - __Pyx_GIVEREF(__pyx_tuple__267); - __pyx_codeobj__268 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__267, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_containsPoint, 2472, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__268)) __PYX_ERR(0, 2472, __pyx_L1_error) + __pyx_tuple__280 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_point, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_mx, __pyx_n_s_my); if (unlikely(!__pyx_tuple__280)) __PYX_ERR(0, 2558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__280); + __Pyx_GIVEREF(__pyx_tuple__280); + __pyx_codeobj__281 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__280, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_containsPoint, 2558, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__281)) __PYX_ERR(0, 2558, __pyx_L1_error) - /* "collisions.py":2476 + /* "collisions.py":2562 * return x < point.x < mx and y < point.y and my > point.y * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * x, y, mx, my = self.rect() * if checkShpType(othershape, ShpTyps.Point): */ - __pyx_tuple__269 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_mx, __pyx_n_s_my, __pyx_n_s_i, __pyx_n_s_ox, __pyx_n_s_oy, __pyx_n_s_omx, __pyx_n_s_omy, __pyx_n_s_i, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__269)) __PYX_ERR(0, 2476, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__269); - __Pyx_GIVEREF(__pyx_tuple__269); - __pyx_codeobj__270 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__269, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collides, 2476, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__270)) __PYX_ERR(0, 2476, __pyx_L1_error) + __pyx_tuple__282 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_mx, __pyx_n_s_my, __pyx_n_s_i, __pyx_n_s_ox, __pyx_n_s_oy, __pyx_n_s_omx, __pyx_n_s_omy, __pyx_n_s_i, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__282)) __PYX_ERR(0, 2562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__282); + __Pyx_GIVEREF(__pyx_tuple__282); + __pyx_codeobj__283 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__282, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collides, 2562, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__283)) __PYX_ERR(0, 2562, __pyx_L1_error) - /* "collisions.py":2507 + /* "collisions.py":2593 * return othershape._collides(self) * * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_codeobj__271 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toLines, 2507, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__271)) __PYX_ERR(0, 2507, __pyx_L1_error) + __pyx_codeobj__284 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toLines, 2593, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__284)) __PYX_ERR(0, 2593, __pyx_L1_error) - /* "collisions.py":2519 + /* "collisions.py":2605 * ] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_codeobj__272 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toPoints, 2519, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__272)) __PYX_ERR(0, 2519, __pyx_L1_error) + __pyx_codeobj__285 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toPoints, 2605, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__285)) __PYX_ERR(0, 2605, __pyx_L1_error) - /* "collisions.py":2531 + /* "collisions.py":2617 * ] * * def copy(self) -> 'Rect': # <<<<<<<<<<<<<< * """ * Clone this object using the latest cloning technology. */ - __pyx_codeobj__273 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_copy, 2531, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__273)) __PYX_ERR(0, 2531, __pyx_L1_error) + __pyx_codeobj__286 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_copy, 2617, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__286)) __PYX_ERR(0, 2617, __pyx_L1_error) - /* "collisions.py":2537 + /* "collisions.py":2623 * return Rect(self.x, self.y, self.w, self.h, self.bounciness) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< * if item == 0: * self.x, self.y = new[0], new[1] */ - __pyx_codeobj__274 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_setitem, 2537, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__274)) __PYX_ERR(0, 2537, __pyx_L1_error) + __pyx_codeobj__287 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__164, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_setitem, 2623, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__287)) __PYX_ERR(0, 2623, __pyx_L1_error) - /* "collisions.py":2551 + /* "collisions.py":2637 * ) * * def __str__(self): # <<<<<<<<<<<<<< * return f'' * */ - __pyx_codeobj__275 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_str, 2551, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__275)) __PYX_ERR(0, 2551, __pyx_L1_error) + __pyx_codeobj__288 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_str, 2637, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__288)) __PYX_ERR(0, 2637, __pyx_L1_error) - /* "collisions.py":2559 + /* "collisions.py":2645 * Defined as an x, y, width, height and rotation.""" * TYPE = ShpTyps.RotRect * def __init__(self, x: Number, y: Number, w: Number, h: Number, rotation: Number, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< * """ * Args: */ - __pyx_tuple__276 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_w, __pyx_n_s_h, __pyx_n_s_rotation, __pyx_n_s_bounciness); if (unlikely(!__pyx_tuple__276)) __PYX_ERR(0, 2559, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__276); - __Pyx_GIVEREF(__pyx_tuple__276); - __pyx_codeobj__277 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__276, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_init, 2559, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__277)) __PYX_ERR(0, 2559, __pyx_L1_error) + __pyx_tuple__289 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_w, __pyx_n_s_h, __pyx_n_s_rotation, __pyx_n_s_bounciness); if (unlikely(!__pyx_tuple__289)) __PYX_ERR(0, 2645, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__289); + __Pyx_GIVEREF(__pyx_tuple__289); + __pyx_codeobj__290 = (PyObject*)__Pyx_PyCode_New(7, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__289, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_init, 2645, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__290)) __PYX_ERR(0, 2645, __pyx_L1_error) - /* "collisions.py":2574 + /* "collisions.py":2660 * self.cacheRequirements = [] * * def getCache(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Specifically for the rotatedRect. This is a utility function to cache the rotated points so it doesn't have to re-rotate them every time. */ - __pyx_tuple__278 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_check, __pyx_n_s_angle, __pyx_n_s_cos, __pyx_n_s_sin, __pyx_n_s_rot, __pyx_n_s_rot, __pyx_n_s_i); if (unlikely(!__pyx_tuple__278)) __PYX_ERR(0, 2574, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__278); - __Pyx_GIVEREF(__pyx_tuple__278); - __pyx_codeobj__279 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__278, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_getCache, 2574, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__279)) __PYX_ERR(0, 2574, __pyx_L1_error) + __pyx_tuple__291 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_check, __pyx_n_s_angle, __pyx_n_s_cos, __pyx_n_s_sin, __pyx_n_s_rot, __pyx_n_s_rot, __pyx_n_s_i); if (unlikely(!__pyx_tuple__291)) __PYX_ERR(0, 2660, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__291); + __Pyx_GIVEREF(__pyx_tuple__291); + __pyx_codeobj__292 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__291, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_getCache, 2660, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__292)) __PYX_ERR(0, 2660, __pyx_L1_error) - /* "collisions.py":2598 + /* "collisions.py":2684 * return [[i[0]+self.x, i[1]+self.y] for i in self.cache] * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ * Returns the rectangle bounding box surrounding this rectangle. */ - __pyx_tuple__280 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_ps, __pyx_n_s_i, __pyx_n_s_i, __pyx_n_s_i, __pyx_n_s_i); if (unlikely(!__pyx_tuple__280)) __PYX_ERR(0, 2598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__280); - __Pyx_GIVEREF(__pyx_tuple__280); - __pyx_codeobj__281 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__280, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rect, 2598, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__281)) __PYX_ERR(0, 2598, __pyx_L1_error) + __pyx_tuple__293 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_ps, __pyx_n_s_i, __pyx_n_s_i, __pyx_n_s_i, __pyx_n_s_i); if (unlikely(!__pyx_tuple__293)) __PYX_ERR(0, 2684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__293); + __Pyx_GIVEREF(__pyx_tuple__293); + __pyx_codeobj__294 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__293, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rect, 2684, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__294)) __PYX_ERR(0, 2684, __pyx_L1_error) - /* "collisions.py":2608 + /* "collisions.py":2694 * return min([i[0] for i in ps]), min([i[1] for i in ps]), max([i[0] for i in ps]), max([i[1] for i in ps]) * * def area(self) -> Number: # <<<<<<<<<<<<<< * """ * Gets the area of the shape; width * height. */ - __pyx_codeobj__282 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_area, 2608, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__282)) __PYX_ERR(0, 2608, __pyx_L1_error) + __pyx_codeobj__295 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_area, 2694, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__295)) __PYX_ERR(0, 2694, __pyx_L1_error) - /* "collisions.py":2617 + /* "collisions.py":2703 * return self.w * self.h * * def _containsPoint(self, point: Point) -> bool: # <<<<<<<<<<<<<< * newp = rotate((self.x, self.y), point, -self.rot) * return self.x < newp[0] < (self.x+self.w) and self.y < newp[1] < (self.y+self.h) */ - __pyx_tuple__283 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_point, __pyx_n_s_newp); if (unlikely(!__pyx_tuple__283)) __PYX_ERR(0, 2617, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__283); - __Pyx_GIVEREF(__pyx_tuple__283); - __pyx_codeobj__284 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__283, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_containsPoint, 2617, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__284)) __PYX_ERR(0, 2617, __pyx_L1_error) + __pyx_tuple__296 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_point, __pyx_n_s_newp); if (unlikely(!__pyx_tuple__296)) __PYX_ERR(0, 2703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__296); + __Pyx_GIVEREF(__pyx_tuple__296); + __pyx_codeobj__297 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__296, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_containsPoint, 2703, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__297)) __PYX_ERR(0, 2703, __pyx_L1_error) - /* "collisions.py":2621 + /* "collisions.py":2707 * return self.x < newp[0] < (self.x+self.w) and self.y < newp[1] < (self.y+self.h) * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * if not self.check_rects(othershape): * return False */ - __pyx_tuple__285 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_newp, __pyx_n_s_li, __pyx_n_s_i, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__285)) __PYX_ERR(0, 2621, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__285); - __Pyx_GIVEREF(__pyx_tuple__285); - __pyx_codeobj__286 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__285, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collides, 2621, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__286)) __PYX_ERR(0, 2621, __pyx_L1_error) + __pyx_tuple__298 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_newp, __pyx_n_s_li, __pyx_n_s_i, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__298)) __PYX_ERR(0, 2707, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__298); + __Pyx_GIVEREF(__pyx_tuple__298); + __pyx_codeobj__299 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__298, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collides, 2707, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__299)) __PYX_ERR(0, 2707, __pyx_L1_error) - /* "collisions.py":2655 + /* "collisions.py":2741 * return othershape._collides(self) * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_codeobj__287 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toPoints, 2655, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__287)) __PYX_ERR(0, 2655, __pyx_L1_error) + __pyx_codeobj__300 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toPoints, 2741, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__300)) __PYX_ERR(0, 2741, __pyx_L1_error) - /* "collisions.py":2662 + /* "collisions.py":2748 * return self.getCache() * * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_tuple__288 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_ps, __pyx_n_s_i); if (unlikely(!__pyx_tuple__288)) __PYX_ERR(0, 2662, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__288); - __Pyx_GIVEREF(__pyx_tuple__288); - __pyx_codeobj__289 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__288, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toLines, 2662, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__289)) __PYX_ERR(0, 2662, __pyx_L1_error) + __pyx_tuple__301 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_ps, __pyx_n_s_i); if (unlikely(!__pyx_tuple__301)) __PYX_ERR(0, 2748, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__301); + __Pyx_GIVEREF(__pyx_tuple__301); + __pyx_codeobj__302 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__301, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toLines, 2748, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__302)) __PYX_ERR(0, 2748, __pyx_L1_error) - /* "collisions.py":2673 + /* "collisions.py":2759 * ] + [Line(ps[len(ps)-1], ps[0])] * * def copy(self) -> 'RotatedRect': # <<<<<<<<<<<<<< * """ * Spawn in a duplicate object */ - __pyx_codeobj__290 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_copy, 2673, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__290)) __PYX_ERR(0, 2673, __pyx_L1_error) + __pyx_codeobj__303 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_copy, 2759, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__303)) __PYX_ERR(0, 2759, __pyx_L1_error) - /* "collisions.py":2679 + /* "collisions.py":2765 * return RotatedRect(self.x, self.y, self.w, self.h, self.rot, self.bounciness) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< * def rot(x, y): * return rotate([self.x, self.y], [x, y], self.rot) */ - __pyx_tuple__291 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_item, __pyx_n_s_new, __pyx_n_s_rot, __pyx_n_s_rot); if (unlikely(!__pyx_tuple__291)) __PYX_ERR(0, 2679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__291); - __Pyx_GIVEREF(__pyx_tuple__291); - __pyx_codeobj__292 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__291, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_setitem, 2679, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__292)) __PYX_ERR(0, 2679, __pyx_L1_error) + __pyx_tuple__304 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_item, __pyx_n_s_new, __pyx_n_s_rot, __pyx_n_s_rot); if (unlikely(!__pyx_tuple__304)) __PYX_ERR(0, 2765, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__304); + __Pyx_GIVEREF(__pyx_tuple__304); + __pyx_codeobj__305 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__304, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_setitem, 2765, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__305)) __PYX_ERR(0, 2765, __pyx_L1_error) - /* "collisions.py":2699 + /* "collisions.py":2785 * ) * * def __str__(self): # <<<<<<<<<<<<<< * return f'' * */ - __pyx_codeobj__293 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_str, 2699, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__293)) __PYX_ERR(0, 2699, __pyx_L1_error) + __pyx_codeobj__306 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_str, 2785, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__306)) __PYX_ERR(0, 2785, __pyx_L1_error) - /* "collisions.py":2705 + /* "collisions.py":2791 * """A convex or concave polygon. It is defined with a list of points.""" * TYPE = ShpTyps.Polygon * def __init__(self, *points: pointLike, errorOnLT3: bool = True, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< * """ * Args: */ - __pyx_tuple__294 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_errorOnLT3, __pyx_n_s_bounciness, __pyx_n_s_points_2); if (unlikely(!__pyx_tuple__294)) __PYX_ERR(0, 2705, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__294); - __Pyx_GIVEREF(__pyx_tuple__294); - __pyx_codeobj__295 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__294, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_init, 2705, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__295)) __PYX_ERR(0, 2705, __pyx_L1_error) + __pyx_tuple__307 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_errorOnLT3, __pyx_n_s_bounciness, __pyx_n_s_points_2); if (unlikely(!__pyx_tuple__307)) __PYX_ERR(0, 2791, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__307); + __Pyx_GIVEREF(__pyx_tuple__307); + __pyx_codeobj__308 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__307, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_init, 2791, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__308)) __PYX_ERR(0, 2791, __pyx_L1_error) - /* "collisions.py":2723 + /* "collisions.py":2809 * self.points = list(points) * * @property # <<<<<<<<<<<<<< * def x(self): * """One of this object's points' x value. Changing this will move the other points by the difference!""" */ - __pyx_tuple__296 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_i); if (unlikely(!__pyx_tuple__296)) __PYX_ERR(0, 2723, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__296); - __Pyx_GIVEREF(__pyx_tuple__296); - __pyx_codeobj__297 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__296, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_x, 2723, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__297)) __PYX_ERR(0, 2723, __pyx_L1_error) + __pyx_tuple__309 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_i); if (unlikely(!__pyx_tuple__309)) __PYX_ERR(0, 2809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__309); + __Pyx_GIVEREF(__pyx_tuple__309); + __pyx_codeobj__310 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__309, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_x, 2809, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__310)) __PYX_ERR(0, 2809, __pyx_L1_error) - /* "collisions.py":2727 + /* "collisions.py":2813 * """One of this object's points' x value. Changing this will move the other points by the difference!""" * return min([i[0] for i in self.points]) * @x.setter # <<<<<<<<<<<<<< * def x(self, new): * diff = new - self.x */ - __pyx_tuple__298 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_new, __pyx_n_s_diff, __pyx_n_s_i); if (unlikely(!__pyx_tuple__298)) __PYX_ERR(0, 2727, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__298); - __Pyx_GIVEREF(__pyx_tuple__298); - __pyx_codeobj__299 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__298, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_x, 2727, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__299)) __PYX_ERR(0, 2727, __pyx_L1_error) + __pyx_tuple__311 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_new, __pyx_n_s_diff, __pyx_n_s_i); if (unlikely(!__pyx_tuple__311)) __PYX_ERR(0, 2813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__311); + __Pyx_GIVEREF(__pyx_tuple__311); + __pyx_codeobj__312 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__311, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_x, 2813, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__312)) __PYX_ERR(0, 2813, __pyx_L1_error) - /* "collisions.py":2731 + /* "collisions.py":2817 * diff = new - self.x * self.points = [[i[0]+diff, i[1]] for i in self.points] * @property # <<<<<<<<<<<<<< * def y(self): * """One of this object's points' y value. Changing this will move the other points by the difference!""" */ - __pyx_codeobj__300 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__296, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_y, 2731, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__300)) __PYX_ERR(0, 2731, __pyx_L1_error) + __pyx_codeobj__313 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__309, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_y, 2817, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__313)) __PYX_ERR(0, 2817, __pyx_L1_error) - /* "collisions.py":2735 + /* "collisions.py":2821 * """One of this object's points' y value. Changing this will move the other points by the difference!""" * return min([i[1] for i in self.points]) * @y.setter # <<<<<<<<<<<<<< * def y(self, new): * diff = new - self.y */ - __pyx_codeobj__301 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__298, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_y, 2735, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__301)) __PYX_ERR(0, 2735, __pyx_L1_error) + __pyx_codeobj__314 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__311, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_y, 2821, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__314)) __PYX_ERR(0, 2821, __pyx_L1_error) - /* "collisions.py":2740 + /* "collisions.py":2826 * self.points = [[i[0], i[1]+diff] for i in self.points] * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ * Returns the rectangle bounding box surrounding this polygon. */ - __pyx_tuple__302 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_i, __pyx_n_s_i, __pyx_n_s_i, __pyx_n_s_i); if (unlikely(!__pyx_tuple__302)) __PYX_ERR(0, 2740, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__302); - __Pyx_GIVEREF(__pyx_tuple__302); - __pyx_codeobj__303 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__302, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rect, 2740, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__303)) __PYX_ERR(0, 2740, __pyx_L1_error) + __pyx_tuple__315 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_i, __pyx_n_s_i, __pyx_n_s_i, __pyx_n_s_i); if (unlikely(!__pyx_tuple__315)) __PYX_ERR(0, 2826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__315); + __Pyx_GIVEREF(__pyx_tuple__315); + __pyx_codeobj__316 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__315, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_rect, 2826, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__316)) __PYX_ERR(0, 2826, __pyx_L1_error) - /* "collisions.py":2749 + /* "collisions.py":2835 * return min([i[0] for i in self.points]), min([i[1] for i in self.points]), max([i[0] for i in self.points]), max([i[1] for i in self.points]) * * def area(self) -> Number: # <<<<<<<<<<<<<< * """ * Gets the area of the shape. */ - __pyx_codeobj__304 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__122, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_area, 2749, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__304)) __PYX_ERR(0, 2749, __pyx_L1_error) + __pyx_codeobj__317 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__131, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_area, 2835, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__317)) __PYX_ERR(0, 2835, __pyx_L1_error) - /* "collisions.py":2761 + /* "collisions.py":2847 * ) + (self.points[len(self.points)-1][0] * self.points[0][1] - self.points[0][0] * self.points[len(self.points)-1][1])) / 2 * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * if not self.check_rects(othershape): * return False */ - __pyx_tuple__305 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_ps, __pyx_n_s_c, __pyx_n_s_j, __pyx_n_s_i, __pyx_n_s_li, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__305)) __PYX_ERR(0, 2761, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__305); - __Pyx_GIVEREF(__pyx_tuple__305); - __pyx_codeobj__306 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__305, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collides, 2761, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__306)) __PYX_ERR(0, 2761, __pyx_L1_error) + __pyx_tuple__318 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_othershape, __pyx_n_s_ps, __pyx_n_s_c, __pyx_n_s_j, __pyx_n_s_i, __pyx_n_s_li, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__318)) __PYX_ERR(0, 2847, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__318); + __Pyx_GIVEREF(__pyx_tuple__318); + __pyx_codeobj__319 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__318, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_collides, 2847, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__319)) __PYX_ERR(0, 2847, __pyx_L1_error) - /* "collisions.py":2807 + /* "collisions.py":2893 * return othershape._collides(self) * * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_codeobj__307 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__296, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toLines, 2807, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__307)) __PYX_ERR(0, 2807, __pyx_L1_error) + __pyx_codeobj__320 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__309, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toLines, 2893, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__320)) __PYX_ERR(0, 2893, __pyx_L1_error) - /* "collisions.py":2817 + /* "collisions.py":2903 * ] + [Line(self.points[len(self.points)-1], self.points[0])] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_codeobj__308 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__296, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toPoints, 2817, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__308)) __PYX_ERR(0, 2817, __pyx_L1_error) + __pyx_codeobj__321 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__309, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_toPoints, 2903, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__321)) __PYX_ERR(0, 2903, __pyx_L1_error) - /* "collisions.py":2824 + /* "collisions.py":2910 * return [list(i) for i in self.points] * * def copy(self) -> 'Polygon': # <<<<<<<<<<<<<< * """ * And then he lifted his arms and said, 'LET THERE BE ANOTHER!' */ - __pyx_codeobj__309 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_copy, 2824, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__309)) __PYX_ERR(0, 2824, __pyx_L1_error) + __pyx_codeobj__322 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_copy, 2910, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__322)) __PYX_ERR(0, 2910, __pyx_L1_error) - /* "collisions.py":2830 + /* "collisions.py":2916 * return Polygon(*self.points, errorOnLT3=False, bounciness=self.bounciness) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< * self.points[item] = new * */ - __pyx_codeobj__310 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_setitem, 2830, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__310)) __PYX_ERR(0, 2830, __pyx_L1_error) + __pyx_codeobj__323 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__164, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_setitem, 2916, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__323)) __PYX_ERR(0, 2916, __pyx_L1_error) - /* "collisions.py":2833 + /* "collisions.py":2919 * self.points[item] = new * * def __str__(self): # <<<<<<<<<<<<<< * return f'' * */ - __pyx_codeobj__311 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_str, 2833, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__311)) __PYX_ERR(0, 2833, __pyx_L1_error) + __pyx_codeobj__324 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__73, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_str, 2919, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__324)) __PYX_ERR(0, 2919, __pyx_L1_error) - /* "collisions.py":2839 + /* "collisions.py":2925 * """A class to combine shapes together. You do not actually need to create an object of this as all the methods are static. * Instead you just run things like `ShapeCombiner.combineRects(rect1, rect2, rect3)`.""" * @staticmethod # <<<<<<<<<<<<<< * def boundingBox(*shapes: Rect) -> Shapes: * """ */ - __pyx_tuple__312 = PyTuple_Pack(10, __pyx_n_s_shapes, __pyx_n_s_rs, __pyx_n_s_mins, __pyx_n_s_maxs, __pyx_n_s_s, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__312)) __PYX_ERR(0, 2839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__312); - __Pyx_GIVEREF(__pyx_tuple__312); - __pyx_codeobj__313 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__312, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_boundingBox, 2839, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__313)) __PYX_ERR(0, 2839, __pyx_L1_error) + __pyx_tuple__325 = PyTuple_Pack(10, __pyx_n_s_shapes, __pyx_n_s_rs, __pyx_n_s_mins, __pyx_n_s_maxs, __pyx_n_s_s, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__325)) __PYX_ERR(0, 2925, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__325); + __Pyx_GIVEREF(__pyx_tuple__325); + __pyx_codeobj__326 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__325, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_boundingBox, 2925, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__326)) __PYX_ERR(0, 2925, __pyx_L1_error) - /* "collisions.py":2863 + /* "collisions.py":2949 * )) * * @staticmethod # <<<<<<<<<<<<<< * def combineRects(*shapes: Rect) -> Shapes: * """ */ - __pyx_tuple__314 = PyTuple_Pack(9, __pyx_n_s_shapes, __pyx_n_s_others, __pyx_n_s_merged, __pyx_n_s_outshapes1, __pyx_n_s_rect, __pyx_n_s_i, __pyx_n_s_outshapes2, __pyx_n_s_i, __pyx_n_s_i); if (unlikely(!__pyx_tuple__314)) __PYX_ERR(0, 2863, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__314); - __Pyx_GIVEREF(__pyx_tuple__314); - __pyx_codeobj__315 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__314, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_combineRects, 2863, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__315)) __PYX_ERR(0, 2863, __pyx_L1_error) + __pyx_tuple__327 = PyTuple_Pack(9, __pyx_n_s_shapes, __pyx_n_s_others, __pyx_n_s_merged, __pyx_n_s_outshapes1, __pyx_n_s_rect, __pyx_n_s_i, __pyx_n_s_outshapes2, __pyx_n_s_i, __pyx_n_s_i); if (unlikely(!__pyx_tuple__327)) __PYX_ERR(0, 2949, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__327); + __Pyx_GIVEREF(__pyx_tuple__327); + __pyx_codeobj__328 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__327, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_combineRects, 2949, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__328)) __PYX_ERR(0, 2949, __pyx_L1_error) - /* "collisions.py":2917 + /* "collisions.py":3003 * return Shapes(*shapes, *others) * * @staticmethod # <<<<<<<<<<<<<< * def union(*shapes: Shape) -> Shapes: # FIXME * """ */ - __pyx_tuple__316 = PyTuple_Pack(31, __pyx_n_s_shapes, __pyx_n_s_reformat, __pyx_n_s_reformat, __pyx_n_s_reform, __pyx_n_s_outshps, __pyx_n_s_s, __pyx_n_s_colls, __pyx_n_s_i, __pyx_n_s_newpts, __pyx_n_s_oshps, __pyx_n_s_lns, __pyx_n_s_direc, __pyx_n_s_check, __pyx_n_s_checked, __pyx_n_s_ps, __pyx_n_s_j, __pyx_n_s_ln, __pyx_n_s_p1, __pyx_n_s_p2, __pyx_n_s_wheres, __pyx_n_s_other, __pyx_n_s_k, __pyx_n_s_ws, __pyx_n_s_s, __pyx_n_s_i, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_j, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s__147); if (unlikely(!__pyx_tuple__316)) __PYX_ERR(0, 2917, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__316); - __Pyx_GIVEREF(__pyx_tuple__316); - __pyx_codeobj__317 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 31, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__316, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_union, 2917, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__317)) __PYX_ERR(0, 2917, __pyx_L1_error) + __pyx_tuple__329 = PyTuple_Pack(31, __pyx_n_s_shapes, __pyx_n_s_reformat, __pyx_n_s_reformat, __pyx_n_s_reform, __pyx_n_s_outshps, __pyx_n_s_s, __pyx_n_s_colls, __pyx_n_s_i, __pyx_n_s_newpts, __pyx_n_s_oshps, __pyx_n_s_lns, __pyx_n_s_direc, __pyx_n_s_check, __pyx_n_s_checked, __pyx_n_s_ps, __pyx_n_s_j, __pyx_n_s_ln, __pyx_n_s_p1, __pyx_n_s_p2, __pyx_n_s_wheres, __pyx_n_s_other, __pyx_n_s_k, __pyx_n_s_ws, __pyx_n_s_s, __pyx_n_s_i, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_j, __pyx_n_s_genexpr, __pyx_n_s_genexpr, __pyx_n_s__156); if (unlikely(!__pyx_tuple__329)) __PYX_ERR(0, 3003, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__329); + __Pyx_GIVEREF(__pyx_tuple__329); + __pyx_codeobj__330 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 31, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__329, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_union, 3003, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__330)) __PYX_ERR(0, 3003, __pyx_L1_error) - /* "collisions.py":2986 + /* "collisions.py":3072 * return Shapes(*outshps) * * @staticmethod # <<<<<<<<<<<<<< * def pointsToShape(*points: Iterable[pointLike], bounciness: float = BASEBOUNCINESS) -> Shape: * """ */ - __pyx_tuple__318 = PyTuple_Pack(8, __pyx_n_s_bounciness, __pyx_n_s_points_2, __pyx_n_s_x_vals, __pyx_n_s_y_vals, __pyx_n_s_x_min, __pyx_n_s_y_min, __pyx_n_s_p, __pyx_n_s_p); if (unlikely(!__pyx_tuple__318)) __PYX_ERR(0, 2986, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__318); - __Pyx_GIVEREF(__pyx_tuple__318); - __pyx_codeobj__319 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__318, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_pointsToShape, 2986, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__319)) __PYX_ERR(0, 2986, __pyx_L1_error) + __pyx_tuple__331 = PyTuple_Pack(8, __pyx_n_s_bounciness, __pyx_n_s_points_2, __pyx_n_s_x_vals, __pyx_n_s_y_vals, __pyx_n_s_x_min, __pyx_n_s_y_min, __pyx_n_s_p, __pyx_n_s_p); if (unlikely(!__pyx_tuple__331)) __PYX_ERR(0, 3072, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__331); + __Pyx_GIVEREF(__pyx_tuple__331); + __pyx_codeobj__332 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__331, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_pointsToShape, 3072, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__332)) __PYX_ERR(0, 3072, __pyx_L1_error) - /* "collisions.py":3025 + /* "collisions.py":3111 * return Polygon(*points, bounciness=bounciness) * * @staticmethod # <<<<<<<<<<<<<< * def pointsToPoly(*points: list[Point], ratio: Number = 0.1) -> Union[Shape, Shapes]: * """ */ - __pyx_tuple__320 = PyTuple_Pack(3, __pyx_n_s_ratio, __pyx_n_s_points_2, __pyx_n_s_i); if (unlikely(!__pyx_tuple__320)) __PYX_ERR(0, 3025, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__320); - __Pyx_GIVEREF(__pyx_tuple__320); - __pyx_codeobj__321 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__320, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_pointsToPoly, 3025, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__321)) __PYX_ERR(0, 3025, __pyx_L1_error) + __pyx_tuple__333 = PyTuple_Pack(3, __pyx_n_s_ratio, __pyx_n_s_points_2, __pyx_n_s_i); if (unlikely(!__pyx_tuple__333)) __PYX_ERR(0, 3111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__333); + __Pyx_GIVEREF(__pyx_tuple__333); + __pyx_codeobj__334 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__333, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_pointsToPoly, 3111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__334)) __PYX_ERR(0, 3111, __pyx_L1_error) - /* "collisions.py":3041 + /* "collisions.py":3127 * return shapelyToColl(shapely.concave_hull(shapelyGeom.MultiPoint([tuple(i) for i in points]), ratio=ratio)) * * @staticmethod # <<<<<<<<<<<<<< * def shapelyUnion(*shapes: Shape) -> Shape: * """ */ - __pyx_tuple__322 = PyTuple_Pack(1, __pyx_n_s_shapes); if (unlikely(!__pyx_tuple__322)) __PYX_ERR(0, 3041, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__322); - __Pyx_GIVEREF(__pyx_tuple__322); - __pyx_codeobj__323 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__322, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_shapelyUnion, 3041, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__323)) __PYX_ERR(0, 3041, __pyx_L1_error) + __pyx_tuple__335 = PyTuple_Pack(1, __pyx_n_s_shapes); if (unlikely(!__pyx_tuple__335)) __PYX_ERR(0, 3127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__335); + __Pyx_GIVEREF(__pyx_tuple__335); + __pyx_codeobj__336 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__335, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_lib_collisions_py, __pyx_n_s_shapelyUnion, 3127, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__336)) __PYX_ERR(0, 3127, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -111794,6 +115097,8 @@ static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) { __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_50 = PyInt_FromLong(50); if (unlikely(!__pyx_int_50)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_90 = PyInt_FromLong(90); if (unlikely(!__pyx_int_90)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_180 = PyInt_FromLong(180); if (unlikely(!__pyx_int_180)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_270 = PyInt_FromLong(270); if (unlikely(!__pyx_int_270)) __PYX_ERR(0, 1, __pyx_L1_error) @@ -111858,34 +115163,34 @@ static int __Pyx_modinit_type_init_code(void) { __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct__genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct__genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct__genexpr)) __PYX_ERR(0, 669, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct__genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 669, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct__closestPointTo = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct__closestPointTo_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct__closestPointTo)) __PYX_ERR(0, 595, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct__closestPointTo_spec, __pyx_ptype_10collisions___pyx_scope_struct__closestPointTo) < 0) __PYX_ERR(0, 595, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct__genexpr = &__pyx_type_10collisions___pyx_scope_struct__genexpr; + __pyx_ptype_10collisions___pyx_scope_struct__closestPointTo = &__pyx_type_10collisions___pyx_scope_struct__closestPointTo; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct__genexpr) < 0) __PYX_ERR(0, 669, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct__closestPointTo) < 0) __PYX_ERR(0, 595, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct__genexpr->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct__closestPointTo->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct__genexpr->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct__genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct__genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct__closestPointTo->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct__closestPointTo->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct__closestPointTo->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_1_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_1_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_1_genexpr)) __PYX_ERR(0, 679, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_1_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 679, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_1_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_1_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_1_genexpr)) __PYX_ERR(0, 702, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_1_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 702, __pyx_L1_error) #else __pyx_ptype_10collisions___pyx_scope_struct_1_genexpr = &__pyx_type_10collisions___pyx_scope_struct_1_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 679, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 702, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_10collisions___pyx_scope_struct_1_genexpr->tp_print = 0; @@ -111896,15 +115201,15 @@ static int __Pyx_modinit_type_init_code(void) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_2_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_2_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_2_genexpr)) __PYX_ERR(0, 679, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_2_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 679, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_2_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_2_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_2_genexpr)) __PYX_ERR(0, 712, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_2_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 712, __pyx_L1_error) #else __pyx_ptype_10collisions___pyx_scope_struct_2_genexpr = &__pyx_type_10collisions___pyx_scope_struct_2_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 679, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 712, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_10collisions___pyx_scope_struct_2_genexpr->tp_print = 0; @@ -111915,15 +115220,15 @@ static int __Pyx_modinit_type_init_code(void) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_3_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_3_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_3_genexpr)) __PYX_ERR(0, 679, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_3_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 679, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_3_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_3_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_3_genexpr)) __PYX_ERR(0, 712, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_3_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 712, __pyx_L1_error) #else __pyx_ptype_10collisions___pyx_scope_struct_3_genexpr = &__pyx_type_10collisions___pyx_scope_struct_3_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 679, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 712, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_10collisions___pyx_scope_struct_3_genexpr->tp_print = 0; @@ -111934,15 +115239,15 @@ static int __Pyx_modinit_type_init_code(void) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_4_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_4_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_4_genexpr)) __PYX_ERR(0, 679, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_4_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 679, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_4_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_4_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_4_genexpr)) __PYX_ERR(0, 712, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_4_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 712, __pyx_L1_error) #else __pyx_ptype_10collisions___pyx_scope_struct_4_genexpr = &__pyx_type_10collisions___pyx_scope_struct_4_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 679, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_4_genexpr) < 0) __PYX_ERR(0, 712, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_10collisions___pyx_scope_struct_4_genexpr->tp_print = 0; @@ -111953,15 +115258,15 @@ static int __Pyx_modinit_type_init_code(void) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_5_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_5_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_5_genexpr)) __PYX_ERR(0, 685, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_5_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 685, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_5_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_5_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_5_genexpr)) __PYX_ERR(0, 712, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_5_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 712, __pyx_L1_error) #else __pyx_ptype_10collisions___pyx_scope_struct_5_genexpr = &__pyx_type_10collisions___pyx_scope_struct_5_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 685, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_5_genexpr) < 0) __PYX_ERR(0, 712, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_10collisions___pyx_scope_struct_5_genexpr->tp_print = 0; @@ -111972,471 +115277,471 @@ static int __Pyx_modinit_type_init_code(void) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_6_handleCollisionsPos = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_6_handleCollisionsPos_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_6_handleCollisionsPos)) __PYX_ERR(0, 788, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_6_handleCollisionsPos_spec, __pyx_ptype_10collisions___pyx_scope_struct_6_handleCollisionsPos) < 0) __PYX_ERR(0, 788, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_6_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_6_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_6_genexpr)) __PYX_ERR(0, 718, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_6_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 718, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_6_handleCollisionsPos = &__pyx_type_10collisions___pyx_scope_struct_6_handleCollisionsPos; + __pyx_ptype_10collisions___pyx_scope_struct_6_genexpr = &__pyx_type_10collisions___pyx_scope_struct_6_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_6_handleCollisionsPos) < 0) __PYX_ERR(0, 788, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_6_genexpr) < 0) __PYX_ERR(0, 718, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_6_handleCollisionsPos->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_6_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_6_handleCollisionsPos->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_6_handleCollisionsPos->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_6_handleCollisionsPos->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_6_genexpr->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_6_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_6_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_7_closestPointTo = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_7_closestPointTo_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_7_closestPointTo)) __PYX_ERR(0, 1055, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_7_closestPointTo_spec, __pyx_ptype_10collisions___pyx_scope_struct_7_closestPointTo) < 0) __PYX_ERR(0, 1055, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_7_handleCollisionsPos = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_7_handleCollisionsPos_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_7_handleCollisionsPos)) __PYX_ERR(0, 821, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_7_handleCollisionsPos_spec, __pyx_ptype_10collisions___pyx_scope_struct_7_handleCollisionsPos) < 0) __PYX_ERR(0, 821, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_7_closestPointTo = &__pyx_type_10collisions___pyx_scope_struct_7_closestPointTo; + __pyx_ptype_10collisions___pyx_scope_struct_7_handleCollisionsPos = &__pyx_type_10collisions___pyx_scope_struct_7_handleCollisionsPos; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_7_closestPointTo) < 0) __PYX_ERR(0, 1055, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_7_handleCollisionsPos) < 0) __PYX_ERR(0, 821, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_7_closestPointTo->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_7_handleCollisionsPos->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_7_closestPointTo->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_7_closestPointTo->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_7_closestPointTo->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_7_handleCollisionsPos->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_7_handleCollisionsPos->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_7_handleCollisionsPos->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_8_isCorner = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_8_isCorner_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_8_isCorner)) __PYX_ERR(0, 1129, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_8_isCorner_spec, __pyx_ptype_10collisions___pyx_scope_struct_8_isCorner) < 0) __PYX_ERR(0, 1129, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_8_closestPointTo = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_8_closestPointTo_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_8_closestPointTo)) __PYX_ERR(0, 1088, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_8_closestPointTo_spec, __pyx_ptype_10collisions___pyx_scope_struct_8_closestPointTo) < 0) __PYX_ERR(0, 1088, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_8_isCorner = &__pyx_type_10collisions___pyx_scope_struct_8_isCorner; + __pyx_ptype_10collisions___pyx_scope_struct_8_closestPointTo = &__pyx_type_10collisions___pyx_scope_struct_8_closestPointTo; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_8_isCorner) < 0) __PYX_ERR(0, 1129, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_8_closestPointTo) < 0) __PYX_ERR(0, 1088, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_8_isCorner->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_8_closestPointTo->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_8_isCorner->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_8_isCorner->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_8_isCorner->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_8_closestPointTo->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_8_closestPointTo->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_8_closestPointTo->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_9__contains = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_9__contains_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_9__contains)) __PYX_ERR(0, 1405, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_9__contains_spec, __pyx_ptype_10collisions___pyx_scope_struct_9__contains) < 0) __PYX_ERR(0, 1405, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_9_isCorner = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_9_isCorner_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_9_isCorner)) __PYX_ERR(0, 1162, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_9_isCorner_spec, __pyx_ptype_10collisions___pyx_scope_struct_9_isCorner) < 0) __PYX_ERR(0, 1162, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_9__contains = &__pyx_type_10collisions___pyx_scope_struct_9__contains; + __pyx_ptype_10collisions___pyx_scope_struct_9_isCorner = &__pyx_type_10collisions___pyx_scope_struct_9_isCorner; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_9__contains) < 0) __PYX_ERR(0, 1405, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_9_isCorner) < 0) __PYX_ERR(0, 1162, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_9__contains->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_9_isCorner->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_9__contains->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_9__contains->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_9__contains->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_9_isCorner->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_9_isCorner->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_9_isCorner->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_10_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_10_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_10_genexpr)) __PYX_ERR(0, 1416, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_10_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_10_genexpr) < 0) __PYX_ERR(0, 1416, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_10__contains = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_10__contains_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_10__contains)) __PYX_ERR(0, 1447, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_10__contains_spec, __pyx_ptype_10collisions___pyx_scope_struct_10__contains) < 0) __PYX_ERR(0, 1447, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_10_genexpr = &__pyx_type_10collisions___pyx_scope_struct_10_genexpr; + __pyx_ptype_10collisions___pyx_scope_struct_10__contains = &__pyx_type_10collisions___pyx_scope_struct_10__contains; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_10_genexpr) < 0) __PYX_ERR(0, 1416, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_10__contains) < 0) __PYX_ERR(0, 1447, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_10_genexpr->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_10__contains->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_10_genexpr->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_10_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_10_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_10__contains->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_10__contains->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_10__contains->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_11_closestPointTo = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_11_closestPointTo_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_11_closestPointTo)) __PYX_ERR(0, 1509, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_11_closestPointTo_spec, __pyx_ptype_10collisions___pyx_scope_struct_11_closestPointTo) < 0) __PYX_ERR(0, 1509, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_11_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_11_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_11_genexpr)) __PYX_ERR(0, 1458, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_11_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_11_genexpr) < 0) __PYX_ERR(0, 1458, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_11_closestPointTo = &__pyx_type_10collisions___pyx_scope_struct_11_closestPointTo; + __pyx_ptype_10collisions___pyx_scope_struct_11_genexpr = &__pyx_type_10collisions___pyx_scope_struct_11_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_11_closestPointTo) < 0) __PYX_ERR(0, 1509, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_11_genexpr) < 0) __PYX_ERR(0, 1458, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_11_closestPointTo->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_11_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_11_closestPointTo->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_11_closestPointTo->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_11_closestPointTo->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_11_genexpr->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_11_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_11_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_12_handleCollisionsPos = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_12_handleCollisionsPos_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_12_handleCollisionsPos)) __PYX_ERR(0, 1558, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_12_handleCollisionsPos_spec, __pyx_ptype_10collisions___pyx_scope_struct_12_handleCollisionsPos) < 0) __PYX_ERR(0, 1558, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_12_closestPointTo = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_12_closestPointTo_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_12_closestPointTo)) __PYX_ERR(0, 1551, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_12_closestPointTo_spec, __pyx_ptype_10collisions___pyx_scope_struct_12_closestPointTo) < 0) __PYX_ERR(0, 1551, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_12_handleCollisionsPos = &__pyx_type_10collisions___pyx_scope_struct_12_handleCollisionsPos; + __pyx_ptype_10collisions___pyx_scope_struct_12_closestPointTo = &__pyx_type_10collisions___pyx_scope_struct_12_closestPointTo; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_12_handleCollisionsPos) < 0) __PYX_ERR(0, 1558, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_12_closestPointTo) < 0) __PYX_ERR(0, 1551, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_12_handleCollisionsPos->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_12_closestPointTo->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_12_handleCollisionsPos->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_12_handleCollisionsPos->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_12_handleCollisionsPos->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_12_closestPointTo->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_12_closestPointTo->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_12_closestPointTo->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_13__collides = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_13__collides_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_13__collides)) __PYX_ERR(0, 1794, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_13__collides_spec, __pyx_ptype_10collisions___pyx_scope_struct_13__collides) < 0) __PYX_ERR(0, 1794, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_13_handleCollisionsPos = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_13_handleCollisionsPos_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_13_handleCollisionsPos)) __PYX_ERR(0, 1600, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_13_handleCollisionsPos_spec, __pyx_ptype_10collisions___pyx_scope_struct_13_handleCollisionsPos) < 0) __PYX_ERR(0, 1600, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_13__collides = &__pyx_type_10collisions___pyx_scope_struct_13__collides; + __pyx_ptype_10collisions___pyx_scope_struct_13_handleCollisionsPos = &__pyx_type_10collisions___pyx_scope_struct_13_handleCollisionsPos; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_13__collides) < 0) __PYX_ERR(0, 1794, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_13_handleCollisionsPos) < 0) __PYX_ERR(0, 1600, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_13__collides->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_13_handleCollisionsPos->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_13__collides->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_13__collides->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_13__collides->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_13_handleCollisionsPos->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_13_handleCollisionsPos->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_13_handleCollisionsPos->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_14_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_14_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_14_genexpr)) __PYX_ERR(0, 1802, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_14_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_14_genexpr) < 0) __PYX_ERR(0, 1802, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_14__collides = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_14__collides_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_14__collides)) __PYX_ERR(0, 1880, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_14__collides_spec, __pyx_ptype_10collisions___pyx_scope_struct_14__collides) < 0) __PYX_ERR(0, 1880, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_14_genexpr = &__pyx_type_10collisions___pyx_scope_struct_14_genexpr; + __pyx_ptype_10collisions___pyx_scope_struct_14__collides = &__pyx_type_10collisions___pyx_scope_struct_14__collides; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_14_genexpr) < 0) __PYX_ERR(0, 1802, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_14__collides) < 0) __PYX_ERR(0, 1880, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_14_genexpr->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_14__collides->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_14_genexpr->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_14_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_14_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_14__collides->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_14__collides->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_14__collides->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_15_closestPointTo = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_15_closestPointTo_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_15_closestPointTo)) __PYX_ERR(0, 1840, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_15_closestPointTo_spec, __pyx_ptype_10collisions___pyx_scope_struct_15_closestPointTo) < 0) __PYX_ERR(0, 1840, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_15_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_15_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_15_genexpr)) __PYX_ERR(0, 1888, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_15_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_15_genexpr) < 0) __PYX_ERR(0, 1888, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_15_closestPointTo = &__pyx_type_10collisions___pyx_scope_struct_15_closestPointTo; + __pyx_ptype_10collisions___pyx_scope_struct_15_genexpr = &__pyx_type_10collisions___pyx_scope_struct_15_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_15_closestPointTo) < 0) __PYX_ERR(0, 1840, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_15_genexpr) < 0) __PYX_ERR(0, 1888, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_15_closestPointTo->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_15_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_15_closestPointTo->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_15_closestPointTo->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_15_closestPointTo->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_15_genexpr->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_15_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_15_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_16_tangent = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_16_tangent_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_16_tangent)) __PYX_ERR(0, 2086, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_16_tangent_spec, __pyx_ptype_10collisions___pyx_scope_struct_16_tangent) < 0) __PYX_ERR(0, 2086, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_16_closestPointTo = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_16_closestPointTo_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_16_closestPointTo)) __PYX_ERR(0, 1926, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_16_closestPointTo_spec, __pyx_ptype_10collisions___pyx_scope_struct_16_closestPointTo) < 0) __PYX_ERR(0, 1926, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_16_tangent = &__pyx_type_10collisions___pyx_scope_struct_16_tangent; + __pyx_ptype_10collisions___pyx_scope_struct_16_closestPointTo = &__pyx_type_10collisions___pyx_scope_struct_16_closestPointTo; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_16_tangent) < 0) __PYX_ERR(0, 2086, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_16_closestPointTo) < 0) __PYX_ERR(0, 1926, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_16_tangent->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_16_closestPointTo->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_16_tangent->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_16_tangent->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_16_tangent->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_16_closestPointTo->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_16_closestPointTo->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_16_closestPointTo->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_17_closestPointTo = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_17_closestPointTo_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_17_closestPointTo)) __PYX_ERR(0, 2120, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_17_closestPointTo_spec, __pyx_ptype_10collisions___pyx_scope_struct_17_closestPointTo) < 0) __PYX_ERR(0, 2120, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_17_tangent = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_17_tangent_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_17_tangent)) __PYX_ERR(0, 2172, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_17_tangent_spec, __pyx_ptype_10collisions___pyx_scope_struct_17_tangent) < 0) __PYX_ERR(0, 2172, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_17_closestPointTo = &__pyx_type_10collisions___pyx_scope_struct_17_closestPointTo; + __pyx_ptype_10collisions___pyx_scope_struct_17_tangent = &__pyx_type_10collisions___pyx_scope_struct_17_tangent; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_17_closestPointTo) < 0) __PYX_ERR(0, 2120, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_17_tangent) < 0) __PYX_ERR(0, 2172, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_17_closestPointTo->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_17_tangent->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_17_closestPointTo->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_17_closestPointTo->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_17_closestPointTo->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_17_tangent->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_17_tangent->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_17_tangent->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_18__contains = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_18__contains_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_18__contains)) __PYX_ERR(0, 2390, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_18__contains_spec, __pyx_ptype_10collisions___pyx_scope_struct_18__contains) < 0) __PYX_ERR(0, 2390, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_18_closestPointTo = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_18_closestPointTo_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_18_closestPointTo)) __PYX_ERR(0, 2206, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_18_closestPointTo_spec, __pyx_ptype_10collisions___pyx_scope_struct_18_closestPointTo) < 0) __PYX_ERR(0, 2206, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_18__contains = &__pyx_type_10collisions___pyx_scope_struct_18__contains; + __pyx_ptype_10collisions___pyx_scope_struct_18_closestPointTo = &__pyx_type_10collisions___pyx_scope_struct_18_closestPointTo; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_18__contains) < 0) __PYX_ERR(0, 2390, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_18_closestPointTo) < 0) __PYX_ERR(0, 2206, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_18__contains->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_18_closestPointTo->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_18__contains->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_18__contains->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_18__contains->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_18_closestPointTo->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_18_closestPointTo->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_18_closestPointTo->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_19_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_19_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_19_genexpr)) __PYX_ERR(0, 2398, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_19_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_19_genexpr) < 0) __PYX_ERR(0, 2398, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_19__contains = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_19__contains_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_19__contains)) __PYX_ERR(0, 2476, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_19__contains_spec, __pyx_ptype_10collisions___pyx_scope_struct_19__contains) < 0) __PYX_ERR(0, 2476, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_19_genexpr = &__pyx_type_10collisions___pyx_scope_struct_19_genexpr; + __pyx_ptype_10collisions___pyx_scope_struct_19__contains = &__pyx_type_10collisions___pyx_scope_struct_19__contains; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_19_genexpr) < 0) __PYX_ERR(0, 2398, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_19__contains) < 0) __PYX_ERR(0, 2476, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_19_genexpr->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_19__contains->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_19_genexpr->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_19_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_19_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_19__contains->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_19__contains->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_19__contains->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_20__collides = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_20__collides_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_20__collides)) __PYX_ERR(0, 2476, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_20__collides_spec, __pyx_ptype_10collisions___pyx_scope_struct_20__collides) < 0) __PYX_ERR(0, 2476, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_20_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_20_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_20_genexpr)) __PYX_ERR(0, 2484, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_20_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_20_genexpr) < 0) __PYX_ERR(0, 2484, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_20__collides = &__pyx_type_10collisions___pyx_scope_struct_20__collides; + __pyx_ptype_10collisions___pyx_scope_struct_20_genexpr = &__pyx_type_10collisions___pyx_scope_struct_20_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_20__collides) < 0) __PYX_ERR(0, 2476, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_20_genexpr) < 0) __PYX_ERR(0, 2484, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_20__collides->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_20_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_20__collides->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_20__collides->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_20__collides->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_20_genexpr->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_20_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_20_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_21_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_21_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_21_genexpr)) __PYX_ERR(0, 2496, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_21_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_21_genexpr) < 0) __PYX_ERR(0, 2496, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_21__collides = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_21__collides_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_21__collides)) __PYX_ERR(0, 2562, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_21__collides_spec, __pyx_ptype_10collisions___pyx_scope_struct_21__collides) < 0) __PYX_ERR(0, 2562, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_21_genexpr = &__pyx_type_10collisions___pyx_scope_struct_21_genexpr; + __pyx_ptype_10collisions___pyx_scope_struct_21__collides = &__pyx_type_10collisions___pyx_scope_struct_21__collides; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_21_genexpr) < 0) __PYX_ERR(0, 2496, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_21__collides) < 0) __PYX_ERR(0, 2562, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_21_genexpr->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_21__collides->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_21_genexpr->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_21_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_21_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_21__collides->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_21__collides->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_21__collides->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_22_getCache = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_22_getCache_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_22_getCache)) __PYX_ERR(0, 2574, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_22_getCache_spec, __pyx_ptype_10collisions___pyx_scope_struct_22_getCache) < 0) __PYX_ERR(0, 2574, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_22_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_22_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_22_genexpr)) __PYX_ERR(0, 2582, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_22_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_22_genexpr) < 0) __PYX_ERR(0, 2582, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_22_getCache = &__pyx_type_10collisions___pyx_scope_struct_22_getCache; + __pyx_ptype_10collisions___pyx_scope_struct_22_genexpr = &__pyx_type_10collisions___pyx_scope_struct_22_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_22_getCache) < 0) __PYX_ERR(0, 2574, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_22_genexpr) < 0) __PYX_ERR(0, 2582, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_22_getCache->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_22_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_22_getCache->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_22_getCache->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_22_getCache->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_22_genexpr->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_22_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_22_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_23__collides = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_23__collides_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_23__collides)) __PYX_ERR(0, 2621, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_23__collides_spec, __pyx_ptype_10collisions___pyx_scope_struct_23__collides) < 0) __PYX_ERR(0, 2621, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_23_getCache = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_23_getCache_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_23_getCache)) __PYX_ERR(0, 2660, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_23_getCache_spec, __pyx_ptype_10collisions___pyx_scope_struct_23_getCache) < 0) __PYX_ERR(0, 2660, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_23__collides = &__pyx_type_10collisions___pyx_scope_struct_23__collides; + __pyx_ptype_10collisions___pyx_scope_struct_23_getCache = &__pyx_type_10collisions___pyx_scope_struct_23_getCache; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_23__collides) < 0) __PYX_ERR(0, 2621, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_23_getCache) < 0) __PYX_ERR(0, 2660, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_23__collides->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_23_getCache->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_23__collides->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_23__collides->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_23__collides->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_23_getCache->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_23_getCache->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_23_getCache->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_24_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_24_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_24_genexpr)) __PYX_ERR(0, 2642, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_24_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_24_genexpr) < 0) __PYX_ERR(0, 2642, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_24__collides = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_24__collides_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_24__collides)) __PYX_ERR(0, 2707, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_24__collides_spec, __pyx_ptype_10collisions___pyx_scope_struct_24__collides) < 0) __PYX_ERR(0, 2707, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_24_genexpr = &__pyx_type_10collisions___pyx_scope_struct_24_genexpr; + __pyx_ptype_10collisions___pyx_scope_struct_24__collides = &__pyx_type_10collisions___pyx_scope_struct_24__collides; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_24_genexpr) < 0) __PYX_ERR(0, 2642, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_24__collides) < 0) __PYX_ERR(0, 2707, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_24_genexpr->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_24__collides->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_24_genexpr->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_24_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_24_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_24__collides->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_24__collides->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_24__collides->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_25___setitem__ = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_25___setitem___spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_25___setitem__)) __PYX_ERR(0, 2679, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_25___setitem___spec, __pyx_ptype_10collisions___pyx_scope_struct_25___setitem__) < 0) __PYX_ERR(0, 2679, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_25_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_25_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_25_genexpr)) __PYX_ERR(0, 2728, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_25_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_25_genexpr) < 0) __PYX_ERR(0, 2728, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_25___setitem__ = &__pyx_type_10collisions___pyx_scope_struct_25___setitem__; + __pyx_ptype_10collisions___pyx_scope_struct_25_genexpr = &__pyx_type_10collisions___pyx_scope_struct_25_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_25___setitem__) < 0) __PYX_ERR(0, 2679, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_25_genexpr) < 0) __PYX_ERR(0, 2728, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_25___setitem__->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_25_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_25___setitem__->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_25___setitem__->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_25___setitem__->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_25_genexpr->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_25_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_25_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_26_area = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_26_area_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_26_area)) __PYX_ERR(0, 2749, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_26_area_spec, __pyx_ptype_10collisions___pyx_scope_struct_26_area) < 0) __PYX_ERR(0, 2749, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_26___setitem__ = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_26___setitem___spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_26___setitem__)) __PYX_ERR(0, 2765, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_26___setitem___spec, __pyx_ptype_10collisions___pyx_scope_struct_26___setitem__) < 0) __PYX_ERR(0, 2765, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_26_area = &__pyx_type_10collisions___pyx_scope_struct_26_area; + __pyx_ptype_10collisions___pyx_scope_struct_26___setitem__ = &__pyx_type_10collisions___pyx_scope_struct_26___setitem__; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_26_area) < 0) __PYX_ERR(0, 2749, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_26___setitem__) < 0) __PYX_ERR(0, 2765, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_26_area->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_26___setitem__->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_26_area->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_26_area->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_26_area->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_26___setitem__->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_26___setitem__->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_26___setitem__->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_27_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_27_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_27_genexpr)) __PYX_ERR(0, 2757, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_27_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_27_genexpr) < 0) __PYX_ERR(0, 2757, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_27_area = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_27_area_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_27_area)) __PYX_ERR(0, 2835, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_27_area_spec, __pyx_ptype_10collisions___pyx_scope_struct_27_area) < 0) __PYX_ERR(0, 2835, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_27_genexpr = &__pyx_type_10collisions___pyx_scope_struct_27_genexpr; + __pyx_ptype_10collisions___pyx_scope_struct_27_area = &__pyx_type_10collisions___pyx_scope_struct_27_area; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_27_genexpr) < 0) __PYX_ERR(0, 2757, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_27_area) < 0) __PYX_ERR(0, 2835, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_27_genexpr->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_27_area->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_27_genexpr->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_27_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_27_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_27_area->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_27_area->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_27_area->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_28__collides = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_28__collides_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_28__collides)) __PYX_ERR(0, 2761, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_28__collides_spec, __pyx_ptype_10collisions___pyx_scope_struct_28__collides) < 0) __PYX_ERR(0, 2761, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_28_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_28_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_28_genexpr)) __PYX_ERR(0, 2843, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_28_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_28_genexpr) < 0) __PYX_ERR(0, 2843, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_28__collides = &__pyx_type_10collisions___pyx_scope_struct_28__collides; + __pyx_ptype_10collisions___pyx_scope_struct_28_genexpr = &__pyx_type_10collisions___pyx_scope_struct_28_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_28__collides) < 0) __PYX_ERR(0, 2761, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_28_genexpr) < 0) __PYX_ERR(0, 2843, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_28__collides->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_28_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_28__collides->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_28__collides->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_28__collides->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_28_genexpr->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_28_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_28_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_29_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_29_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_29_genexpr)) __PYX_ERR(0, 2789, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_29_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_29_genexpr) < 0) __PYX_ERR(0, 2789, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_29__collides = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_29__collides_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_29__collides)) __PYX_ERR(0, 2847, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_29__collides_spec, __pyx_ptype_10collisions___pyx_scope_struct_29__collides) < 0) __PYX_ERR(0, 2847, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_29_genexpr = &__pyx_type_10collisions___pyx_scope_struct_29_genexpr; + __pyx_ptype_10collisions___pyx_scope_struct_29__collides = &__pyx_type_10collisions___pyx_scope_struct_29__collides; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_29_genexpr) < 0) __PYX_ERR(0, 2789, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_29__collides) < 0) __PYX_ERR(0, 2847, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_29_genexpr->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_29__collides->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_29_genexpr->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_29_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_29_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_29__collides->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_29__collides->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_29__collides->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_30_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_30_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_30_genexpr)) __PYX_ERR(0, 2851, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_30_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_30_genexpr) < 0) __PYX_ERR(0, 2851, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_30_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_30_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_30_genexpr)) __PYX_ERR(0, 2875, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_30_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_30_genexpr) < 0) __PYX_ERR(0, 2875, __pyx_L1_error) #else __pyx_ptype_10collisions___pyx_scope_struct_30_genexpr = &__pyx_type_10collisions___pyx_scope_struct_30_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_30_genexpr) < 0) __PYX_ERR(0, 2851, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_30_genexpr) < 0) __PYX_ERR(0, 2875, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_10collisions___pyx_scope_struct_30_genexpr->tp_print = 0; @@ -112447,15 +115752,15 @@ static int __Pyx_modinit_type_init_code(void) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_31_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_31_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_31_genexpr)) __PYX_ERR(0, 2852, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_31_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_31_genexpr) < 0) __PYX_ERR(0, 2852, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_31_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_31_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_31_genexpr)) __PYX_ERR(0, 2937, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_31_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_31_genexpr) < 0) __PYX_ERR(0, 2937, __pyx_L1_error) #else __pyx_ptype_10collisions___pyx_scope_struct_31_genexpr = &__pyx_type_10collisions___pyx_scope_struct_31_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_31_genexpr) < 0) __PYX_ERR(0, 2852, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_31_genexpr) < 0) __PYX_ERR(0, 2937, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_10collisions___pyx_scope_struct_31_genexpr->tp_print = 0; @@ -112466,15 +115771,15 @@ static int __Pyx_modinit_type_init_code(void) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_32_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_32_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_32_genexpr)) __PYX_ERR(0, 2854, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_32_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_32_genexpr) < 0) __PYX_ERR(0, 2854, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_32_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_32_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_32_genexpr)) __PYX_ERR(0, 2938, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_32_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_32_genexpr) < 0) __PYX_ERR(0, 2938, __pyx_L1_error) #else __pyx_ptype_10collisions___pyx_scope_struct_32_genexpr = &__pyx_type_10collisions___pyx_scope_struct_32_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_32_genexpr) < 0) __PYX_ERR(0, 2854, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_32_genexpr) < 0) __PYX_ERR(0, 2938, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_10collisions___pyx_scope_struct_32_genexpr->tp_print = 0; @@ -112485,15 +115790,15 @@ static int __Pyx_modinit_type_init_code(void) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_33_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_33_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_33_genexpr)) __PYX_ERR(0, 2855, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_33_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_33_genexpr) < 0) __PYX_ERR(0, 2855, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_33_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_33_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_33_genexpr)) __PYX_ERR(0, 2940, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_33_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_33_genexpr) < 0) __PYX_ERR(0, 2940, __pyx_L1_error) #else __pyx_ptype_10collisions___pyx_scope_struct_33_genexpr = &__pyx_type_10collisions___pyx_scope_struct_33_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_33_genexpr) < 0) __PYX_ERR(0, 2855, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_33_genexpr) < 0) __PYX_ERR(0, 2940, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 __pyx_ptype_10collisions___pyx_scope_struct_33_genexpr->tp_print = 0; @@ -112504,41 +115809,60 @@ static int __Pyx_modinit_type_init_code(void) { } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_34_union = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_34_union_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_34_union)) __PYX_ERR(0, 2917, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_34_union_spec, __pyx_ptype_10collisions___pyx_scope_struct_34_union) < 0) __PYX_ERR(0, 2917, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_34_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_34_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_34_genexpr)) __PYX_ERR(0, 2941, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_34_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_34_genexpr) < 0) __PYX_ERR(0, 2941, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_34_union = &__pyx_type_10collisions___pyx_scope_struct_34_union; + __pyx_ptype_10collisions___pyx_scope_struct_34_genexpr = &__pyx_type_10collisions___pyx_scope_struct_34_genexpr; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_34_union) < 0) __PYX_ERR(0, 2917, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_34_genexpr) < 0) __PYX_ERR(0, 2941, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_34_union->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_34_genexpr->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_34_union->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_34_union->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_34_union->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_34_genexpr->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_34_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_34_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_10collisions___pyx_scope_struct_35_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_35_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_35_genexpr)) __PYX_ERR(0, 2949, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_35_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_35_genexpr) < 0) __PYX_ERR(0, 2949, __pyx_L1_error) + __pyx_ptype_10collisions___pyx_scope_struct_35_union = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_35_union_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_35_union)) __PYX_ERR(0, 3003, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_35_union_spec, __pyx_ptype_10collisions___pyx_scope_struct_35_union) < 0) __PYX_ERR(0, 3003, __pyx_L1_error) #else - __pyx_ptype_10collisions___pyx_scope_struct_35_genexpr = &__pyx_type_10collisions___pyx_scope_struct_35_genexpr; + __pyx_ptype_10collisions___pyx_scope_struct_35_union = &__pyx_type_10collisions___pyx_scope_struct_35_union; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_35_genexpr) < 0) __PYX_ERR(0, 2949, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_35_union) < 0) __PYX_ERR(0, 3003, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_10collisions___pyx_scope_struct_35_genexpr->tp_print = 0; + __pyx_ptype_10collisions___pyx_scope_struct_35_union->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_35_genexpr->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_35_genexpr->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_10collisions___pyx_scope_struct_35_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_35_union->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_35_union->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_35_union->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; + } + #endif + #if CYTHON_USE_TYPE_SPECS + __pyx_ptype_10collisions___pyx_scope_struct_36_genexpr = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_10collisions___pyx_scope_struct_36_genexpr_spec, NULL); if (unlikely(!__pyx_ptype_10collisions___pyx_scope_struct_36_genexpr)) __PYX_ERR(0, 3035, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_10collisions___pyx_scope_struct_36_genexpr_spec, __pyx_ptype_10collisions___pyx_scope_struct_36_genexpr) < 0) __PYX_ERR(0, 3035, __pyx_L1_error) + #else + __pyx_ptype_10collisions___pyx_scope_struct_36_genexpr = &__pyx_type_10collisions___pyx_scope_struct_36_genexpr; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + #endif + #if !CYTHON_USE_TYPE_SPECS + if (__Pyx_PyType_Ready(__pyx_ptype_10collisions___pyx_scope_struct_36_genexpr) < 0) __PYX_ERR(0, 3035, __pyx_L1_error) + #endif + #if PY_MAJOR_VERSION < 3 + __pyx_ptype_10collisions___pyx_scope_struct_36_genexpr->tp_print = 0; + #endif + #if !CYTHON_COMPILING_IN_LIMITED_API + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_10collisions___pyx_scope_struct_36_genexpr->tp_dictoffset && __pyx_ptype_10collisions___pyx_scope_struct_36_genexpr->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_10collisions___pyx_scope_struct_36_genexpr->tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict; } #endif __Pyx_RefNannyFinishContext(); @@ -112865,7 +116189,7 @@ if (!__Pyx_RefNanny) { /* "collisions.py":1 * import math # <<<<<<<<<<<<<< * from enum import IntEnum - * from typing import Union, Iterable, Any, Dict + * from typing import Union, Iterable, Any */ __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_math, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -112875,7 +116199,7 @@ if (!__Pyx_RefNanny) { /* "collisions.py":2 * import math * from enum import IntEnum # <<<<<<<<<<<<<< - * from typing import Union, Iterable, Any, Dict + * from typing import Union, Iterable, Any * */ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2, __pyx_L1_error) @@ -112895,11 +116219,11 @@ if (!__Pyx_RefNanny) { /* "collisions.py":3 * import math * from enum import IntEnum - * from typing import Union, Iterable, Any, Dict # <<<<<<<<<<<<<< + * from typing import Union, Iterable, Any # <<<<<<<<<<<<<< * * # Just for utility funcs, not the actual collision library */ - __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error) + __pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_n_s_Union); __Pyx_GIVEREF(__pyx_n_s_Union); @@ -112910,9 +116234,6 @@ if (!__Pyx_RefNanny) { __Pyx_INCREF(__pyx_n_s_Any); __Pyx_GIVEREF(__pyx_n_s_Any); if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_Any)) __PYX_ERR(0, 3, __pyx_L1_error); - __Pyx_INCREF(__pyx_n_s_Dict); - __Pyx_GIVEREF(__pyx_n_s_Dict); - if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_Dict)) __PYX_ERR(0, 3, __pyx_L1_error); __pyx_t_2 = __Pyx_Import(__pyx_n_s_typing, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; @@ -112928,10 +116249,6 @@ if (!__Pyx_RefNanny) { __Pyx_GOTREF(__pyx_t_3); if (PyDict_SetItem(__pyx_d, __pyx_n_s_Any, __pyx_t_3) < 0) __PYX_ERR(0, 3, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Dict, __pyx_t_3) < 0) __PYX_ERR(0, 3, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "collisions.py":6 @@ -113048,7 +116365,7 @@ if (!__Pyx_RefNanny) { * import shapely.ops as shapelyOps * */ - __pyx_t_7 = __Pyx_ImportDottedModule(__pyx_n_s_shapely_geometry, __pyx_tuple__38); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 11, __pyx_L1_error) + __pyx_t_7 = __Pyx_ImportDottedModule(__pyx_n_s_shapely_geometry, __pyx_tuple__42); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_shapelyGeom, __pyx_t_7) < 0) __PYX_ERR(0, 11, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -113060,7 +116377,7 @@ if (!__Pyx_RefNanny) { * * Number = Union[int, float] */ - __pyx_t_7 = __Pyx_ImportDottedModule(__pyx_n_s_shapely_ops, __pyx_tuple__39); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 12, __pyx_L1_error) + __pyx_t_7 = __Pyx_ImportDottedModule(__pyx_n_s_shapely_ops, __pyx_tuple__43); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_shapelyOps, __pyx_t_7) < 0) __PYX_ERR(0, 12, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -113251,7 +116568,7 @@ if (!__Pyx_RefNanny) { * if pygame is None: * raise ImportError( */ - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_1checkForPygame, 0, __pyx_n_s_checkForPygame, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_1checkForPygame, 0, __pyx_n_s_checkForPygame, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (PyDict_SetItem(__pyx_d, __pyx_n_s_checkForPygame, __pyx_t_2) < 0) __PYX_ERR(0, 49, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -113269,7 +116586,7 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 55, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_angle, __pyx_n_s_Number) < 0) __PYX_ERR(0, 55, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 55, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3rotate, 0, __pyx_n_s_rotate, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 55, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3rotate, 0, __pyx_n_s_rotate, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 55, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -113288,7 +116605,7 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 78, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_angle, __pyx_n_s_Number) < 0) __PYX_ERR(0, 78, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 78, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5rotateBy0, 0, __pyx_n_s_rotateBy0, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5rotateBy0, 0, __pyx_n_s_rotateBy0, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -113307,7 +116624,7 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fromPoint, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 97, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_toPoint, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 97, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 97, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7direction, 0, __pyx_n_s_direction, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 97, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7direction, 0, __pyx_n_s_direction, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 97, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -113326,9 +116643,9 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_angle, __pyx_n_s_Number) < 0) __PYX_ERR(0, 110, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_strength, __pyx_n_s_Number) < 0) __PYX_ERR(0, 110, __pyx_L1_error) if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 110, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_9pointOnCircle, 0, __pyx_n_s_pointOnCircle, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_9pointOnCircle, 0, __pyx_n_s_pointOnCircle, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__49); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__53); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; if (PyDict_SetItem(__pyx_d, __pyx_n_s_pointOnCircle, __pyx_t_2) < 0) __PYX_ERR(0, 110, __pyx_L1_error) @@ -113382,18 +116699,27 @@ if (!__Pyx_RefNanny) { * """Shapes that make the outer edges of other shapes""" * NOTSTRAIGHT = 2 # <<<<<<<<<<<<<< * """Shapes that are not straight; e.g. Circles""" - * GROUP = 3 + * SPLITTABLE = 3 */ if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_NOTSTRAIGHT, __pyx_int_2) < 0) __PYX_ERR(0, 131, __pyx_L1_error) /* "collisions.py":133 * NOTSTRAIGHT = 2 * """Shapes that are not straight; e.g. Circles""" - * GROUP = 3 # <<<<<<<<<<<<<< + * SPLITTABLE = 3 # <<<<<<<<<<<<<< + * """Shapes that can be split into lines (e.g. Polygons)""" + * GROUP = 4 + */ + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_SPLITTABLE, __pyx_int_3) < 0) __PYX_ERR(0, 133, __pyx_L1_error) + + /* "collisions.py":135 + * SPLITTABLE = 3 + * """Shapes that can be split into lines (e.g. Polygons)""" + * GROUP = 4 # <<<<<<<<<<<<<< * """A group of other shapes""" * */ - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_GROUP, __pyx_int_3) < 0) __PYX_ERR(0, 133, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_GROUP, __pyx_int_4) < 0) __PYX_ERR(0, 135, __pyx_L1_error) /* "collisions.py":123 * return math.cos(angle)*strength, math.sin(angle)*strength @@ -113410,485 +116736,485 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":136 + /* "collisions.py":138 * """A group of other shapes""" * * class ShpTyps(IntEnum): # <<<<<<<<<<<<<< * """ * An enum representing the different possible shapes. */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_n_s_ShpTyps, __pyx_n_s_ShpTyps, (PyObject *) NULL, __pyx_n_s_collisions, __pyx_kp_s_An_enum_representing_the_differ_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_n_s_ShpTyps, __pyx_n_s_ShpTyps, (PyObject *) NULL, __pyx_n_s_collisions, __pyx_kp_s_An_enum_representing_the_differ_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (__pyx_t_2 != __pyx_t_8) { - if (unlikely((PyDict_SetItemString(__pyx_t_7, "__orig_bases__", __pyx_t_8) < 0))) __PYX_ERR(0, 136, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_7, "__orig_bases__", __pyx_t_8) < 0))) __PYX_ERR(0, 138, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":140 + /* "collisions.py":142 * An enum representing the different possible shapes. * """ * NoShape = -1 # <<<<<<<<<<<<<< * Group = -2 * Point = -3 */ - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_NoShape, __pyx_int_neg_1) < 0) __PYX_ERR(0, 140, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_NoShape, __pyx_int_neg_1) < 0) __PYX_ERR(0, 142, __pyx_L1_error) - /* "collisions.py":141 + /* "collisions.py":143 * """ * NoShape = -1 * Group = -2 # <<<<<<<<<<<<<< * Point = -3 * Line = -4 */ - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_Group, __pyx_int_neg_2) < 0) __PYX_ERR(0, 141, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_Group, __pyx_int_neg_2) < 0) __PYX_ERR(0, 143, __pyx_L1_error) - /* "collisions.py":142 + /* "collisions.py":144 * NoShape = -1 * Group = -2 * Point = -3 # <<<<<<<<<<<<<< * Line = -4 * Circle = -5 */ - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_Point, __pyx_int_neg_3) < 0) __PYX_ERR(0, 142, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_Point, __pyx_int_neg_3) < 0) __PYX_ERR(0, 144, __pyx_L1_error) - /* "collisions.py":143 + /* "collisions.py":145 * Group = -2 * Point = -3 * Line = -4 # <<<<<<<<<<<<<< * Circle = -5 * Arc = -6 */ - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_Line, __pyx_int_neg_4) < 0) __PYX_ERR(0, 143, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_Line, __pyx_int_neg_4) < 0) __PYX_ERR(0, 145, __pyx_L1_error) - /* "collisions.py":144 + /* "collisions.py":146 * Point = -3 * Line = -4 * Circle = -5 # <<<<<<<<<<<<<< * Arc = -6 * Rect = -7 */ - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_Circle, __pyx_int_neg_5) < 0) __PYX_ERR(0, 144, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_Circle, __pyx_int_neg_5) < 0) __PYX_ERR(0, 146, __pyx_L1_error) - /* "collisions.py":145 + /* "collisions.py":147 * Line = -4 * Circle = -5 * Arc = -6 # <<<<<<<<<<<<<< * Rect = -7 * RotRect = -8 */ - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_Arc, __pyx_int_neg_6) < 0) __PYX_ERR(0, 145, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_Arc, __pyx_int_neg_6) < 0) __PYX_ERR(0, 147, __pyx_L1_error) - /* "collisions.py":146 + /* "collisions.py":148 * Circle = -5 * Arc = -6 * Rect = -7 # <<<<<<<<<<<<<< * RotRect = -8 * Polygon = -9 */ - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_Rect, __pyx_int_neg_7) < 0) __PYX_ERR(0, 146, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_Rect, __pyx_int_neg_7) < 0) __PYX_ERR(0, 148, __pyx_L1_error) - /* "collisions.py":147 + /* "collisions.py":149 * Arc = -6 * Rect = -7 * RotRect = -8 # <<<<<<<<<<<<<< * Polygon = -9 * */ - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_RotRect, __pyx_int_neg_8) < 0) __PYX_ERR(0, 147, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_RotRect, __pyx_int_neg_8) < 0) __PYX_ERR(0, 149, __pyx_L1_error) - /* "collisions.py":148 + /* "collisions.py":150 * Rect = -7 * RotRect = -8 * Polygon = -9 # <<<<<<<<<<<<<< * * def checkShpType(shape: Union['Shape', 'Shapes'], *typs: Union[ShpTyps, ShpGroups]) -> bool: */ - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_Polygon, __pyx_int_neg_9) < 0) __PYX_ERR(0, 148, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_Polygon, __pyx_int_neg_9) < 0) __PYX_ERR(0, 150, __pyx_L1_error) - /* "collisions.py":136 + /* "collisions.py":138 * """A group of other shapes""" * * class ShpTyps(IntEnum): # <<<<<<<<<<<<<< * """ * An enum representing the different possible shapes. */ - __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_ShpTyps, __pyx_t_2, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_ShpTyps, __pyx_t_2, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ShpTyps, __pyx_t_8) < 0) __PYX_ERR(0, 136, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ShpTyps, __pyx_t_8) < 0) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":150 + /* "collisions.py":152 * Polygon = -9 * * def checkShpType(shape: Union['Shape', 'Shapes'], *typs: Union[ShpTyps, ShpGroups]) -> bool: # <<<<<<<<<<<<<< * """ * Checks to see if a shape is of a certain type or group. */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_shape, __pyx_kp_s_Union_Shape_Shapes) < 0) __PYX_ERR(0, 150, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_typs, __pyx_kp_s_Union_ShpTyps_ShpGroups) < 0) __PYX_ERR(0, 150, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 150, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11checkShpType, 0, __pyx_n_s_checkShpType, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_shape, __pyx_kp_s_Union_Shape_Shapes) < 0) __PYX_ERR(0, 152, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_typs, __pyx_kp_s_Union_ShpTyps_ShpGroups) < 0) __PYX_ERR(0, 152, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11checkShpType, 0, __pyx_n_s_checkShpType, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_checkShpType, __pyx_t_3) < 0) __PYX_ERR(0, 150, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_checkShpType, __pyx_t_3) < 0) __PYX_ERR(0, 152, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":168 + /* "collisions.py":170 * return False * * def shapelyToColl(shapelyShape: shapelyGeom.base.BaseGeometry) -> Union['Shape', 'Shapes']: # <<<<<<<<<<<<<< * """ * Converts a shapely shape to a BlazeSudio Shape. */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_shapelyShape, __pyx_kp_s_shapelyGeom_base_BaseGeometry) < 0) __PYX_ERR(0, 168, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Union_Shape_Shapes) < 0) __PYX_ERR(0, 168, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_13shapelyToColl, 0, __pyx_n_s_shapelyToColl, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_shapelyShape, __pyx_kp_s_shapelyGeom_base_BaseGeometry) < 0) __PYX_ERR(0, 170, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Union_Shape_Shapes) < 0) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_13shapelyToColl, 0, __pyx_n_s_shapelyToColl, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_shapelyToColl, __pyx_t_2) < 0) __PYX_ERR(0, 168, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_shapelyToColl, __pyx_t_2) < 0) __PYX_ERR(0, 170, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":190 + /* "collisions.py":193 * raise ValueError(f'Cannot convert shapely shape of type {type(shapelyShape)} to BlazeSudio Shape') * * def collToShapely(collShape: 'Shape') -> shapelyGeom.base.BaseGeometry: # <<<<<<<<<<<<<< * """ * Converts a BlazeSudio Shape to a shapely shape. */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_collShape, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 190, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_kp_s_shapelyGeom_base_BaseGeometry) < 0) __PYX_ERR(0, 190, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_15collToShapely, 0, __pyx_n_s_collToShapely, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_collShape, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 193, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_kp_s_shapelyGeom_base_BaseGeometry) < 0) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_15collToShapely, 0, __pyx_n_s_collToShapely, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_2); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_collToShapely, __pyx_t_3) < 0) __PYX_ERR(0, 190, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_collToShapely, __pyx_t_3) < 0) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":212 + /* "collisions.py":216 * raise ValueError(f'Cannot convert BlazeSudio shape of type {type(collShape)} to shapely shape') * * def drawShape(surface: Any, shape: 'Shape', colour: tuple[int, int, int], width: int = 0): # <<<<<<<<<<<<<< * """ * Draws a BlazeSudio shape to a Pygame surface. */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_surface, __pyx_n_s_Any) < 0) __PYX_ERR(0, 212, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_shape, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 212, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_colour, __pyx_kp_s_tuple_int_int_int) < 0) __PYX_ERR(0, 212, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_width, __pyx_n_s_int) < 0) __PYX_ERR(0, 212, __pyx_L1_error) - __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_17drawShape, 0, __pyx_n_s_drawShape, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_surface, __pyx_n_s_Any) < 0) __PYX_ERR(0, 216, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_shape, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 216, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_colour, __pyx_kp_s_tuple_int_int_int) < 0) __PYX_ERR(0, 216, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_width, __pyx_n_s_int) < 0) __PYX_ERR(0, 216, __pyx_L1_error) + __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_17drawShape, 0, __pyx_n_s_drawShape, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_2, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 212, __pyx_L1_error) - if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_0)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_0))) __PYX_ERR(0, 212, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_2, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 216, __pyx_L1_error) + if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_0)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_0))) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_INCREF(__pyx_int_0); __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_2)->__pyx_arg_width = ((PyObject*)__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_2, __pyx_pf_10collisions_18__defaults__); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_2, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_drawShape, __pyx_t_2) < 0) __PYX_ERR(0, 212, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_drawShape, __pyx_t_2) < 0) __PYX_ERR(0, 216, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":259 + /* "collisions.py":263 * raise ValueError(f'Cannot draw BlazeSudio shape of type {type(shape)}') * * class Shape: # <<<<<<<<<<<<<< * """The base Shape class. This defaults to always collide. * This class always collides; so *can* be used as an infinite plane, but why?""" */ - __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Shape, __pyx_n_s_Shape, (PyObject *) NULL, __pyx_n_s_collisions, __pyx_kp_s_The_base_Shape_class_This_defaul); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) + __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Shape, __pyx_n_s_Shape, (PyObject *) NULL, __pyx_n_s_collisions, __pyx_kp_s_The_base_Shape_class_This_defaul); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_x, __pyx_n_s_Number) < 0) __PYX_ERR(0, 259, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_y, __pyx_n_s_Number) < 0) __PYX_ERR(0, 259, __pyx_L1_error) - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_annotations, __pyx_t_3) < 0) __PYX_ERR(0, 259, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_x, __pyx_n_s_Number) < 0) __PYX_ERR(0, 263, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_y, __pyx_n_s_Number) < 0) __PYX_ERR(0, 263, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_annotations, __pyx_t_3) < 0) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":262 + /* "collisions.py":266 * """The base Shape class. This defaults to always collide. * This class always collides; so *can* be used as an infinite plane, but why?""" * GROUPS = set() # <<<<<<<<<<<<<< * TYPE = ShpTyps.NoShape * x: Number = 0 */ - __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_GROUPS, __pyx_t_3) < 0) __PYX_ERR(0, 262, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_GROUPS, __pyx_t_3) < 0) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":263 + /* "collisions.py":267 * This class always collides; so *can* be used as an infinite plane, but why?""" * GROUPS = set() * TYPE = ShpTyps.NoShape # <<<<<<<<<<<<<< * x: Number = 0 * y: Number = 0 */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 263, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_NoShape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_NoShape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_TYPE, __pyx_t_7) < 0) __PYX_ERR(0, 263, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_TYPE, __pyx_t_7) < 0) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":264 + /* "collisions.py":268 * GROUPS = set() * TYPE = ShpTyps.NoShape * x: Number = 0 # <<<<<<<<<<<<<< * y: Number = 0 * def __init__(self, bounciness: float = BASEBOUNCINESS): */ - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_x, __pyx_int_0) < 0) __PYX_ERR(0, 264, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_x, __pyx_int_0) < 0) __PYX_ERR(0, 268, __pyx_L1_error) - /* "collisions.py":265 + /* "collisions.py":269 * TYPE = ShpTyps.NoShape * x: Number = 0 * y: Number = 0 # <<<<<<<<<<<<<< * def __init__(self, bounciness: float = BASEBOUNCINESS): * """ */ - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_y, __pyx_int_0) < 0) __PYX_ERR(0, 265, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_y, __pyx_int_0) < 0) __PYX_ERR(0, 269, __pyx_L1_error) - /* "collisions.py":266 + /* "collisions.py":270 * x: Number = 0 * y: Number = 0 * def __init__(self, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< * """ * Args: */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 266, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_1__init__, 0, __pyx_n_s_Shape___init, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 266, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_1__init__, 0, __pyx_n_s_Shape___init, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults1), 0)) __PYX_ERR(0, 266, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 266, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults1), 0)) __PYX_ERR(0, 270, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_3)->__pyx_arg_bounciness = __pyx_t_9; __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_10collisions_20__defaults__); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 266, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":273 + /* "collisions.py":277 * self.bounciness: Number = bounciness * * def collides(self, othershape: Union['Shape','Shapes',Iterable['Shape']]) -> bool: # <<<<<<<<<<<<<< * """ * Whether this shape collides with another shape(s) */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_othershape, __pyx_kp_s_Union_Shape_Shapes_Iterable_Shap) < 0) __PYX_ERR(0, 273, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 273, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_3collides, 0, __pyx_n_s_Shape_collides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 273, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_othershape, __pyx_kp_s_Union_Shape_Shapes_Iterable_Shap) < 0) __PYX_ERR(0, 277, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_3collides, 0, __pyx_n_s_Shape_collides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_collides_2, __pyx_t_7) < 0) __PYX_ERR(0, 273, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_collides_2, __pyx_t_7) < 0) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":290 + /* "collisions.py":294 * return False * * def whereCollides(self, othershape: Union['Shape','Shapes',Iterable['Shape']]) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Finds where this shape collides with another shape(s) */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_othershape, __pyx_kp_s_Union_Shape_Shapes_Iterable_Shap) < 0) __PYX_ERR(0, 290, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 290, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_5whereCollides, 0, __pyx_n_s_Shape_whereCollides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_othershape, __pyx_kp_s_Union_Shape_Shapes_Iterable_Shap) < 0) __PYX_ERR(0, 294, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_5whereCollides, 0, __pyx_n_s_Shape_whereCollides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_whereCollides, __pyx_t_3) < 0) __PYX_ERR(0, 290, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_whereCollides, __pyx_t_3) < 0) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":307 + /* "collisions.py":311 * return points * * def isContaining(self, othershape: Union['Shape','Shapes',Iterable['Shape']]) -> bool: # <<<<<<<<<<<<<< * """ * Finds whether this shape fully encloses `othershape`; if `whereCollides` returns `[]` but `collides` returns True. But (most of the time) more optimised than that. */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_othershape, __pyx_kp_s_Union_Shape_Shapes_Iterable_Shap) < 0) __PYX_ERR(0, 307, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 307, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_7isContaining, 0, __pyx_n_s_Shape_isContaining, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__64)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 307, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_othershape, __pyx_kp_s_Union_Shape_Shapes_Iterable_Shap) < 0) __PYX_ERR(0, 311, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_7isContaining, 0, __pyx_n_s_Shape_isContaining, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_isContaining, __pyx_t_7) < 0) __PYX_ERR(0, 307, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_isContaining, __pyx_t_7) < 0) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":324 + /* "collisions.py":328 * return False * * def distance_to(self, othershape: 'Shape') -> Number: # <<<<<<<<<<<<<< * """ * Finds the distance between this shape and another shape. */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 324, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_othershape, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 324, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 324, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_9distance_to, 0, __pyx_n_s_Shape_distance_to, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_othershape, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 328, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 328, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_9distance_to, 0, __pyx_n_s_Shape_distance_to, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_distance_to, __pyx_t_3) < 0) __PYX_ERR(0, 324, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_distance_to, __pyx_t_3) < 0) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":338 + /* "collisions.py":342 * return math.hypot(thisP[0]-otherP[0], thisP[1]-otherP[1]) * * def check_rects(self, othershape: 'Shape') -> bool: # <<<<<<<<<<<<<< * """ * Check whether this shape's bounding box collides with the other shape's. */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 338, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_othershape, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 338, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 338, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_11check_rects, 0, __pyx_n_s_Shape_check_rects, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__68)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 338, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_othershape, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 342, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_11check_rects, 0, __pyx_n_s_Shape_check_rects, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_check_rects, __pyx_t_7) < 0) __PYX_ERR(0, 338, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_check_rects, __pyx_t_7) < 0) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":353 + /* "collisions.py":357 * return thisr[0] <= otherr[2] and thisr[2] >= otherr[0] and thisr[1] <= otherr[3] and thisr[3] >= otherr[1] * * def __repr__(self): return str(self) # <<<<<<<<<<<<<< * * # Replace these */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_13__repr__, 0, __pyx_n_s_Shape___repr, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 353, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_13__repr__, 0, __pyx_n_s_Shape___repr, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr, __pyx_t_7) < 0) __PYX_ERR(0, 353, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr, __pyx_t_7) < 0) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":356 + /* "collisions.py":360 * * # Replace these * def _collides(self, othershape: 'Shape') -> bool: # <<<<<<<<<<<<<< * return True * */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 356, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_othershape, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 356, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 356, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_15_collides, 0, __pyx_n_s_Shape__collides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__72)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 356, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_othershape, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 360, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 360, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_15_collides, 0, __pyx_n_s_Shape__collides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_collides, __pyx_t_3) < 0) __PYX_ERR(0, 356, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_collides, __pyx_t_3) < 0) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":359 + /* "collisions.py":363 * return True * * def _where(self, othershape: 'Shape') -> Iterable[pointLike]: # <<<<<<<<<<<<<< * return [] * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 359, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_othershape, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 359, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 359, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_17_where, 0, __pyx_n_s_Shape__where, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 359, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_othershape, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 363, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 363, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_17_where, 0, __pyx_n_s_Shape__where, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_where, __pyx_t_7) < 0) __PYX_ERR(0, 359, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_where, __pyx_t_7) < 0) __PYX_ERR(0, 363, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":362 + /* "collisions.py":366 * return [] * * def _contains(self, othershape: 'Shape') -> bool: # <<<<<<<<<<<<<< * return True * */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 362, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_othershape, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 362, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 362, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_19_contains, 0, __pyx_n_s_Shape__contains, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__74)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_othershape, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 366, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 366, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_19_contains, 0, __pyx_n_s_Shape__contains, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_contains, __pyx_t_3) < 0) __PYX_ERR(0, 362, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_contains, __pyx_t_3) < 0) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":365 + /* "collisions.py":369 * return True * * def closestPointTo(self, othershape: 'Shape', returnAll: bool = False) -> pointLike|Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Finds the closest point ON THIS OBJECT **TO** the other object */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_othershape, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 365, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_returnAll, __pyx_n_s_bool) < 0) __PYX_ERR(0, 365, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_pointLike_Iterable_pointLike) < 0) __PYX_ERR(0, 365, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_21closestPointTo, 0, __pyx_n_s_Shape_closestPointTo, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__76)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 365, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_othershape, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 369, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_returnAll, __pyx_n_s_bool) < 0) __PYX_ERR(0, 369, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_pointLike_Iterable_pointLike) < 0) __PYX_ERR(0, 369, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_21closestPointTo, 0, __pyx_n_s_Shape_closestPointTo, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__80)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__77); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__81); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_closestPointTo, __pyx_t_7) < 0) __PYX_ERR(0, 365, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_closestPointTo, __pyx_t_7) < 0) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":380 + /* "collisions.py":384 * return (0, 0) * * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< * """ * Finds whether a point is on a corner of this shape. */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 380, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 380, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 380, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 380, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_23isCorner, 0, __pyx_n_s_Shape_isCorner, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 384, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 384, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 384, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_23isCorner, 0, __pyx_n_s_Shape_isCorner, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults2), 1)) __PYX_ERR(0, 380, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 380, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults2), 1)) __PYX_ERR(0, 384, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_CyFunction_Defaults(__pyx_defaults2, __pyx_t_3)->__pyx_arg_precision = __pyx_t_8; __Pyx_GIVEREF(__pyx_t_8); @@ -113896,1346 +117222,1388 @@ if (!__Pyx_RefNanny) { __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_10collisions_22__defaults__); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_isCorner, __pyx_t_3) < 0) __PYX_ERR(0, 380, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_isCorner, __pyx_t_3) < 0) __PYX_ERR(0, 384, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":393 + /* "collisions.py":397 * return True * * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< * """ * Finds the tangent on this surface to a point with a given velocity */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 393, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 393, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 393, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 393, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_25tangent, 0, __pyx_n_s_Shape_tangent, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 393, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 397, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 397, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_25tangent, 0, __pyx_n_s_Shape_tangent, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_tangent, __pyx_t_7) < 0) __PYX_ERR(0, 393, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_tangent, __pyx_t_7) < 0) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":406 + /* "collisions.py":410 * return math.degrees(math.atan2(vel[1], vel[0])) % 360 * * def toLines(self) -> Iterable['Line']: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 406, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Iterable_Line) < 0) __PYX_ERR(0, 406, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_27toLines, 0, __pyx_n_s_Shape_toLines, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__82)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 406, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Iterable_Line) < 0) __PYX_ERR(0, 410, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_27toLines, 0, __pyx_n_s_Shape_toLines, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_toLines, __pyx_t_3) < 0) __PYX_ERR(0, 406, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_toLines, __pyx_t_3) < 0) __PYX_ERR(0, 410, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":413 + /* "collisions.py":417 * return [] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 413, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_29toPoints, 0, __pyx_n_s_Shape_toPoints, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 413, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_29toPoints, 0, __pyx_n_s_Shape_toPoints, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_toPoints, __pyx_t_7) < 0) __PYX_ERR(0, 413, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_toPoints, __pyx_t_7) < 0) __PYX_ERR(0, 417, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":420 + /* "collisions.py":424 * return [] * * def area(self) -> Number: # <<<<<<<<<<<<<< * """ * Gets the area of the shape. */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 420, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 420, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_31area, 0, __pyx_n_s_Shape_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_31area, 0, __pyx_n_s_Shape_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_area, __pyx_t_3) < 0) __PYX_ERR(0, 420, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_area, __pyx_t_3) < 0) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":429 + /* "collisions.py":433 * return float('inf') * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ * Returns the rectangle bounding box surrounding this object. */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 429, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_33rect, 0, __pyx_n_s_Shape_rect, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 429, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_33rect, 0, __pyx_n_s_Shape_rect, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_rect, __pyx_t_7) < 0) __PYX_ERR(0, 429, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_rect, __pyx_t_7) < 0) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":438 + /* "collisions.py":442 * return -float('inf'), -float('inf'), float('inf'), float('inf') * * def handleCollisionsPos(self, oldP: 'Shape', newP: 'Shape', objs: Union['Shapes',Iterable['Shape']], vel: pointLike = [0,0], verbose: bool = False) -> tuple['Shape', pointLike, verboseOutput]: # <<<<<<<<<<<<<< * """ * This is called to modify objects' positions to bounce off objects. */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 438, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_oldP, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 438, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_newP, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 438, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_objs, __pyx_kp_s_Union_Shapes_Iterable_Shape) < 0) __PYX_ERR(0, 438, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 438, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 438, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_tuple_Shape_pointLike_verboseOut) < 0) __PYX_ERR(0, 438, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_35handleCollisionsPos, 0, __pyx_n_s_Shape_handleCollisionsPos, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 438, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_oldP, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 442, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_newP, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 442, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_objs, __pyx_kp_s_Union_Shapes_Iterable_Shape) < 0) __PYX_ERR(0, 442, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 442, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 442, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_tuple_Shape_pointLike_verboseOut) < 0) __PYX_ERR(0, 442, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_35handleCollisionsPos, 0, __pyx_n_s_Shape_handleCollisionsPos, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults3), 1)) __PYX_ERR(0, 438, __pyx_L1_error) - __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 438, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults3), 1)) __PYX_ERR(0, 442, __pyx_L1_error) + __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_int_0)) __PYX_ERR(0, 438, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_int_0)) __PYX_ERR(0, 442, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_int_0)) __PYX_ERR(0, 438, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_int_0)) __PYX_ERR(0, 442, __pyx_L1_error); __Pyx_CyFunction_Defaults(__pyx_defaults3, __pyx_t_3)->__pyx_arg_vel = __pyx_t_8; __Pyx_GIVEREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_10collisions_24__defaults__); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_handleCollisionsPos, __pyx_t_3) < 0) __PYX_ERR(0, 438, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_handleCollisionsPos, __pyx_t_3) < 0) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":446 + /* "collisions.py":450 * return newP, vel * * def handleCollisionsVel(self, vel: pointLike, objs: Union['Shapes',Iterable['Shape']], verbose: bool = False) -> tuple['Shape', pointLike, verboseOutput]: # <<<<<<<<<<<<<< * """ * This is a wrapper for `handleCollisionsPos` to handle velocity instead of position. */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 446, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 446, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_objs, __pyx_kp_s_Union_Shapes_Iterable_Shape) < 0) __PYX_ERR(0, 446, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 446, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_tuple_Shape_pointLike_verboseOut) < 0) __PYX_ERR(0, 446, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_37handleCollisionsVel, 0, __pyx_n_s_Shape_handleCollisionsVel, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 446, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 450, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_objs, __pyx_kp_s_Union_Shapes_Iterable_Shape) < 0) __PYX_ERR(0, 450, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 450, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_tuple_Shape_pointLike_verboseOut) < 0) __PYX_ERR(0, 450, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_37handleCollisionsVel, 0, __pyx_n_s_Shape_handleCollisionsVel, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__93)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__77); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__81); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_handleCollisionsVel, __pyx_t_7) < 0) __PYX_ERR(0, 446, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_handleCollisionsVel, __pyx_t_7) < 0) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":454 + /* "collisions.py":458 * return self, vel * * def copy(self) -> 'Shape': # <<<<<<<<<<<<<< * """ * Copy this shape to return another with the same properties */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 454, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_39copy, 0, __pyx_n_s_Shape_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__90)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_39copy, 0, __pyx_n_s_Shape_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__94)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_copy, __pyx_t_3) < 0) __PYX_ERR(0, 454, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_copy, __pyx_t_3) < 0) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":460 + /* "collisions.py":464 * return Shape(self.bounciness) * * def __getitem__(self, it: int) -> None: # <<<<<<<<<<<<<< * return 0 * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_it, __pyx_n_s_int) < 0) __PYX_ERR(0, 460, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 460, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_41__getitem__, 0, __pyx_n_s_Shape___getitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__92)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 460, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_it, __pyx_n_s_int) < 0) __PYX_ERR(0, 464, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 464, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_41__getitem__, 0, __pyx_n_s_Shape___getitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__96)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getitem, __pyx_t_7) < 0) __PYX_ERR(0, 460, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getitem, __pyx_t_7) < 0) __PYX_ERR(0, 464, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":463 + /* "collisions.py":467 * return 0 * * def __setitem__(self, it: int, new: Number) -> None: # <<<<<<<<<<<<<< * pass * */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 463, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_it, __pyx_n_s_int) < 0) __PYX_ERR(0, 463, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_new, __pyx_n_s_Number) < 0) __PYX_ERR(0, 463, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 463, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_43__setitem__, 0, __pyx_n_s_Shape___setitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__94)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 463, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_it, __pyx_n_s_int) < 0) __PYX_ERR(0, 467, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_new, __pyx_n_s_Number) < 0) __PYX_ERR(0, 467, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 467, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_43__setitem__, 0, __pyx_n_s_Shape___setitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__98)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_setitem, __pyx_t_3) < 0) __PYX_ERR(0, 463, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_setitem, __pyx_t_3) < 0) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":466 + /* "collisions.py":470 * pass * * def __iter__(self): # <<<<<<<<<<<<<< * return iter([]) * */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_45__iter__, 0, __pyx_n_s_Shape___iter, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__95)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_45__iter__, 0, __pyx_n_s_Shape___iter, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_iter, __pyx_t_3) < 0) __PYX_ERR(0, 466, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_iter, __pyx_t_3) < 0) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":469 + /* "collisions.py":473 * return iter([]) * * def __str__(self): # <<<<<<<<<<<<<< * return '' * */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_47__str__, 0, __pyx_n_s_Shape___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__96)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 469, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Shape_47__str__, 0, __pyx_n_s_Shape___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__100)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_str, __pyx_t_3) < 0) __PYX_ERR(0, 469, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_str, __pyx_t_3) < 0) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":259 + /* "collisions.py":263 * raise ValueError(f'Cannot draw BlazeSudio shape of type {type(shape)}') * * class Shape: # <<<<<<<<<<<<<< * """The base Shape class. This defaults to always collide. * This class always collides; so *can* be used as an infinite plane, but why?""" */ - __pyx_t_3 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_Shape, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error) + __pyx_t_3 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_Shape, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Shape, __pyx_t_3) < 0) __PYX_ERR(0, 259, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Shape, __pyx_t_3) < 0) __PYX_ERR(0, 263, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":472 + /* "collisions.py":476 * return '' * * class NoShape(Shape): # <<<<<<<<<<<<<< * """A class to represent no shape. This is useful for when you want to have a shape that doesn't collide with anything.""" * def __init__(self): */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 472, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 472, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_2, __pyx_n_s_NoShape, __pyx_n_s_NoShape, (PyObject *) NULL, __pyx_n_s_collisions, __pyx_kp_s_A_class_to_represent_no_shape_Th); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_2, __pyx_n_s_NoShape, __pyx_n_s_NoShape, (PyObject *) NULL, __pyx_n_s_collisions, __pyx_kp_s_A_class_to_represent_no_shape_Th); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_2 != __pyx_t_3) { - if (unlikely((PyDict_SetItemString(__pyx_t_8, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_8, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 476, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "collisions.py":474 + /* "collisions.py":478 * class NoShape(Shape): * """A class to represent no shape. This is useful for when you want to have a shape that doesn't collide with anything.""" * def __init__(self): # <<<<<<<<<<<<<< * super().__init__(0) * */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7NoShape_1__init__, 0, __pyx_n_s_NoShape___init, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__97)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7NoShape_1__init__, 0, __pyx_n_s_NoShape___init, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_t_10); PyList_Append(__pyx_t_3, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_10); - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_init, __pyx_t_10) < 0) __PYX_ERR(0, 474, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_init, __pyx_t_10) < 0) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":477 + /* "collisions.py":481 * super().__init__(0) * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * return False * */ - __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 477, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 477, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 477, __pyx_L1_error) - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7NoShape_3_collides, 0, __pyx_n_s_NoShape__collides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__98)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 477, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 481, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 481, __pyx_L1_error) + __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7NoShape_3_collides, 0, __pyx_n_s_NoShape__collides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__102)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_collides, __pyx_t_11) < 0) __PYX_ERR(0, 477, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_collides, __pyx_t_11) < 0) __PYX_ERR(0, 481, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":480 + /* "collisions.py":484 * return False * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * return [] * */ - __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 480, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 480, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 480, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7NoShape_5_where, 0, __pyx_n_s_NoShape__where, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__99)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 480, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 484, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 484, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7NoShape_5_where, 0, __pyx_n_s_NoShape__where, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__103)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_where, __pyx_t_10) < 0) __PYX_ERR(0, 480, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_where, __pyx_t_10) < 0) __PYX_ERR(0, 484, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":483 + /* "collisions.py":487 * return [] * * def _contains(self, othershape: 'Shape') -> bool: # <<<<<<<<<<<<<< * return False * */ - __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 483, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_othershape, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 483, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 483, __pyx_L1_error) - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7NoShape_7_contains, 0, __pyx_n_s_NoShape__contains, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__100)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 483, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_othershape, __pyx_kp_s_Shape_3) < 0) __PYX_ERR(0, 487, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 487, __pyx_L1_error) + __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7NoShape_7_contains, 0, __pyx_n_s_NoShape__contains, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__104)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_contains, __pyx_t_11) < 0) __PYX_ERR(0, 483, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_contains, __pyx_t_11) < 0) __PYX_ERR(0, 487, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":486 + /* "collisions.py":490 * return False * * def area(self) -> Number: # <<<<<<<<<<<<<< * """ * Gets the area of the shape; 0. */ - __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 486, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 486, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7NoShape_9area, 0, __pyx_n_s_NoShape_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__101)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 486, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 490, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7NoShape_9area, 0, __pyx_n_s_NoShape_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__105)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_11); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_area, __pyx_t_10) < 0) __PYX_ERR(0, 486, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_area, __pyx_t_10) < 0) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":495 + /* "collisions.py":499 * return 0 * * def copy(self) -> 'NoShape': # <<<<<<<<<<<<<< * """Make a copy of this non-existant shape""" * return NoShape() */ - __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 495, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_NoShape_3) < 0) __PYX_ERR(0, 495, __pyx_L1_error) - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7NoShape_11copy, 0, __pyx_n_s_NoShape_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__102)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 495, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_NoShape_3) < 0) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7NoShape_11copy, 0, __pyx_n_s_NoShape_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__106)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_copy, __pyx_t_11) < 0) __PYX_ERR(0, 495, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_copy, __pyx_t_11) < 0) __PYX_ERR(0, 499, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":499 + /* "collisions.py":503 * return NoShape() * * def __str__(self): # <<<<<<<<<<<<<< * return '' * */ - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7NoShape_13__str__, 0, __pyx_n_s_NoShape___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__103)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7NoShape_13__str__, 0, __pyx_n_s_NoShape___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__107)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_str, __pyx_t_11) < 0) __PYX_ERR(0, 499, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_str, __pyx_t_11) < 0) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":472 + /* "collisions.py":476 * return '' * * class NoShape(Shape): # <<<<<<<<<<<<<< * """A class to represent no shape. This is useful for when you want to have a shape that doesn't collide with anything.""" * def __init__(self): */ - __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_NoShape, __pyx_t_2, __pyx_t_8, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 472, __pyx_L1_error) + __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_NoShape, __pyx_t_2, __pyx_t_8, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - if (__Pyx_CyFunction_InitClassCell(__pyx_t_3, __pyx_t_11) < 0) __PYX_ERR(0, 472, __pyx_L1_error) + if (__Pyx_CyFunction_InitClassCell(__pyx_t_3, __pyx_t_11) < 0) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_NoShape, __pyx_t_11) < 0) __PYX_ERR(0, 472, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_NoShape, __pyx_t_11) < 0) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":502 + /* "collisions.py":506 * return '' * * class Shapes: # <<<<<<<<<<<<<< * """A class which holds multiple shapes and can be used to do things with all of them at once.""" * GROUPS = {ShpGroups.GROUP} */ - __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Shapes, __pyx_n_s_Shapes, (PyObject *) NULL, __pyx_n_s_collisions, __pyx_kp_s_A_class_which_holds_multiple_sha); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error) + __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_Shapes, __pyx_n_s_Shapes, (PyObject *) NULL, __pyx_n_s_collisions, __pyx_kp_s_A_class_which_holds_multiple_sha); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "collisions.py":504 + /* "collisions.py":508 * class Shapes: * """A class which holds multiple shapes and can be used to do things with all of them at once.""" * GROUPS = {ShpGroups.GROUP} # <<<<<<<<<<<<<< * TYPE = ShpTyps.Group - * def __init__(self, *shapes: Shape): + * def __init__(self, *shapes: Shape, bounciness: float = BASEBOUNCINESS): */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 504, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_GROUP); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_GROUP); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PySet_Add(__pyx_t_7, __pyx_t_8) < 0) __PYX_ERR(0, 504, __pyx_L1_error) + if (PySet_Add(__pyx_t_7, __pyx_t_8) < 0) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_GROUPS, __pyx_t_7) < 0) __PYX_ERR(0, 504, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_GROUPS, __pyx_t_7) < 0) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":505 + /* "collisions.py":509 * """A class which holds multiple shapes and can be used to do things with all of them at once.""" * GROUPS = {ShpGroups.GROUP} * TYPE = ShpTyps.Group # <<<<<<<<<<<<<< - * def __init__(self, *shapes: Shape): + * def __init__(self, *shapes: Shape, bounciness: float = BASEBOUNCINESS): * """ */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 505, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Group); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 505, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Group); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_TYPE, __pyx_t_8) < 0) __PYX_ERR(0, 505, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_TYPE, __pyx_t_8) < 0) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":506 + /* "collisions.py":510 * GROUPS = {ShpGroups.GROUP} * TYPE = ShpTyps.Group - * def __init__(self, *shapes: Shape): # <<<<<<<<<<<<<< + * def __init__(self, *shapes: Shape, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< * """ * Args: */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 506, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_shapes, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 506, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_1__init__, 0, __pyx_n_s_Shapes___init, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__105)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 506, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 510, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_shapes, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 510, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_1__init__, 0, __pyx_n_s_Shapes___init, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_7, sizeof(__pyx_defaults4), 0)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 510, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_t_7)->__pyx_arg_bounciness = __pyx_t_9; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_7, __pyx_pf_10collisions_26__defaults__); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_7) < 0) __PYX_ERR(0, 506, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_7) < 0) __PYX_ERR(0, 510, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":516 + /* "collisions.py":522 * self.shapes = list(shapes) * * def add_shape(self, shape: Shape) -> None: # <<<<<<<<<<<<<< * """ * Adds a shape to this Shapes object. */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_shape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 516, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 516, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_3add_shape, 0, __pyx_n_s_Shapes_add_shape, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__107)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 516, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_shape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 522, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 522, __pyx_L1_error) + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_3add_shape, 0, __pyx_n_s_Shapes_add_shape, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_add_shape, __pyx_t_8) < 0) __PYX_ERR(0, 516, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_add_shape, __pyx_t_8) < 0) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":525 + /* "collisions.py":531 * self.shapes.append(shape) * * def add_shapes(self, *shapes: Shape) -> None: # <<<<<<<<<<<<<< * """ * Adds multiple shapes to this object. */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_shapes, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 525, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 525, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_5add_shapes, 0, __pyx_n_s_Shapes_add_shapes, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__108)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 525, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_shapes, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 531, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 531, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_5add_shapes, 0, __pyx_n_s_Shapes_add_shapes, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__113)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_add_shapes, __pyx_t_7) < 0) __PYX_ERR(0, 525, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_add_shapes, __pyx_t_7) < 0) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":537 + /* "collisions.py":543 * self.shapes.extend(list(shapes)) * * def remove_shape(self, shape: Shape) -> None: # <<<<<<<<<<<<<< * """ * Removes a specific shape from this object. */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 537, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_shape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 537, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 537, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_7remove_shape, 0, __pyx_n_s_Shapes_remove_shape, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__109)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 537, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_shape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 543, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_7remove_shape, 0, __pyx_n_s_Shapes_remove_shape, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_remove_shape, __pyx_t_8) < 0) __PYX_ERR(0, 537, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_remove_shape, __pyx_t_8) < 0) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":546 + /* "collisions.py":552 * self.shapes.remove(shape) * * def remove_shapes(self, *shapes: Shape) -> None: # <<<<<<<<<<<<<< * """ * Removes multiple shapes from this object. */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 546, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_shapes, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 546, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 546, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_9remove_shapes, 0, __pyx_n_s_Shapes_remove_shapes, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__111)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 546, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_shapes, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 552, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 552, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_9remove_shapes, 0, __pyx_n_s_Shapes_remove_shapes, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_remove_shapes, __pyx_t_7) < 0) __PYX_ERR(0, 546, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_remove_shapes, __pyx_t_7) < 0) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":559 + /* "collisions.py":565 * self.shapes.remove(s) * * def collides(self, shapes: Union[Shape,'Shapes',Iterable[Shape]]) -> bool: # <<<<<<<<<<<<<< * """ * Checks for collisions between all the shapes in this object and the input shape(s). */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 559, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_shapes, __pyx_kp_s_Union_Shape_Shapes_Iterable_Shap_2) < 0) __PYX_ERR(0, 559, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 559, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_11collides, 0, __pyx_n_s_Shapes_collides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 559, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_shapes, __pyx_kp_s_Union_Shape_Shapes_Iterable_Shap_2) < 0) __PYX_ERR(0, 565, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 565, __pyx_L1_error) + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_11collides, 0, __pyx_n_s_Shapes_collides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_collides_2, __pyx_t_8) < 0) __PYX_ERR(0, 559, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_collides_2, __pyx_t_8) < 0) __PYX_ERR(0, 565, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":574 + /* "collisions.py":580 * return False * * def whereCollides(self, shapes: Union[Shape,'Shapes',Iterable[Shape]]) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Find the points where this object collides with the input shape(s). */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 574, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_shapes, __pyx_kp_s_Union_Shape_Shapes_Iterable_Shap_2) < 0) __PYX_ERR(0, 574, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 574, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_13whereCollides, 0, __pyx_n_s_Shapes_whereCollides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 574, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_shapes, __pyx_kp_s_Union_Shape_Shapes_Iterable_Shap_2) < 0) __PYX_ERR(0, 580, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_13whereCollides, 0, __pyx_n_s_Shapes_whereCollides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_whereCollides, __pyx_t_7) < 0) __PYX_ERR(0, 574, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_whereCollides, __pyx_t_7) < 0) __PYX_ERR(0, 580, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":589 + /* "collisions.py":595 * return points * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ - * Finds the closest point ON all of these objects TO the input shape. + * Finds the closest point ON ANY of these objects TO the input shape. */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 589, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 589, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_returnAll, __pyx_n_s_bool) < 0) __PYX_ERR(0, 589, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 589, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_15closestPointTo, 0, __pyx_n_s_Shapes_closestPointTo, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 589, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 595, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_returnAll, __pyx_n_s_bool) < 0) __PYX_ERR(0, 595, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 595, __pyx_L1_error) + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_15closestPointTo, 0, __pyx_n_s_Shapes_closestPointTo, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__121)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__77); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__81); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_closestPointTo, __pyx_t_8) < 0) __PYX_ERR(0, 589, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_closestPointTo, __pyx_t_8) < 0) __PYX_ERR(0, 595, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":609 - * return points + /* "collisions.py":626 + * return point * * def isContaining(self, othershape: Union[Shape,'Shapes',Iterable[Shape]]) -> bool: # <<<<<<<<<<<<<< * """ * Finds whether this shape fully encloses `othershape`; if `whereCollides` returns `[]` but `collides` returns True. But more optimised than that. */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 609, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_othershape, __pyx_kp_s_Union_Shape_Shapes_Iterable_Shap_2) < 0) __PYX_ERR(0, 609, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 609, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_17isContaining, 0, __pyx_n_s_Shapes_isContaining, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__117)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 609, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_othershape, __pyx_kp_s_Union_Shape_Shapes_Iterable_Shap_2) < 0) __PYX_ERR(0, 626, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_17isContaining, 0, __pyx_n_s_Shapes_isContaining, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_isContaining, __pyx_t_7) < 0) __PYX_ERR(0, 609, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_isContaining, __pyx_t_7) < 0) __PYX_ERR(0, 626, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":626 - * # TODO: Pick one method: either the dict or the list, not both (see below 2 funcs) + /* "collisions.py":641 + * return False * - * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> Dict[Union[Shape,'Shapes'], bool]: # <<<<<<<<<<<<<< + * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< * """ - * Takes each object and finds whether the input point is on the corner of that object. + * Finds if the point is a corner on any of the objects. */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 626, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 626, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 626, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Dict_Union_Shape_Shapes_bool) < 0) __PYX_ERR(0, 626, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_19isCorner, 0, __pyx_n_s_Shapes_isCorner, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__119)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 626, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 641, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 641, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 641, __pyx_L1_error) + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_19isCorner, 0, __pyx_n_s_Shapes_isCorner, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__124)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults4), 1)) __PYX_ERR(0, 626, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 626, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults5), 1)) __PYX_ERR(0, 641, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_CyFunction_Defaults(__pyx_defaults4, __pyx_t_8)->__pyx_arg_precision = __pyx_t_11; + __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_t_8)->__pyx_arg_precision = __pyx_t_11; __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_8, __pyx_pf_10collisions_26__defaults__); + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_8, __pyx_pf_10collisions_28__defaults__); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_isCorner, __pyx_t_8) < 0) __PYX_ERR(0, 626, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_isCorner, __pyx_t_8) < 0) __PYX_ERR(0, 641, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":642 - * return cs + /* "collisions.py":657 + * return False * - * def tangent(self, point: pointLike, vel: pointLike) -> Iterable[Number]: # <<<<<<<<<<<<<< + * def tangent(self, point: pointLike, vel: pointLike) -> Iterable[Number]: # TODO: Make it return just one number # <<<<<<<<<<<<<< * """ * Finds the tangent on each of these objects for the specified point. -90 = normal. */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 642, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 642, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 642, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 642, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_21tangent, 0, __pyx_n_s_Shapes_tangent, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__121)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 642, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 657, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 657, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 657, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_21tangent, 0, __pyx_n_s_Shapes_tangent, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_tangent, __pyx_t_7) < 0) __PYX_ERR(0, 642, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_tangent, __pyx_t_7) < 0) __PYX_ERR(0, 657, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":662 - * # TODO: to_points and to_lines + /* "collisions.py":675 + * # TODO: handleCollisions + * + * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< + * """ + * Returns: + */ + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 675, __pyx_L1_error) + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_23toPoints, 0, __pyx_n_s_Shapes_toPoints, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 675, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_toPoints, __pyx_t_8) < 0) __PYX_ERR(0, 675, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + + /* "collisions.py":685 + * return points + * + * def toLines(self) -> Iterable['Line']: # <<<<<<<<<<<<<< + * """ + * Returns: + */ + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Iterable_Line) < 0) __PYX_ERR(0, 685, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_25toLines, 0, __pyx_n_s_Shapes_toLines, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__130)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 685, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_toLines, __pyx_t_7) < 0) __PYX_ERR(0, 685, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "collisions.py":695 + * return lines * * def area(self) -> Number: # <<<<<<<<<<<<<< * """ * Gets the combined area of all the shapes. */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 662, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 662, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_23area, 0, __pyx_n_s_Shapes_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__123)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 662, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 695, __pyx_L1_error) + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_27area, 0, __pyx_n_s_Shapes_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__132)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_area, __pyx_t_8) < 0) __PYX_ERR(0, 662, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_area, __pyx_t_8) < 0) __PYX_ERR(0, 695, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":671 + /* "collisions.py":704 * return sum(s.area() for s in self.shapes) * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ * Returns the rectangle bounding box surrounding every one of these objects. */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 671, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 671, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_25rect, 0, __pyx_n_s_Shapes_rect, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__125)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 671, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 704, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_29rect, 0, __pyx_n_s_Shapes_rect, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__134)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_rect, __pyx_t_7) < 0) __PYX_ERR(0, 671, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_rect, __pyx_t_7) < 0) __PYX_ERR(0, 704, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":681 + /* "collisions.py":714 * return min(i[0] for i in rs), min(i[1] for i in rs), max(i[2] for i in rs), max(i[3] for i in rs) * * def copy(self) -> 'Shapes': # <<<<<<<<<<<<<< * """ * Make a copy of this class with a copy of each shape in it. */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 681, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Shapes_2) < 0) __PYX_ERR(0, 681, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_27copy, 0, __pyx_n_s_Shapes_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 681, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Shapes_2) < 0) __PYX_ERR(0, 714, __pyx_L1_error) + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_31copy, 0, __pyx_n_s_Shapes_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__135)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_copy, __pyx_t_8) < 0) __PYX_ERR(0, 681, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_copy, __pyx_t_8) < 0) __PYX_ERR(0, 714, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":687 + /* "collisions.py":720 * return Shapes(s.copy() for s in self.shapes) * * def copy_leave_shapes(self) -> 'Shapes': # <<<<<<<<<<<<<< * """ * Makes a copy of this class but keeps the same shapes. */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 687, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Shapes_2) < 0) __PYX_ERR(0, 687, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_29copy_leave_shapes, 0, __pyx_n_s_Shapes_copy_leave_shapes, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__127)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 687, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Shapes_2) < 0) __PYX_ERR(0, 720, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_33copy_leave_shapes, 0, __pyx_n_s_Shapes_copy_leave_shapes, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_copy_leave_shapes, __pyx_t_7) < 0) __PYX_ERR(0, 687, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_copy_leave_shapes, __pyx_t_7) < 0) __PYX_ERR(0, 720, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":693 + /* "collisions.py":726 * return Shapes(*self.shapes) * * def __iter__(self): # <<<<<<<<<<<<<< * return iter(self.shapes) * */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_31__iter__, 0, __pyx_n_s_Shapes___iter, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 693, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_35__iter__, 0, __pyx_n_s_Shapes___iter, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__137)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_iter, __pyx_t_7) < 0) __PYX_ERR(0, 693, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_iter, __pyx_t_7) < 0) __PYX_ERR(0, 726, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":696 + /* "collisions.py":729 * return iter(self.shapes) * * def __len__(self): # <<<<<<<<<<<<<< * return len(self.shapes) * */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_33__len__, 0, __pyx_n_s_Shapes___len, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__129)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 696, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_37__len__, 0, __pyx_n_s_Shapes___len, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__138)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 729, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_len, __pyx_t_7) < 0) __PYX_ERR(0, 696, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_len, __pyx_t_7) < 0) __PYX_ERR(0, 729, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":699 + /* "collisions.py":732 * return len(self.shapes) * * def __getitem__(self, index: int) -> Union[Shape,'Shapes']: # <<<<<<<<<<<<<< * return self.shapes[index] * */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 699, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_index, __pyx_n_s_int) < 0) __PYX_ERR(0, 699, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Union_Shape_Shapes_2) < 0) __PYX_ERR(0, 699, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_35__getitem__, 0, __pyx_n_s_Shapes___getitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__131)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 699, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_index, __pyx_n_s_int) < 0) __PYX_ERR(0, 732, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Union_Shape_Shapes_2) < 0) __PYX_ERR(0, 732, __pyx_L1_error) + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_39__getitem__, 0, __pyx_n_s_Shapes___getitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__140)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getitem, __pyx_t_8) < 0) __PYX_ERR(0, 699, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_getitem, __pyx_t_8) < 0) __PYX_ERR(0, 732, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":702 + /* "collisions.py":735 * return self.shapes[index] * * def __setitem__(self, index: int, new: Union[Shape,'Shapes']) -> None: # <<<<<<<<<<<<<< * self.shapes[index] = new * */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 702, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_index, __pyx_n_s_int) < 0) __PYX_ERR(0, 702, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_new, __pyx_kp_s_Union_Shape_Shapes_2) < 0) __PYX_ERR(0, 702, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 702, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_37__setitem__, 0, __pyx_n_s_Shapes___setitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__133)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 702, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_index, __pyx_n_s_int) < 0) __PYX_ERR(0, 735, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_new, __pyx_kp_s_Union_Shape_Shapes_2) < 0) __PYX_ERR(0, 735, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 735, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_41__setitem__, 0, __pyx_n_s_Shapes___setitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__142)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_setitem, __pyx_t_7) < 0) __PYX_ERR(0, 702, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_setitem, __pyx_t_7) < 0) __PYX_ERR(0, 735, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":705 + /* "collisions.py":738 * self.shapes[index] = new * * def __repr__(self): return str(self) # <<<<<<<<<<<<<< * * def __str__(self): */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_39__repr__, 0, __pyx_n_s_Shapes___repr, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__134)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 705, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_43__repr__, 0, __pyx_n_s_Shapes___repr, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__143)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 738, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr, __pyx_t_7) < 0) __PYX_ERR(0, 705, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_repr, __pyx_t_7) < 0) __PYX_ERR(0, 738, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":707 + /* "collisions.py":740 * def __repr__(self): return str(self) * * def __str__(self): # <<<<<<<<<<<<<< * shpTyps = str([i.__class__.__name__ for i in self.shapes]).replace("'", "") * return f'' */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_41__str__, 0, __pyx_n_s_Shapes___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 707, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Shapes_45__str__, 0, __pyx_n_s_Shapes___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__145)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_str, __pyx_t_7) < 0) __PYX_ERR(0, 707, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_str, __pyx_t_7) < 0) __PYX_ERR(0, 740, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":502 + /* "collisions.py":506 * return '' * * class Shapes: # <<<<<<<<<<<<<< * """A class which holds multiple shapes and can be used to do things with all of them at once.""" * GROUPS = {ShpGroups.GROUP} */ - __pyx_t_7 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_Shapes, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 502, __pyx_L1_error) + __pyx_t_7 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_Shapes, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Shapes, __pyx_t_7) < 0) __PYX_ERR(0, 502, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Shapes, __pyx_t_7) < 0) __PYX_ERR(0, 506, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":715 + /* "collisions.py":748 * # Also each is kinda in order of complexity. * * class Point(Shape): # <<<<<<<<<<<<<< * TYPE = ShpTyps.Point * """An infintesimally small point in space defined by an x and y coordinate.""" */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 715, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 715, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2)) __PYX_ERR(0, 715, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 715, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 715, __pyx_L1_error) + __pyx_t_8 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_11 = __Pyx_Py3MetaclassPrepare(__pyx_t_8, __pyx_t_2, __pyx_n_s_Point, __pyx_n_s_Point, (PyObject *) NULL, __pyx_n_s_collisions, (PyObject *) NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 715, __pyx_L1_error) + __pyx_t_11 = __Pyx_Py3MetaclassPrepare(__pyx_t_8, __pyx_t_2, __pyx_n_s_Point, __pyx_n_s_Point, (PyObject *) NULL, __pyx_n_s_collisions, (PyObject *) NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_2 != __pyx_t_7) { - if (unlikely((PyDict_SetItemString(__pyx_t_11, "__orig_bases__", __pyx_t_7) < 0))) __PYX_ERR(0, 715, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_11, "__orig_bases__", __pyx_t_7) < 0))) __PYX_ERR(0, 748, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 715, __pyx_L1_error) + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - /* "collisions.py":716 + /* "collisions.py":749 * * class Point(Shape): * TYPE = ShpTyps.Point # <<<<<<<<<<<<<< * """An infintesimally small point in space defined by an x and y coordinate.""" * def __init__(self, x: Number, y: Number, bounciness: float = BASEBOUNCINESS): */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 716, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 716, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Point); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 749, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_TYPE, __pyx_t_10) < 0) __PYX_ERR(0, 716, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_TYPE, __pyx_t_10) < 0) __PYX_ERR(0, 749, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":718 + /* "collisions.py":751 * TYPE = ShpTyps.Point * """An infintesimally small point in space defined by an x and y coordinate.""" * def __init__(self, x: Number, y: Number, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< * """ * Args: */ - __pyx_t_10 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 718, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_x, __pyx_n_s_Number) < 0) __PYX_ERR(0, 718, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_y, __pyx_n_s_Number) < 0) __PYX_ERR(0, 718, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 718, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_1__init__, 0, __pyx_n_s_Point___init, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__138)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 718, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_x, __pyx_n_s_Number) < 0) __PYX_ERR(0, 751, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_y, __pyx_n_s_Number) < 0) __PYX_ERR(0, 751, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 751, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_1__init__, 0, __pyx_n_s_Point___init, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__147)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); PyList_Append(__pyx_t_7, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults5), 0)) __PYX_ERR(0, 718, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 718, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults6), 0)) __PYX_ERR(0, 751, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 718, __pyx_L1_error) + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_CyFunction_Defaults(__pyx_defaults5, __pyx_t_3)->__pyx_arg_bounciness = __pyx_t_9; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_10collisions_28__defaults__); + __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_t_3)->__pyx_arg_bounciness = __pyx_t_9; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_10collisions_30__defaults__); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 718, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 751, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":728 + /* "collisions.py":761 * self.x, self.y = x, y * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ * Returns the rectangle bounding box surrounding this point. */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 728, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 728, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_3rect, 0, __pyx_n_s_Point_rect, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__139)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 728, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 761, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_3rect, 0, __pyx_n_s_Point_rect, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__148)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_rect, __pyx_t_10) < 0) __PYX_ERR(0, 728, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_rect, __pyx_t_10) < 0) __PYX_ERR(0, 761, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":737 + /* "collisions.py":770 * return self.x, self.y, self.x, self.y * * def area(self) -> Number: # <<<<<<<<<<<<<< * """ * Gets the area of the shape; 0. */ - __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 737, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 770, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 737, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_5area, 0, __pyx_n_s_Point_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__140)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 737, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 770, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_5area, 0, __pyx_n_s_Point_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__149)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 770, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_area, __pyx_t_3) < 0) __PYX_ERR(0, 737, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_area, __pyx_t_3) < 0) __PYX_ERR(0, 770, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":746 + /* "collisions.py":779 * return 0.0 * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 746, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 746, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_7toPoints, 0, __pyx_n_s_Point_toPoints, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__141)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 746, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 779, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_7toPoints, 0, __pyx_n_s_Point_toPoints, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__150)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 779, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_toPoints, __pyx_t_10) < 0) __PYX_ERR(0, 746, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_toPoints, __pyx_t_10) < 0) __PYX_ERR(0, 779, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":753 + /* "collisions.py":786 * return [self] * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * if checkShpType(othershape, ShpTyps.Point): * return self.x == othershape.x and self.y == othershape.y */ - __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 753, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 753, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 753, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_9_collides, 0, __pyx_n_s_Point__collides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__142)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 753, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 786, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 786, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_9_collides, 0, __pyx_n_s_Point__collides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__151)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 786, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_collides, __pyx_t_3) < 0) __PYX_ERR(0, 753, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_collides, __pyx_t_3) < 0) __PYX_ERR(0, 786, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":758 + /* "collisions.py":791 * return othershape._collides(self) * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * if checkShpType(othershape, ShpTyps.Point): * return [[self.x, self.y]] if (self.x == othershape.x and self.y == othershape.y) else [] */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 758, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 758, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 758, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_11_where, 0, __pyx_n_s_Point__where, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__143)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 758, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 791, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 791, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_11_where, 0, __pyx_n_s_Point__where, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__152)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_where, __pyx_t_10) < 0) __PYX_ERR(0, 758, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_where, __pyx_t_10) < 0) __PYX_ERR(0, 791, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":763 + /* "collisions.py":796 * return othershape._where(self) * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike, Iterable[pointLike]]: # <<<<<<<<<<<<<< * """ * Finds the closest point ON this object TO the other shape */ - __pyx_t_10 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 763, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 763, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_returnAll, __pyx_n_s_bool) < 0) __PYX_ERR(0, 763, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Union_pointLike_Iterable_pointLi) < 0) __PYX_ERR(0, 763, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_13closestPointTo, 0, __pyx_n_s_Point_closestPointTo, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__144)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 763, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 796, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_returnAll, __pyx_n_s_bool) < 0) __PYX_ERR(0, 796, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Union_pointLike_Iterable_pointLi) < 0) __PYX_ERR(0, 796, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_13closestPointTo, 0, __pyx_n_s_Point_closestPointTo, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__153)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__77); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__81); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_closestPointTo, __pyx_t_3) < 0) __PYX_ERR(0, 763, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_closestPointTo, __pyx_t_3) < 0) __PYX_ERR(0, 796, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":778 + /* "collisions.py":811 * return (self.x, self.y) * * def getTuple(self) -> tuple[Number]: # <<<<<<<<<<<<<< * """ * Gets this object in a tuple format: (x, y). */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 778, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_tuple_Number) < 0) __PYX_ERR(0, 778, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_15getTuple, 0, __pyx_n_s_Point_getTuple, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__145)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 778, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_tuple_Number) < 0) __PYX_ERR(0, 811, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_15getTuple, 0, __pyx_n_s_Point_getTuple, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__154)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 811, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_getTuple, __pyx_t_10) < 0) __PYX_ERR(0, 778, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_getTuple, __pyx_t_10) < 0) __PYX_ERR(0, 811, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":785 + /* "collisions.py":818 * return (self.x, self.y) * * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * return False * */ - __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 785, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 785, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 785, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_17_contains, 0, __pyx_n_s_Point__contains, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__146)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 785, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 818, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 818, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_17_contains, 0, __pyx_n_s_Point__contains, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__155)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_contains, __pyx_t_3) < 0) __PYX_ERR(0, 785, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_contains, __pyx_t_3) < 0) __PYX_ERR(0, 818, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":788 + /* "collisions.py":821 * return False * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< * oldPoint: Union['Point',pointLike], * newPoint: Union['Point', pointLike], */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 788, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_oldPoint, __pyx_kp_s_Union_Point_pointLike) < 0) __PYX_ERR(0, 788, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_newPoint, __pyx_kp_s_Union_Point_pointLike) < 0) __PYX_ERR(0, 788, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_objs, __pyx_kp_s_Union_Shapes_Iterable_Shape_2) < 0) __PYX_ERR(0, 788, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 788, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 788, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 788, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 788, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_tuple_pointLike_pointLike_verbos) < 0) __PYX_ERR(0, 788, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_19handleCollisionsPos, 0, __pyx_n_s_Point_handleCollisionsPos, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__149)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 788, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_oldPoint, __pyx_kp_s_Union_Point_pointLike) < 0) __PYX_ERR(0, 821, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_newPoint, __pyx_kp_s_Union_Point_pointLike) < 0) __PYX_ERR(0, 821, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_objs, __pyx_kp_s_Union_Shapes_Iterable_Shape_2) < 0) __PYX_ERR(0, 821, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 821, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 821, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 821, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 821, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_tuple_pointLike_pointLike_verbos) < 0) __PYX_ERR(0, 821, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_19handleCollisionsPos, 0, __pyx_n_s_Point_handleCollisionsPos, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__158)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_10, sizeof(__pyx_defaults6), 2)) __PYX_ERR(0, 788, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_10, sizeof(__pyx_defaults7), 2)) __PYX_ERR(0, 821, __pyx_L1_error) - /* "collisions.py":792 + /* "collisions.py":825 * newPoint: Union['Point', pointLike], * objs: Union[Shapes, Iterable[Shape]], * vel: pointLike = [0,0], # <<<<<<<<<<<<<< * replaceSelf: bool = True, * precision: Number = BASEPRECISION, */ - __pyx_t_12 = PyList_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 792, __pyx_L1_error) + __pyx_t_12 = PyList_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 825, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 0, __pyx_int_0)) __PYX_ERR(0, 792, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 0, __pyx_int_0)) __PYX_ERR(0, 825, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 1, __pyx_int_0)) __PYX_ERR(0, 792, __pyx_L1_error); - __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_t_10)->__pyx_arg_vel = __pyx_t_12; + if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 1, __pyx_int_0)) __PYX_ERR(0, 825, __pyx_L1_error); + __Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_t_10)->__pyx_arg_vel = __pyx_t_12; __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":794 + /* "collisions.py":827 * vel: pointLike = [0,0], * replaceSelf: bool = True, * precision: Number = BASEPRECISION, # <<<<<<<<<<<<<< * verbose: bool = False * ) -> tuple[pointLike, pointLike, verboseOutput]: */ - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 794, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 827, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __Pyx_CyFunction_Defaults(__pyx_defaults6, __pyx_t_10)->__pyx_arg_precision = __pyx_t_12; + __Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_t_10)->__pyx_arg_precision = __pyx_t_12; __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_10, __pyx_pf_10collisions_30__defaults__); + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_10, __pyx_pf_10collisions_32__defaults__); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_handleCollisionsPos, __pyx_t_10) < 0) __PYX_ERR(0, 788, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_handleCollisionsPos, __pyx_t_10) < 0) __PYX_ERR(0, 821, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":856 + /* "collisions.py":889 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< * vel: pointLike, * objs: Union[Shapes,Iterable[Shape]], */ - __pyx_t_10 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 856, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 856, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_objs, __pyx_kp_s_Union_Shapes_Iterable_Shape_2) < 0) __PYX_ERR(0, 856, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 856, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 856, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 856, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_tuple_pointLike_pointLike_verbos) < 0) __PYX_ERR(0, 856, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_21handleCollisionsVel, 0, __pyx_n_s_Point_handleCollisionsVel, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__151)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 889, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_objs, __pyx_kp_s_Union_Shapes_Iterable_Shape_2) < 0) __PYX_ERR(0, 889, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 889, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 889, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 889, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_tuple_pointLike_pointLike_verbos) < 0) __PYX_ERR(0, 889, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_21handleCollisionsVel, 0, __pyx_n_s_Point_handleCollisionsVel, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__160)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 889, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults7), 1)) __PYX_ERR(0, 856, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults8), 1)) __PYX_ERR(0, 889, __pyx_L1_error) - /* "collisions.py":860 + /* "collisions.py":893 * objs: Union[Shapes,Iterable[Shape]], * replaceSelf: bool = True, * precision: Number = BASEPRECISION, # <<<<<<<<<<<<<< * verbose: bool = False * ) -> tuple[pointLike, pointLike, verboseOutput]: */ - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 860, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __Pyx_CyFunction_Defaults(__pyx_defaults7, __pyx_t_3)->__pyx_arg_precision = __pyx_t_12; + __Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_t_3)->__pyx_arg_precision = __pyx_t_12; __Pyx_GIVEREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_10collisions_32__defaults__); + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_10collisions_34__defaults__); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_handleCollisionsVel, __pyx_t_3) < 0) __PYX_ERR(0, 856, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_handleCollisionsVel, __pyx_t_3) < 0) __PYX_ERR(0, 889, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":886 + /* "collisions.py":919 * return o[0], o[1] * * def copy(self) -> 'Point': # <<<<<<<<<<<<<< * """ * Make a brand new Point with the same values! */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 886, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 919, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Point_3) < 0) __PYX_ERR(0, 886, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_23copy, 0, __pyx_n_s_Point_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__152)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 886, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Point_3) < 0) __PYX_ERR(0, 919, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_23copy, 0, __pyx_n_s_Point_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__161)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 919, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_copy, __pyx_t_10) < 0) __PYX_ERR(0, 886, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_copy, __pyx_t_10) < 0) __PYX_ERR(0, 919, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":892 + /* "collisions.py":925 * return Point(self.x, self.y, self.bounciness) * * def __getitem__(self, item: int) -> Number: # <<<<<<<<<<<<<< * if item == 0: * return self.x */ - __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 892, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 925, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 892, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 892, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_25__getitem__, 0, __pyx_n_s_Point___getitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__154)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 925, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 925, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_25__getitem__, 0, __pyx_n_s_Point___getitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__163)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 925, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_getitem, __pyx_t_3) < 0) __PYX_ERR(0, 892, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_getitem, __pyx_t_3) < 0) __PYX_ERR(0, 925, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":902 + /* "collisions.py":935 * ) * * def __setitem__(self, item: int, new: Number) -> None: # <<<<<<<<<<<<<< * if item == 0: * self.x = new */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 902, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 902, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_new, __pyx_n_s_Number) < 0) __PYX_ERR(0, 902, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 902, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_27__setitem__, 0, __pyx_n_s_Point___setitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__156)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 902, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 935, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_new, __pyx_n_s_Number) < 0) __PYX_ERR(0, 935, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 935, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_27__setitem__, 0, __pyx_n_s_Point___setitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__165)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 935, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_setitem, __pyx_t_10) < 0) __PYX_ERR(0, 902, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_setitem, __pyx_t_10) < 0) __PYX_ERR(0, 935, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":912 + /* "collisions.py":945 * ) * * def __iter__(self): # <<<<<<<<<<<<<< * return iter([self.x, self.y]) * */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_29__iter__, 0, __pyx_n_s_Point___iter, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__157)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 912, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_29__iter__, 0, __pyx_n_s_Point___iter, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__166)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_iter, __pyx_t_10) < 0) __PYX_ERR(0, 912, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_iter, __pyx_t_10) < 0) __PYX_ERR(0, 945, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":915 + /* "collisions.py":948 * return iter([self.x, self.y]) * * def __str__(self): # <<<<<<<<<<<<<< * return f'' * */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_31__str__, 0, __pyx_n_s_Point___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__158)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 915, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_5Point_31__str__, 0, __pyx_n_s_Point___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__167)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 948, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_str, __pyx_t_10) < 0) __PYX_ERR(0, 915, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_str, __pyx_t_10) < 0) __PYX_ERR(0, 948, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":715 + /* "collisions.py":748 * # Also each is kinda in order of complexity. * * class Point(Shape): # <<<<<<<<<<<<<< * TYPE = ShpTyps.Point * """An infintesimally small point in space defined by an x and y coordinate.""" */ - __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_8, __pyx_n_s_Point, __pyx_t_2, __pyx_t_11, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 715, __pyx_L1_error) + __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_8, __pyx_n_s_Point, __pyx_t_2, __pyx_t_11, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (__Pyx_CyFunction_InitClassCell(__pyx_t_7, __pyx_t_10) < 0) __PYX_ERR(0, 715, __pyx_L1_error) + if (__Pyx_CyFunction_InitClassCell(__pyx_t_7, __pyx_t_10) < 0) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Point, __pyx_t_10) < 0) __PYX_ERR(0, 715, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Point, __pyx_t_10) < 0) __PYX_ERR(0, 748, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":918 + /* "collisions.py":951 * return f'' * * class Line(Shape): # <<<<<<<<<<<<<< * """A line segment object defined by a start and an end point.""" * GROUPS = {ShpGroups.LINES} */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 918, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 918, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 918, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 951, __pyx_L1_error); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 918, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 918, __pyx_L1_error) + __pyx_t_11 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_11, __pyx_t_2, __pyx_n_s_Line, __pyx_n_s_Line, (PyObject *) NULL, __pyx_n_s_collisions, __pyx_kp_s_A_line_segment_object_defined_by); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 918, __pyx_L1_error) + __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_11, __pyx_t_2, __pyx_n_s_Line, __pyx_n_s_Line, (PyObject *) NULL, __pyx_n_s_collisions, __pyx_kp_s_A_line_segment_object_defined_by); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); if (__pyx_t_2 != __pyx_t_8) { - if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_t_8) < 0))) __PYX_ERR(0, 918, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_t_8) < 0))) __PYX_ERR(0, 951, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 918, __pyx_L1_error) + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - /* "collisions.py":920 + /* "collisions.py":953 * class Line(Shape): * """A line segment object defined by a start and an end point.""" * GROUPS = {ShpGroups.LINES} # <<<<<<<<<<<<<< * TYPE = ShpTyps.Line * def __init__(self, p1: pointLike, p2: pointLike, bounciness: float = BASEBOUNCINESS): */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 920, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_LINES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 920, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_LINES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 920, __pyx_L1_error) + __pyx_t_7 = PySet_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 953, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PySet_Add(__pyx_t_7, __pyx_t_3) < 0) __PYX_ERR(0, 920, __pyx_L1_error) + if (PySet_Add(__pyx_t_7, __pyx_t_3) < 0) __PYX_ERR(0, 953, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_GROUPS, __pyx_t_7) < 0) __PYX_ERR(0, 920, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_GROUPS, __pyx_t_7) < 0) __PYX_ERR(0, 953, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":921 + /* "collisions.py":954 * """A line segment object defined by a start and an end point.""" * GROUPS = {ShpGroups.LINES} * TYPE = ShpTyps.Line # <<<<<<<<<<<<<< * def __init__(self, p1: pointLike, p2: pointLike, bounciness: float = BASEBOUNCINESS): * """ */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 921, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 921, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Line); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 954, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_TYPE, __pyx_t_3) < 0) __PYX_ERR(0, 921, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_TYPE, __pyx_t_3) < 0) __PYX_ERR(0, 954, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":922 + /* "collisions.py":955 * GROUPS = {ShpGroups.LINES} * TYPE = ShpTyps.Line * def __init__(self, p1: pointLike, p2: pointLike, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< * """ * Args: */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 922, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_p1, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 922, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_p2, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 922, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 922, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_1__init__, 0, __pyx_n_s_Line___init, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__160)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 922, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_p1, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 955, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_p2, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 955, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 955, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_1__init__, 0, __pyx_n_s_Line___init, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__169)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_7); PyList_Append(__pyx_t_8, __pyx_t_7); __Pyx_GIVEREF(__pyx_t_7); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_7, sizeof(__pyx_defaults8), 0)) __PYX_ERR(0, 922, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 922, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_7, sizeof(__pyx_defaults9), 0)) __PYX_ERR(0, 955, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 922, __pyx_L1_error) + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_CyFunction_Defaults(__pyx_defaults8, __pyx_t_7)->__pyx_arg_bounciness = __pyx_t_9; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_7, __pyx_pf_10collisions_34__defaults__); + __Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_t_7)->__pyx_arg_bounciness = __pyx_t_9; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_7, __pyx_pf_10collisions_36__defaults__); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_init, __pyx_t_7) < 0) __PYX_ERR(0, 922, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_init, __pyx_t_7) < 0) __PYX_ERR(0, 955, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":932 + /* "collisions.py":965 * self.p1, self.p2 = p1, p2 * * def area(self) -> Number: # <<<<<<<<<<<<<< * """ * Gets the area of the shape; the distance between the 2 points making up the line. */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 932, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 932, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_3area, 0, __pyx_n_s_Line_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__161)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 932, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 965, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_3area, 0, __pyx_n_s_Line_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__170)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 965, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_area, __pyx_t_3) < 0) __PYX_ERR(0, 932, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_area, __pyx_t_3) < 0) __PYX_ERR(0, 965, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":941 + /* "collisions.py":974 * return math.hypot(self.p1[0]-self.p2[0], self.p1[1]-self.p2[1]) * * @property # <<<<<<<<<<<<<< * def x(self): * """One of the line's points' x value. Changing this will move the other point by the difference!""" */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_5x, 0, __pyx_n_s_Line_x, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__162)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 941, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_5x, 0, __pyx_n_s_Line_x, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__171)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 941, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 974, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_x, __pyx_t_7) < 0) __PYX_ERR(0, 941, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_x, __pyx_t_7) < 0) __PYX_ERR(0, 974, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":945 + /* "collisions.py":978 * """One of the line's points' x value. Changing this will move the other point by the difference!""" * return self.p1[0] * @x.setter # <<<<<<<<<<<<<< @@ -115247,12 +118615,12 @@ if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_x); } - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 945, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_setter); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 945, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_setter); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_7x, 0, __pyx_n_s_Line_x, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__164)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 945, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_7x, 0, __pyx_n_s_Line_x, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__173)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_13 = NULL; __pyx_t_14 = 0; @@ -115273,29 +118641,29 @@ if (!__Pyx_RefNanny) { __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 945, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_x, __pyx_t_7) < 0) __PYX_ERR(0, 945, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_x, __pyx_t_7) < 0) __PYX_ERR(0, 978, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":951 + /* "collisions.py":984 * self.p2 = [self.p2[0]+diff, self.p2[1]] * * @property # <<<<<<<<<<<<<< * def y(self): * """One of the line's points' y value. Changing this will move the other point by the difference!""" */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_9y, 0, __pyx_n_s_Line_y, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__165)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 951, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_9y, 0, __pyx_n_s_Line_y, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__174)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 951, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_y, __pyx_t_12) < 0) __PYX_ERR(0, 951, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_y, __pyx_t_12) < 0) __PYX_ERR(0, 984, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":955 + /* "collisions.py":988 * """One of the line's points' y value. Changing this will move the other point by the difference!""" * return self.p1[1] * @y.setter # <<<<<<<<<<<<<< @@ -115307,12 +118675,12 @@ if (!__Pyx_RefNanny) { PyErr_Clear(); __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_y); } - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 955, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_setter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 955, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_setter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_11y, 0, __pyx_n_s_Line_y, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__166)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 955, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_11y, 0, __pyx_n_s_Line_y, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__175)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_13 = NULL; __pyx_t_14 = 0; @@ -115333,2626 +118701,2721 @@ if (!__Pyx_RefNanny) { __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 955, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_y, __pyx_t_12) < 0) __PYX_ERR(0, 955, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_y, __pyx_t_12) < 0) __PYX_ERR(0, 988, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":963 + /* "collisions.py":996 * # Some code yoinked off of https://www.geeksforgeeks.org/check-if-two-given-line-segments-intersect/ modified for this use case and debugged * * @staticmethod # <<<<<<<<<<<<<< * def _onSegment(p, a, b): * """ */ - __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_13_onSegment, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Line__onSegment, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__168)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 963, __pyx_L1_error) + __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_13_onSegment, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Line__onSegment, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__177)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 963, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 996, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_onSegment, __pyx_t_3) < 0) __PYX_ERR(0, 963, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_onSegment, __pyx_t_3) < 0) __PYX_ERR(0, 996, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":978 + /* "collisions.py":1011 * return min(a[0], b[0]) <= p[0] <= max(a[0], b[0]) and min(a[1], b[1]) <= p[1] <= max(a[1], b[1]) * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ * Returns the rectangle bounding box surrounding this line. */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 978, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1011, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 978, __pyx_L1_error) - __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_15rect, 0, __pyx_n_s_Line_rect, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__169)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 978, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 1011, __pyx_L1_error) + __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_15rect, 0, __pyx_n_s_Line_rect, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__178)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1011, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_rect, __pyx_t_12) < 0) __PYX_ERR(0, 978, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_rect, __pyx_t_12) < 0) __PYX_ERR(0, 1011, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":987 + /* "collisions.py":1020 * return min(self.p1[0], self.p2[0]), min(self.p1[1], self.p2[1]), max(self.p1[0], self.p2[0]), max(self.p1[1], self.p2[1]) * * def toLines(self) -> Iterable['Line']: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 987, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1020, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_kp_s_Iterable_Line) < 0) __PYX_ERR(0, 987, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_17toLines, 0, __pyx_n_s_Line_toLines, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__170)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 987, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_kp_s_Iterable_Line) < 0) __PYX_ERR(0, 1020, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_17toLines, 0, __pyx_n_s_Line_toLines, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__179)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1020, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_toLines, __pyx_t_3) < 0) __PYX_ERR(0, 987, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_toLines, __pyx_t_3) < 0) __PYX_ERR(0, 1020, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":994 + /* "collisions.py":1027 * return [self] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 994, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 994, __pyx_L1_error) - __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_19toPoints, 0, __pyx_n_s_Line_toPoints, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__171)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 994, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 1027, __pyx_L1_error) + __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_19toPoints, 0, __pyx_n_s_Line_toPoints, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__180)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1027, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_toPoints, __pyx_t_12) < 0) __PYX_ERR(0, 994, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_toPoints, __pyx_t_12) < 0) __PYX_ERR(0, 1027, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":1001 + /* "collisions.py":1034 * return [self.p1, self.p2] * * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * return False * */ - __pyx_t_12 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1001, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1001, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1001, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_21_contains, 0, __pyx_n_s_Line__contains, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__172)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1001, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1034, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1034, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_21_contains, 0, __pyx_n_s_Line__contains, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__181)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1034, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_contains, __pyx_t_3) < 0) __PYX_ERR(0, 1001, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_contains, __pyx_t_3) < 0) __PYX_ERR(0, 1034, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1004 + /* "collisions.py":1037 * return False * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * if checkShpType(othershape, ShpTyps.Point): * return self.check_rects(othershape) and self._onSegment([othershape.x, othershape.y], self.p1, self.p2) */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1004, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1004, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1004, __pyx_L1_error) - __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_23_collides, 0, __pyx_n_s_Line__collides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__174)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1004, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1037, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1037, __pyx_L1_error) + __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_23_collides, 0, __pyx_n_s_Line__collides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__183)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1037, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_collides, __pyx_t_12) < 0) __PYX_ERR(0, 1004, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_collides, __pyx_t_12) < 0) __PYX_ERR(0, 1037, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":1031 + /* "collisions.py":1064 * return othershape._collides(self) * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * if checkShpType(othershape, ShpTyps.Point): * return [[othershape.x, othershape.y]] if self.collides(othershape) else [] */ - __pyx_t_12 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1031, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1064, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1031, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 1031, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_25_where, 0, __pyx_n_s_Line__where, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__176)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1031, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1064, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 1064, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_25_where, 0, __pyx_n_s_Line__where, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__185)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1064, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_where, __pyx_t_3) < 0) __PYX_ERR(0, 1031, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_where, __pyx_t_3) < 0) __PYX_ERR(0, 1064, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1055 + /* "collisions.py":1088 * return othershape._where(self) * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLike|Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Find the closest point ON this object TO another object. */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1055, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1088, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1055, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_returnAll, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1055, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_pointLike_Iterable_pointLike) < 0) __PYX_ERR(0, 1055, __pyx_L1_error) - __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_27closestPointTo, 0, __pyx_n_s_Line_closestPointTo, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__178)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1055, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1088, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_returnAll, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1088, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_pointLike_Iterable_pointLike) < 0) __PYX_ERR(0, 1088, __pyx_L1_error) + __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_27closestPointTo, 0, __pyx_n_s_Line_closestPointTo, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__187)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1088, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__77); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_12, __pyx_tuple__81); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_closestPointTo, __pyx_t_12) < 0) __PYX_ERR(0, 1055, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_closestPointTo, __pyx_t_12) < 0) __PYX_ERR(0, 1088, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":1129 + /* "collisions.py":1162 * return tries[0][0] * * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< * """ * Finds whether a point is on a corner of this shape. */ - __pyx_t_12 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1129, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1129, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1129, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1129, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_29isCorner, 0, __pyx_n_s_Line_isCorner, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__180)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1129, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1162, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1162, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1162, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_29isCorner, 0, __pyx_n_s_Line_isCorner, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__189)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults9), 1)) __PYX_ERR(0, 1129, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1129, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults10), 1)) __PYX_ERR(0, 1162, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_Defaults(__pyx_defaults9, __pyx_t_3)->__pyx_arg_precision = __pyx_t_7; + __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_t_3)->__pyx_arg_precision = __pyx_t_7; __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_10collisions_36__defaults__); + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_10collisions_38__defaults__); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_isCorner, __pyx_t_3) < 0) __PYX_ERR(0, 1129, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_isCorner, __pyx_t_3) < 0) __PYX_ERR(0, 1162, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1144 + /* "collisions.py":1177 * return rountTuple(self.p1) == rountTuple(point) or rountTuple(self.p2) == rountTuple(point) * * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< * """ * Finds the tangent on this surface to a point with a given velocity. */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1144, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1144, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1144, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1144, __pyx_L1_error) - __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_31tangent, 0, __pyx_n_s_Line_tangent, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__182)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1144, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1177, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1177, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1177, __pyx_L1_error) + __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_31tangent, 0, __pyx_n_s_Line_tangent, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__191)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_tangent, __pyx_t_12) < 0) __PYX_ERR(0, 1144, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_tangent, __pyx_t_12) < 0) __PYX_ERR(0, 1177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":1169 + /* "collisions.py":1202 * return [(phi-180)%360, phi % 360][tries.index(min(tries))] * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< * oldLine: 'Line', * newLine: 'Line', */ - __pyx_t_12 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1169, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_oldLine, __pyx_kp_s_Line_2) < 0) __PYX_ERR(0, 1169, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_newLine, __pyx_kp_s_Line_2) < 0) __PYX_ERR(0, 1169, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_objs, __pyx_kp_s_Union_Shapes_Iterable_Shape_2) < 0) __PYX_ERR(0, 1169, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1169, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1169, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1169, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1169, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_kp_s_tuple_Line_pointLike_verboseOutp) < 0) __PYX_ERR(0, 1169, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_33handleCollisionsPos, 0, __pyx_n_s_Line_handleCollisionsPos, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__184)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1169, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_oldLine, __pyx_kp_s_Line_2) < 0) __PYX_ERR(0, 1202, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_newLine, __pyx_kp_s_Line_2) < 0) __PYX_ERR(0, 1202, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_objs, __pyx_kp_s_Union_Shapes_Iterable_Shape_2) < 0) __PYX_ERR(0, 1202, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1202, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1202, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1202, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1202, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_kp_s_tuple_Line_pointLike_verboseOutp) < 0) __PYX_ERR(0, 1202, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_33handleCollisionsPos, 0, __pyx_n_s_Line_handleCollisionsPos, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__193)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults10), 2)) __PYX_ERR(0, 1169, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults11), 2)) __PYX_ERR(0, 1202, __pyx_L1_error) - /* "collisions.py":1173 + /* "collisions.py":1206 * newLine: 'Line', * objs: Union[Shapes, Iterable[Shape]], * vel: pointLike = [0, 0], # <<<<<<<<<<<<<< * replaceSelf: bool = True, * precision: Number = BASEPRECISION, */ - __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1173, __pyx_L1_error) + __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_int_0)) __PYX_ERR(0, 1173, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_int_0)) __PYX_ERR(0, 1206, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_int_0)) __PYX_ERR(0, 1173, __pyx_L1_error); - __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_t_3)->__pyx_arg_vel = __pyx_t_7; + if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_int_0)) __PYX_ERR(0, 1206, __pyx_L1_error); + __Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_t_3)->__pyx_arg_vel = __pyx_t_7; __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1175 + /* "collisions.py":1208 * vel: pointLike = [0, 0], * replaceSelf: bool = True, * precision: Number = BASEPRECISION, # <<<<<<<<<<<<<< * verbose: bool = False * ) -> tuple['Line', pointLike, verboseOutput]: */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1175, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1208, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_Defaults(__pyx_defaults10, __pyx_t_3)->__pyx_arg_precision = __pyx_t_7; + __Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_t_3)->__pyx_arg_precision = __pyx_t_7; __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_10collisions_38__defaults__); + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_10collisions_40__defaults__); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_handleCollisionsPos, __pyx_t_3) < 0) __PYX_ERR(0, 1169, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_handleCollisionsPos, __pyx_t_3) < 0) __PYX_ERR(0, 1202, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1306 + /* "collisions.py":1339 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< * vel: pointLike, * objs: Union[Shapes, Iterable[Shape]], */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1306, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1306, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_objs, __pyx_kp_s_Union_Shapes_Iterable_Shape_2) < 0) __PYX_ERR(0, 1306, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1306, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1306, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1306, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_tuple_Line_pointLike_verboseOutp) < 0) __PYX_ERR(0, 1306, __pyx_L1_error) - __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_35handleCollisionsVel, 0, __pyx_n_s_Line_handleCollisionsVel, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__186)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1306, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1339, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_objs, __pyx_kp_s_Union_Shapes_Iterable_Shape_2) < 0) __PYX_ERR(0, 1339, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1339, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1339, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1339, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_tuple_Line_pointLike_verboseOutp) < 0) __PYX_ERR(0, 1339, __pyx_L1_error) + __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_35handleCollisionsVel, 0, __pyx_n_s_Line_handleCollisionsVel, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__195)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_12, sizeof(__pyx_defaults11), 1)) __PYX_ERR(0, 1306, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_12, sizeof(__pyx_defaults12), 1)) __PYX_ERR(0, 1339, __pyx_L1_error) - /* "collisions.py":1310 + /* "collisions.py":1343 * objs: Union[Shapes, Iterable[Shape]], * replaceSelf: bool = True, * precision: Number = BASEPRECISION, # <<<<<<<<<<<<<< * verbose: bool = False * ) -> tuple['Line', pointLike, verboseOutput]: */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1310, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1343, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_Defaults(__pyx_defaults11, __pyx_t_12)->__pyx_arg_precision = __pyx_t_7; + __Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_t_12)->__pyx_arg_precision = __pyx_t_7; __Pyx_GIVEREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_12, __pyx_pf_10collisions_40__defaults__); + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_12, __pyx_pf_10collisions_42__defaults__); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_handleCollisionsVel, __pyx_t_12) < 0) __PYX_ERR(0, 1306, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_handleCollisionsVel, __pyx_t_12) < 0) __PYX_ERR(0, 1339, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":1338 + /* "collisions.py":1371 * return out, outvel * * def copy(self) -> 'Line': # <<<<<<<<<<<<<< * """ * Make a copy of the Line with the same values! */ - __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1338, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_kp_s_Line_2) < 0) __PYX_ERR(0, 1338, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_37copy, 0, __pyx_n_s_Line_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__187)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1338, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_kp_s_Line_2) < 0) __PYX_ERR(0, 1371, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_37copy, 0, __pyx_n_s_Line_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__196)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1371, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_copy, __pyx_t_3) < 0) __PYX_ERR(0, 1338, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_copy, __pyx_t_3) < 0) __PYX_ERR(0, 1371, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1344 + /* "collisions.py":1377 * return Line(self.p1, self.p2, self.bounciness) * * def __getitem__(self, item: int) -> pointLike: # <<<<<<<<<<<<<< * if item == 0: * return self.p1 */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1344, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 1344, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1344, __pyx_L1_error) - __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_39__getitem__, 0, __pyx_n_s_Line___getitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__188)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1344, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 1377, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1377, __pyx_L1_error) + __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_39__getitem__, 0, __pyx_n_s_Line___getitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__197)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1377, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_getitem, __pyx_t_12) < 0) __PYX_ERR(0, 1344, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_getitem, __pyx_t_12) < 0) __PYX_ERR(0, 1377, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":1354 + /* "collisions.py":1387 * ) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< * if item == 0: * self.p1 = new */ - __pyx_t_12 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1354, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 1354, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_new, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1354, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 1354, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_41__setitem__, 0, __pyx_n_s_Line___setitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__189)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1354, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 1387, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_new, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1387, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 1387, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_41__setitem__, 0, __pyx_n_s_Line___setitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__198)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_setitem, __pyx_t_3) < 0) __PYX_ERR(0, 1354, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_setitem, __pyx_t_3) < 0) __PYX_ERR(0, 1387, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1364 + /* "collisions.py":1397 * ) * * def __iter__(self): # <<<<<<<<<<<<<< * return iter((self.p1, self.p2)) * */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_43__iter__, 0, __pyx_n_s_Line___iter, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__190)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1364, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_43__iter__, 0, __pyx_n_s_Line___iter, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__199)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_iter, __pyx_t_3) < 0) __PYX_ERR(0, 1364, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_iter, __pyx_t_3) < 0) __PYX_ERR(0, 1397, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":1367 + /* "collisions.py":1400 * return iter((self.p1, self.p2)) * * def __str__(self): # <<<<<<<<<<<<<< * return f'' * */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_45__str__, 0, __pyx_n_s_Line___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__191)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1367, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Line_45__str__, 0, __pyx_n_s_Line___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__200)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1400, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_str, __pyx_t_3) < 0) __PYX_ERR(0, 1367, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_str, __pyx_t_3) < 0) __PYX_ERR(0, 1400, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":918 + /* "collisions.py":951 * return f'' * * class Line(Shape): # <<<<<<<<<<<<<< * """A line segment object defined by a start and an end point.""" * GROUPS = {ShpGroups.LINES} */ - __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_11, __pyx_n_s_Line, __pyx_t_2, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 918, __pyx_L1_error) + __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_11, __pyx_n_s_Line, __pyx_t_2, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 951, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_CyFunction_InitClassCell(__pyx_t_8, __pyx_t_3) < 0) __PYX_ERR(0, 918, __pyx_L1_error) + if (__Pyx_CyFunction_InitClassCell(__pyx_t_8, __pyx_t_3) < 0) __PYX_ERR(0, 951, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Line, __pyx_t_3) < 0) __PYX_ERR(0, 918, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Line, __pyx_t_3) < 0) __PYX_ERR(0, 951, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":1370 + /* "collisions.py":1403 * return f'' * * class Circle(Shape): # <<<<<<<<<<<<<< * """A perfect circle. Defined as an x and y centre coordinate of the circle and a radius. * Please be mindful when checking for this class as it is technically a closed shape, but if you try to run \ */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1370, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1370, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2)) __PYX_ERR(0, 1370, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2)) __PYX_ERR(0, 1403, __pyx_L1_error); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1370, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1370, __pyx_L1_error) + __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_2, __pyx_n_s_Circle, __pyx_n_s_Circle, (PyObject *) NULL, __pyx_n_s_collisions, __pyx_kp_s_A_perfect_circle_Defined_as_an_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1370, __pyx_L1_error) + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_2, __pyx_n_s_Circle, __pyx_n_s_Circle, (PyObject *) NULL, __pyx_n_s_collisions, __pyx_kp_s_A_perfect_circle_Defined_as_an_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_2 != __pyx_t_11) { - if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_11) < 0))) __PYX_ERR(0, 1370, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_11) < 0))) __PYX_ERR(0, 1403, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1370, __pyx_L1_error) + __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - /* "collisions.py":1374 + /* "collisions.py":1407 * Please be mindful when checking for this class as it is technically a closed shape, but if you try to run \ * `.toLines()` or `.toPoints()` it will return an empty list; so please check for it *before* closed shapes.""" * GROUPS = {ShpGroups.CLOSED, ShpGroups.NOTSTRAIGHT} # <<<<<<<<<<<<<< * TYPE = ShpTyps.Circle * def __init__(self, x: Number, y: Number, r: Number, bounciness: float = BASEBOUNCINESS): */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1374, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_CLOSED); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1374, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_CLOSED); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1374, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_NOTSTRAIGHT); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1374, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_NOTSTRAIGHT); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PySet_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1374, __pyx_L1_error) + __pyx_t_8 = PySet_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PySet_Add(__pyx_t_8, __pyx_t_12) < 0) __PYX_ERR(0, 1374, __pyx_L1_error) + if (PySet_Add(__pyx_t_8, __pyx_t_12) < 0) __PYX_ERR(0, 1407, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (PySet_Add(__pyx_t_8, __pyx_t_7) < 0) __PYX_ERR(0, 1374, __pyx_L1_error) + if (PySet_Add(__pyx_t_8, __pyx_t_7) < 0) __PYX_ERR(0, 1407, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_GROUPS, __pyx_t_8) < 0) __PYX_ERR(0, 1374, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_GROUPS, __pyx_t_8) < 0) __PYX_ERR(0, 1407, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1375 + /* "collisions.py":1408 * `.toLines()` or `.toPoints()` it will return an empty list; so please check for it *before* closed shapes.""" * GROUPS = {ShpGroups.CLOSED, ShpGroups.NOTSTRAIGHT} * TYPE = ShpTyps.Circle # <<<<<<<<<<<<<< * def __init__(self, x: Number, y: Number, r: Number, bounciness: float = BASEBOUNCINESS): * """ */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1375, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_Circle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1375, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_Circle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_TYPE, __pyx_t_7) < 0) __PYX_ERR(0, 1375, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_TYPE, __pyx_t_7) < 0) __PYX_ERR(0, 1408, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1376 + /* "collisions.py":1409 * GROUPS = {ShpGroups.CLOSED, ShpGroups.NOTSTRAIGHT} * TYPE = ShpTyps.Circle * def __init__(self, x: Number, y: Number, r: Number, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< * """ * Args: */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1376, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_x, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1376, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_y, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1376, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_r, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1376, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 1376, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_1__init__, 0, __pyx_n_s_Circle___init, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__193)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1376, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_x, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1409, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_y, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1409, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_r, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1409, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 1409, __pyx_L1_error) + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_1__init__, 0, __pyx_n_s_Circle___init, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__202)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_t_8); PyList_Append(__pyx_t_11, __pyx_t_8); __Pyx_GIVEREF(__pyx_t_8); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults12), 0)) __PYX_ERR(0, 1376, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1376, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults13), 0)) __PYX_ERR(0, 1409, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1376, __pyx_L1_error) + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1409, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_CyFunction_Defaults(__pyx_defaults12, __pyx_t_8)->__pyx_arg_bounciness = __pyx_t_9; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_8, __pyx_pf_10collisions_42__defaults__); + __Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_t_8)->__pyx_arg_bounciness = __pyx_t_9; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_8, __pyx_pf_10collisions_44__defaults__); __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_8) < 0) __PYX_ERR(0, 1376, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_8) < 0) __PYX_ERR(0, 1409, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1387 + /* "collisions.py":1420 * self.x, self.y, self.r = x, y, r * + * @property # <<<<<<<<<<<<<< + * def d(self): + * """The diameter of the circle.""" + */ + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_3d, 0, __pyx_n_s_Circle_d, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__203)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1420, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_d, __pyx_t_7) < 0) __PYX_ERR(0, 1420, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "collisions.py":1425 + * return self.r*2 + * + * @d.setter # <<<<<<<<<<<<<< + * def d(self, value): + * self.r = value/2 + */ + __pyx_t_8 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_d); + if (unlikely(!__pyx_t_8)) { + PyErr_Clear(); + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_d); + } + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_setter); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_5d, 0, __pyx_n_s_Circle_d, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__205)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_13 = NULL; + __pyx_t_14 = 0; + #if CYTHON_UNPACK_METHODS + if (unlikely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12); + if (likely(__pyx_t_13)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_13); + __Pyx_INCREF(function); + __Pyx_DECREF_SET(__pyx_t_12, function); + __pyx_t_14 = 1; + } + } + #endif + { + PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_8}; + __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14); + __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1425, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + } + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_d, __pyx_t_7) < 0) __PYX_ERR(0, 1425, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + + /* "collisions.py":1429 + * self.r = value/2 + * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ * Returns the rectangle bounding box surrounding this circle. */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1387, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 1387, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_3rect, 0, __pyx_n_s_Circle_rect, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__194)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1387, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rect, __pyx_t_7) < 0) __PYX_ERR(0, 1387, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 1429, __pyx_L1_error) + __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_7rect, 0, __pyx_n_s_Circle_rect, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__206)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1429, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rect, __pyx_t_12) < 0) __PYX_ERR(0, 1429, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":1396 + /* "collisions.py":1438 * return self.x - self.r, self.y - self.r, self.x + self.r, self.y + self.r * * def area(self) -> Number: # <<<<<<<<<<<<<< * """ * Gets the area of the circle. */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1396, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1438, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1438, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_9area, 0, __pyx_n_s_Circle_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__207)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1396, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_5area, 0, __pyx_n_s_Circle_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__195)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1396, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_area, __pyx_t_7) < 0) __PYX_ERR(0, 1438, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_area, __pyx_t_8) < 0) __PYX_ERR(0, 1396, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1405 + /* "collisions.py":1447 * return math.pi * self.r**2 * * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * if checkShpType(othershape, ShpTyps.Point): * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 < self.r**2 */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1405, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1405, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1405, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_7_contains, 0, __pyx_n_s_Circle__contains, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__197)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1405, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_contains, __pyx_t_7) < 0) __PYX_ERR(0, 1405, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1447, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1447, __pyx_L1_error) + __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_11_contains, 0, __pyx_n_s_Circle__contains, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__209)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1447, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_contains, __pyx_t_12) < 0) __PYX_ERR(0, 1447, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":1418 + /* "collisions.py":1460 * return all(self._contains(Point(*p)) for p in othershape.toPoints()) * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * if checkShpType(othershape, ShpTyps.Point): * return (self.x - othershape.x)**2 + (self.y - othershape.y)**2 <= self.r**2 */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1418, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1460, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1460, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1460, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_13_collides, 0, __pyx_n_s_Circle__collides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__211)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1418, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1418, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_9_collides, 0, __pyx_n_s_Circle__collides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__199)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1418, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_collides, __pyx_t_7) < 0) __PYX_ERR(0, 1460, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_collides, __pyx_t_8) < 0) __PYX_ERR(0, 1418, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1438 + /* "collisions.py":1480 * return othershape._collides(self) * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * if checkShpType(othershape, ShpTyps.Point): * return [[othershape.x, othershape.y]] if ((self.x - othershape.x)**2 + (self.y - othershape.y)**2 == self.r**2) else [] */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1438, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1438, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 1438, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_11_where, 0, __pyx_n_s_Circle__where, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__201)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1438, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_where, __pyx_t_7) < 0) __PYX_ERR(0, 1438, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1480, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 1480, __pyx_L1_error) + __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_15_where, 0, __pyx_n_s_Circle__where, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__213)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1480, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_where, __pyx_t_12) < 0) __PYX_ERR(0, 1480, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":1509 + /* "collisions.py":1551 * return othershape._where(self) * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike,Iterable[pointLike]]: # <<<<<<<<<<<<<< * """ * Find the closest point ON this object TO another object. */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1509, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1551, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1551, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_returnAll, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1551, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_kp_s_Union_pointLike_Iterable_pointLi) < 0) __PYX_ERR(0, 1551, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_17closestPointTo, 0, __pyx_n_s_Circle_closestPointTo, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__215)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1509, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_returnAll, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1509, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Union_pointLike_Iterable_pointLi) < 0) __PYX_ERR(0, 1509, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_13closestPointTo, 0, __pyx_n_s_Circle_closestPointTo, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__203)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1509, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__77); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__81); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_closestPointTo, __pyx_t_7) < 0) __PYX_ERR(0, 1551, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_closestPointTo, __pyx_t_8) < 0) __PYX_ERR(0, 1509, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1558 + /* "collisions.py":1600 * return self.closestPointTo(Point(*ps[0])) * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< * oldCir: 'Circle', * newCir: 'Circle', */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1558, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_oldCir, __pyx_kp_s_Circle_3) < 0) __PYX_ERR(0, 1558, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_newCir, __pyx_kp_s_Circle_3) < 0) __PYX_ERR(0, 1558, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_objs, __pyx_kp_s_Union_Shapes_Iterable_Shape_2) < 0) __PYX_ERR(0, 1558, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1558, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1558, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1558, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1558, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_tuple_pointLike_pointLike_verbos) < 0) __PYX_ERR(0, 1558, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_15handleCollisionsPos, 0, __pyx_n_s_Circle_handleCollisionsPos, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__205)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1558, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1600, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_7, sizeof(__pyx_defaults13), 2)) __PYX_ERR(0, 1558, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_oldCir, __pyx_kp_s_Circle_3) < 0) __PYX_ERR(0, 1600, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_newCir, __pyx_kp_s_Circle_3) < 0) __PYX_ERR(0, 1600, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_objs, __pyx_kp_s_Union_Shapes_Iterable_Shape_2) < 0) __PYX_ERR(0, 1600, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1600, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_unstuckable, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1600, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_maxTries, __pyx_n_s_int) < 0) __PYX_ERR(0, 1600, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1600, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1600, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1600, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_tuple_pointLike_pointLike_verbos) < 0) __PYX_ERR(0, 1600, __pyx_L1_error) + __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_19handleCollisionsPos, 0, __pyx_n_s_Circle_handleCollisionsPos, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__217)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1600, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_12, sizeof(__pyx_defaults14), 3)) __PYX_ERR(0, 1600, __pyx_L1_error) - /* "collisions.py":1562 + /* "collisions.py":1604 * newCir: 'Circle', * objs: Union[Shapes, Iterable[Shape]], * vel: pointLike = [0,0], # <<<<<<<<<<<<<< - * replaceSelf: bool = True, - * precision: Number = BASEPRECISION, + * unstuckable: bool = True, + * maxTries: int = 50, */ - __pyx_t_12 = PyList_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1562, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); + __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1604, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 0, __pyx_int_0)) __PYX_ERR(0, 1562, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_int_0)) __PYX_ERR(0, 1604, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_12, 1, __pyx_int_0)) __PYX_ERR(0, 1562, __pyx_L1_error); - __Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_t_7)->__pyx_arg_vel = __pyx_t_12; - __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_12 = 0; + if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_int_0)) __PYX_ERR(0, 1604, __pyx_L1_error); + __Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_t_12)->__pyx_arg_vel = __pyx_t_8; + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; - /* "collisions.py":1564 + /* "collisions.py":1606 * vel: pointLike = [0,0], + * unstuckable: bool = True, + * maxTries: int = 50, # <<<<<<<<<<<<<< + * replaceSelf: bool = True, + * precision: Number = BASEPRECISION, + */ + if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_50)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_50))) __PYX_ERR(0, 1606, __pyx_L1_error) + __Pyx_INCREF(__pyx_int_50); + __Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_t_12)->__pyx_arg_maxTries = ((PyObject*)__pyx_int_50); + __Pyx_GIVEREF(__pyx_int_50); + + /* "collisions.py":1608 + * maxTries: int = 50, * replaceSelf: bool = True, * precision: Number = BASEPRECISION, # <<<<<<<<<<<<<< * verbose: bool = False * ) -> tuple[pointLike, pointLike, verboseOutput]: */ - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1564, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_CyFunction_Defaults(__pyx_defaults13, __pyx_t_7)->__pyx_arg_precision = __pyx_t_12; - __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_12 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_7, __pyx_pf_10collisions_44__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_handleCollisionsPos, __pyx_t_7) < 0) __PYX_ERR(0, 1558, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1608, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_t_12)->__pyx_arg_precision = __pyx_t_8; + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_12, __pyx_pf_10collisions_46__defaults__); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_handleCollisionsPos, __pyx_t_12) < 0) __PYX_ERR(0, 1600, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":1654 + /* "collisions.py":1732 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< * vel: pointLike, * objs: Union[Shapes,Iterable[Shape]], */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1654, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1732, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1732, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_objs, __pyx_kp_s_Union_Shapes_Iterable_Shape_2) < 0) __PYX_ERR(0, 1732, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1732, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_unstuckable, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1732, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_maxTries, __pyx_n_s_int) < 0) __PYX_ERR(0, 1732, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1732, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1732, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_kp_s_tuple_Circle_pointLike_verboseOu) < 0) __PYX_ERR(0, 1732, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_21handleCollisionsVel, 0, __pyx_n_s_Circle_handleCollisionsVel, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__219)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1732, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1654, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_objs, __pyx_kp_s_Union_Shapes_Iterable_Shape_2) < 0) __PYX_ERR(0, 1654, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1654, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1654, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1654, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_tuple_Circle_pointLike_verboseOu) < 0) __PYX_ERR(0, 1654, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_17handleCollisionsVel, 0, __pyx_n_s_Circle_handleCollisionsVel, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__206)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1654, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults14), 1)) __PYX_ERR(0, 1654, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_7, sizeof(__pyx_defaults15), 2)) __PYX_ERR(0, 1732, __pyx_L1_error) - /* "collisions.py":1658 - * objs: Union[Shapes,Iterable[Shape]], + /* "collisions.py":1737 * replaceSelf: bool = True, + * unstuckable: bool = True, + * maxTries: int = 50, # <<<<<<<<<<<<<< + * precision: Number = BASEPRECISION, + * verbose: bool = False + */ + if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_int_50)) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_int_50))) __PYX_ERR(0, 1737, __pyx_L1_error) + __Pyx_INCREF(__pyx_int_50); + __Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_t_7)->__pyx_arg_maxTries = ((PyObject*)__pyx_int_50); + __Pyx_GIVEREF(__pyx_int_50); + + /* "collisions.py":1738 + * unstuckable: bool = True, + * maxTries: int = 50, * precision: Number = BASEPRECISION, # <<<<<<<<<<<<<< * verbose: bool = False * ) -> tuple['Circle', pointLike, verboseOutput]: */ - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1658, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_CyFunction_Defaults(__pyx_defaults14, __pyx_t_8)->__pyx_arg_precision = __pyx_t_12; - __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_12 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_8, __pyx_pf_10collisions_46__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7); + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1738, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_t_7)->__pyx_arg_precision = __pyx_t_8; + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_7, __pyx_pf_10collisions_48__defaults__); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_handleCollisionsVel, __pyx_t_7) < 0) __PYX_ERR(0, 1732, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_handleCollisionsVel, __pyx_t_8) < 0) __PYX_ERR(0, 1654, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1684 + /* "collisions.py":1768 * return o[0], o[1] * * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< * """ * Finds whether a point is on a corner of this shape. But because circles don't have any corners, this will return False. */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1684, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1684, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1684, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1684, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_19isCorner, 0, __pyx_n_s_Circle_isCorner, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__207)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1684, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_7, sizeof(__pyx_defaults15), 1)) __PYX_ERR(0, 1684, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1684, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1768, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1768, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1768, __pyx_L1_error) + __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_23isCorner, 0, __pyx_n_s_Circle_isCorner, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__220)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1768, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __Pyx_CyFunction_Defaults(__pyx_defaults15, __pyx_t_7)->__pyx_arg_precision = __pyx_t_12; - __Pyx_GIVEREF(__pyx_t_12); - __pyx_t_12 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_7, __pyx_pf_10collisions_48__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_isCorner, __pyx_t_7) < 0) __PYX_ERR(0, 1684, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_12, sizeof(__pyx_defaults16), 1)) __PYX_ERR(0, 1768, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1768, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_t_12)->__pyx_arg_precision = __pyx_t_8; + __Pyx_GIVEREF(__pyx_t_8); + __pyx_t_8 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_12, __pyx_pf_10collisions_50__defaults__); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_isCorner, __pyx_t_12) < 0) __PYX_ERR(0, 1768, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":1697 + /* "collisions.py":1781 * return False * * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< * """ * Finds the tangent on this surface to a point with a given velocity. */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1697, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1781, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1781, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1781, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1781, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_25tangent, 0, __pyx_n_s_Circle_tangent, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__221)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1781, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1697, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1697, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1697, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_21tangent, 0, __pyx_n_s_Circle_tangent, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__208)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1697, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_tangent, __pyx_t_7) < 0) __PYX_ERR(0, 1781, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_tangent, __pyx_t_8) < 0) __PYX_ERR(0, 1697, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1712 + /* "collisions.py":1796 * return math.degrees(math.atan((point[1]-self.y)/(point[0]-self.x))) + (0 if self.x>point[0] else 180) * * def copy(self) -> 'Circle': # <<<<<<<<<<<<<< * """ * Make a replica of this object with the same object. */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1712, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Circle_3) < 0) __PYX_ERR(0, 1712, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_23copy, 0, __pyx_n_s_Circle_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__209)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1712, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1796, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_copy, __pyx_t_7) < 0) __PYX_ERR(0, 1712, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Circle_3) < 0) __PYX_ERR(0, 1796, __pyx_L1_error) + __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_27copy, 0, __pyx_n_s_Circle_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__222)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1796, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_copy, __pyx_t_12) < 0) __PYX_ERR(0, 1796, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":1718 + /* "collisions.py":1802 * return Circle(self.x, self.y, self.r, self.bounciness) * * def __getitem__(self, item: int) -> Number: # <<<<<<<<<<<<<< * if item == 0: * return self.x */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1718, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1802, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 1802, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1802, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_29__getitem__, 0, __pyx_n_s_Circle___getitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__223)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1802, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 1718, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1718, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_25__getitem__, 0, __pyx_n_s_Circle___getitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__210)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1718, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_getitem, __pyx_t_7) < 0) __PYX_ERR(0, 1802, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_getitem, __pyx_t_8) < 0) __PYX_ERR(0, 1718, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":1730 + /* "collisions.py":1814 * ) * * def __setitem__(self, item: int, new: Number) -> None: # <<<<<<<<<<<<<< * if item == 0: * self.x = new */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1730, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 1730, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_new, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1730, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 1730, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_27__setitem__, 0, __pyx_n_s_Circle___setitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__211)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1730, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1814, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_setitem, __pyx_t_7) < 0) __PYX_ERR(0, 1730, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 1814, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_new, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1814, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 1814, __pyx_L1_error) + __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_31__setitem__, 0, __pyx_n_s_Circle___setitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__224)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1814, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_7); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_setitem, __pyx_t_12) < 0) __PYX_ERR(0, 1814, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":1742 + /* "collisions.py":1826 * ) * * def __iter__(self): # <<<<<<<<<<<<<< * return iter((self.x, self.y, self.r)) * */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_29__iter__, 0, __pyx_n_s_Circle___iter, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__212)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1742, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_iter, __pyx_t_7) < 0) __PYX_ERR(0, 1742, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_33__iter__, 0, __pyx_n_s_Circle___iter, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__225)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_iter, __pyx_t_12) < 0) __PYX_ERR(0, 1826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":1745 + /* "collisions.py":1829 * return iter((self.x, self.y, self.r)) * * def __str__(self): # <<<<<<<<<<<<<< * return f'' * */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_31__str__, 0, __pyx_n_s_Circle___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__213)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1745, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_str, __pyx_t_7) < 0) __PYX_ERR(0, 1745, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_6Circle_35__str__, 0, __pyx_n_s_Circle___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__226)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1829, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_str, __pyx_t_12) < 0) __PYX_ERR(0, 1829, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":1370 + /* "collisions.py":1403 * return f'' * * class Circle(Shape): # <<<<<<<<<<<<<< * """A perfect circle. Defined as an x and y centre coordinate of the circle and a radius. * Please be mindful when checking for this class as it is technically a closed shape, but if you try to run \ */ - __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_Circle, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1370, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_CyFunction_InitClassCell(__pyx_t_11, __pyx_t_7) < 0) __PYX_ERR(0, 1370, __pyx_L1_error) + __pyx_t_12 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_Circle, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1403, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (__Pyx_CyFunction_InitClassCell(__pyx_t_11, __pyx_t_12) < 0) __PYX_ERR(0, 1403, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Circle, __pyx_t_7) < 0) __PYX_ERR(0, 1370, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Circle, __pyx_t_12) < 0) __PYX_ERR(0, 1403, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":1748 + /* "collisions.py":1832 * return f'' * * class Arc(Circle): # <<<<<<<<<<<<<< * """A section of a circle's circumfrance. This is in the 'lines' group because it can be used as the outer edge of another shape. * This is defined as an x, y and radius just like a circle, but also with a start and end angle which is used to define the portion of the circle to take. */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Circle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1748, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Circle); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1748, __pyx_L1_error) + __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2)) __PYX_ERR(0, 1748, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2)) __PYX_ERR(0, 1832, __pyx_L1_error); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1748, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1748, __pyx_L1_error) + __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1832, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_n_s_Arc, __pyx_n_s_Arc, (PyObject *) NULL, __pyx_n_s_collisions, __pyx_kp_s_A_section_of_a_circle_s_circumfr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1748, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_12 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_n_s_Arc, __pyx_n_s_Arc, (PyObject *) NULL, __pyx_n_s_collisions, __pyx_kp_s_A_section_of_a_circle_s_circumfr); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_2 != __pyx_t_10) { - if (unlikely((PyDict_SetItemString(__pyx_t_7, "__orig_bases__", __pyx_t_10) < 0))) __PYX_ERR(0, 1748, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_12, "__orig_bases__", __pyx_t_10) < 0))) __PYX_ERR(0, 1832, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":1753 + /* "collisions.py":1839 * * **ANGLES ARE MEASURED IN DEGREES.**""" * GROUPS = {ShpGroups.LINES, ShpGroups.NOTSTRAIGHT} # <<<<<<<<<<<<<< * TYPE = ShpTyps.Arc * def __init__(self, */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1753, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_LINES); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1753, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_LINES); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1753, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_NOTSTRAIGHT); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1753, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_NOTSTRAIGHT); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1839, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PySet_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1753, __pyx_L1_error) + __pyx_t_10 = PySet_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1839, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PySet_Add(__pyx_t_10, __pyx_t_11) < 0) __PYX_ERR(0, 1753, __pyx_L1_error) + if (PySet_Add(__pyx_t_10, __pyx_t_11) < 0) __PYX_ERR(0, 1839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PySet_Add(__pyx_t_10, __pyx_t_8) < 0) __PYX_ERR(0, 1753, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_GROUPS, __pyx_t_10) < 0) __PYX_ERR(0, 1753, __pyx_L1_error) + if (PySet_Add(__pyx_t_10, __pyx_t_7) < 0) __PYX_ERR(0, 1839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_GROUPS, __pyx_t_10) < 0) __PYX_ERR(0, 1839, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":1754 + /* "collisions.py":1840 * **ANGLES ARE MEASURED IN DEGREES.**""" * GROUPS = {ShpGroups.LINES, ShpGroups.NOTSTRAIGHT} * TYPE = ShpTyps.Arc # <<<<<<<<<<<<<< * def __init__(self, * x: Number, */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1754, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1840, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_Arc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1754, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_Arc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1840, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_TYPE, __pyx_t_8) < 0) __PYX_ERR(0, 1754, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_TYPE, __pyx_t_7) < 0) __PYX_ERR(0, 1840, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1755 + /* "collisions.py":1841 * GROUPS = {ShpGroups.LINES, ShpGroups.NOTSTRAIGHT} * TYPE = ShpTyps.Arc * def __init__(self, # <<<<<<<<<<<<<< * x: Number, * y: Number, */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1755, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_x, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1755, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_y, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1755, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_rad, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1755, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_startAngle, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1755, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_endAngle, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1755, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1755, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 1755, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_1__init__, 0, __pyx_n_s_Arc___init, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__215)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1755, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1841, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_x, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1841, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_y, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1841, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_rad, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1841, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_startAngle, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1841, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_endAngle, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1841, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1841, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 1841, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_1__init__, 0, __pyx_n_s_Arc___init, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__228)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1841, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_10, sizeof(__pyx_defaults16), 1)) __PYX_ERR(0, 1755, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_10, sizeof(__pyx_defaults17), 1)) __PYX_ERR(0, 1841, __pyx_L1_error) - /* "collisions.py":1761 + /* "collisions.py":1847 * startAngle: Number, * endAngle: Number, * precision: Number = BASEPRECISION, # <<<<<<<<<<<<<< * bounciness: float = BASEBOUNCINESS * ): */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1761, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1847, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_t_10)->__pyx_arg_precision = __pyx_t_11; + __Pyx_CyFunction_Defaults(__pyx_defaults17, __pyx_t_10)->__pyx_arg_precision = __pyx_t_11; __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":1762 + /* "collisions.py":1848 * endAngle: Number, * precision: Number = BASEPRECISION, * bounciness: float = BASEBOUNCINESS # <<<<<<<<<<<<<< * ): * """ */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1762, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1848, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1762, __pyx_L1_error) + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1848, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_CyFunction_Defaults(__pyx_defaults16, __pyx_t_10)->__pyx_arg_bounciness = __pyx_t_9; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_10, __pyx_pf_10collisions_50__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_init, __pyx_t_10) < 0) __PYX_ERR(0, 1755, __pyx_L1_error) + __Pyx_CyFunction_Defaults(__pyx_defaults17, __pyx_t_10)->__pyx_arg_bounciness = __pyx_t_9; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_10, __pyx_pf_10collisions_52__defaults__); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_init, __pyx_t_10) < 0) __PYX_ERR(0, 1841, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":1781 + /* "collisions.py":1867 * self.bounciness = bounciness * * def area(self) -> Number: # <<<<<<<<<<<<<< * """ * Gets the area of the shape; the length of the arc. */ - __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1781, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1867, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1781, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_3area, 0, __pyx_n_s_Arc_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__217)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1781, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1867, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_3area, 0, __pyx_n_s_Arc_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__230)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1867, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_area, __pyx_t_8) < 0) __PYX_ERR(0, 1781, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_area, __pyx_t_7) < 0) __PYX_ERR(0, 1867, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1794 + /* "collisions.py":1880 * return (diff/360) * 2*math.pi * self.r * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * if checkShpType(othershape, ShpTyps.Point): * if round((self.x - othershape.x)**2 + (self.y - othershape.y)**2, self.precision) != round(self.r**2, self.precision): */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1794, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1794, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_5_collides, 0, __pyx_n_s_Arc__collides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__219)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1794, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1880, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1880, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1880, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_5_collides, 0, __pyx_n_s_Arc__collides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__232)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1880, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_collides, __pyx_t_10) < 0) __PYX_ERR(0, 1794, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_collides, __pyx_t_10) < 0) __PYX_ERR(0, 1880, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":1818 + /* "collisions.py":1904 * return othershape._collides(self) * * def flip(self): # <<<<<<<<<<<<<< * """ * Flips the portion taken to make the arc; so an arc covering 90 degrees of the circle will now cover 270, and vice versa. */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_7flip, 0, __pyx_n_s_Arc_flip, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__220)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1818, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_7flip, 0, __pyx_n_s_Arc_flip, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__233)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1904, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_flip, __pyx_t_10) < 0) __PYX_ERR(0, 1818, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_flip, __pyx_t_10) < 0) __PYX_ERR(0, 1904, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":1824 + /* "collisions.py":1910 * self.startAng, self.endAng = self.endAng, self.startAng * * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * return False * */ - __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1824, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1910, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1824, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1824, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_9_contains, 0, __pyx_n_s_Arc__contains, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__221)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1824, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1910, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1910, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_9_contains, 0, __pyx_n_s_Arc__contains, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__234)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1910, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_contains, __pyx_t_8) < 0) __PYX_ERR(0, 1824, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_contains, __pyx_t_7) < 0) __PYX_ERR(0, 1910, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1827 + /* "collisions.py":1913 * return False * * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * if checkShpType(othershape, ShpTyps.Point): * if self._collides(othershape): */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1827, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 1827, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_11_where, 0, __pyx_n_s_Arc__where, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__223)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1827, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1913, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1913, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 1913, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_11_where, 0, __pyx_n_s_Arc__where, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__236)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1913, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_where, __pyx_t_10) < 0) __PYX_ERR(0, 1827, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_where, __pyx_t_10) < 0) __PYX_ERR(0, 1913, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":1840 + /* "collisions.py":1926 * return othershape._where(self) * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> pointLike|Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Finds the closest point ON THIS OBJECT **TO** the other object */ - __pyx_t_10 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1840, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1926, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1840, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_returnAll, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1840, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_pointLike_Iterable_pointLike) < 0) __PYX_ERR(0, 1840, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_13closestPointTo, 0, __pyx_n_s_Arc_closestPointTo, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__225)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__77); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 1926, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_returnAll, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1926, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_pointLike_Iterable_pointLike) < 0) __PYX_ERR(0, 1926, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_13closestPointTo, 0, __pyx_n_s_Arc_closestPointTo, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__238)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1926, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__81); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_closestPointTo, __pyx_t_8) < 0) __PYX_ERR(0, 1840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_closestPointTo, __pyx_t_7) < 0) __PYX_ERR(0, 1926, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1922 + /* "collisions.py":2008 * return closests[0][0] * * def constrainAng(self, phi: Number) -> Number: # <<<<<<<<<<<<<< * self.startAng, self.endAng = self.startAng % 360, self.endAng % 360 * phi = phi % 360 */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1922, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_phi, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1922, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1922, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_15constrainAng, 0, __pyx_n_s_Arc_constrainAng, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__227)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1922, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2008, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_phi, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2008, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2008, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_15constrainAng, 0, __pyx_n_s_Arc_constrainAng, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__240)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2008, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_constrainAng, __pyx_t_10) < 0) __PYX_ERR(0, 1922, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_constrainAng, __pyx_t_10) < 0) __PYX_ERR(0, 2008, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":1942 + /* "collisions.py":2028 * return phi * * def angleInRange(self, angle: Number) -> bool: # <<<<<<<<<<<<<< * """ * Check to see if an angle is in the range of this arc. */ - __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1942, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2028, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_angle, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1942, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1942, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_17angleInRange, 0, __pyx_n_s_Arc_angleInRange, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__229)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1942, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_angle, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2028, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2028, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_17angleInRange, 0, __pyx_n_s_Arc_angleInRange, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__242)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2028, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_angleInRange, __pyx_t_8) < 0) __PYX_ERR(0, 1942, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_angleInRange, __pyx_t_7) < 0) __PYX_ERR(0, 2028, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1958 + /* "collisions.py":2044 * return self.startAng <= angle%360 <= self.endAng * * def endPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Gets the end points of the arc */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1958, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 1958, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_19endPoints, 0, __pyx_n_s_Arc_endPoints, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__231)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1958, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2044, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 2044, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_19endPoints, 0, __pyx_n_s_Arc_endPoints, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__244)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2044, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_endPoints, __pyx_t_10) < 0) __PYX_ERR(0, 1958, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_endPoints, __pyx_t_10) < 0) __PYX_ERR(0, 2044, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":1970 + /* "collisions.py":2056 * (self.x + self.r * math.cos(endAng), self.y + self.r * math.sin(endAng)) * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ * Returns the rectangle bounding box surrounding this object. */ - __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1970, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2056, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 1970, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_21rect, 0, __pyx_n_s_Arc_rect, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__233)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1970, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 2056, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_21rect, 0, __pyx_n_s_Arc_rect, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__246)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2056, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_rect, __pyx_t_8) < 0) __PYX_ERR(0, 1970, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_rect, __pyx_t_7) < 0) __PYX_ERR(0, 2056, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1997 + /* "collisions.py":2083 * return E, N, W, S * * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< * """ * Finds whether a point is on a corner of this shape. */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1997, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 1997, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 1997, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 1997, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_23isCorner, 0, __pyx_n_s_Arc_isCorner, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__235)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1997, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2083, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2083, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2083, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2083, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_23isCorner, 0, __pyx_n_s_Arc_isCorner, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__248)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_10, sizeof(__pyx_defaults17), 1)) __PYX_ERR(0, 1997, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1997, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_10, sizeof(__pyx_defaults18), 1)) __PYX_ERR(0, 2083, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2083, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_CyFunction_Defaults(__pyx_defaults17, __pyx_t_10)->__pyx_arg_precision = __pyx_t_11; + __Pyx_CyFunction_Defaults(__pyx_defaults18, __pyx_t_10)->__pyx_arg_precision = __pyx_t_11; __Pyx_GIVEREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_10, __pyx_pf_10collisions_52__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_isCorner, __pyx_t_10) < 0) __PYX_ERR(0, 1997, __pyx_L1_error) + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_10, __pyx_pf_10collisions_54__defaults__); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_isCorner, __pyx_t_10) < 0) __PYX_ERR(0, 2083, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2014 + /* "collisions.py":2100 * return False * * def toPoints(self): # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_25toPoints, 0, __pyx_n_s_Arc_toPoints, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__236)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2014, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_25toPoints, 0, __pyx_n_s_Arc_toPoints, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__249)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2100, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_toPoints, __pyx_t_10) < 0) __PYX_ERR(0, 2014, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_toPoints, __pyx_t_10) < 0) __PYX_ERR(0, 2100, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2024 + /* "collisions.py":2110 * ] * * def copy(self) -> 'Arc': # <<<<<<<<<<<<<< * """ * Because Noah's first arc broke, now you need another one. */ - __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2024, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Arc_3) < 0) __PYX_ERR(0, 2024, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_27copy, 0, __pyx_n_s_Arc_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__237)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2024, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Arc_3) < 0) __PYX_ERR(0, 2110, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_27copy, 0, __pyx_n_s_Arc_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__250)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2110, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_copy, __pyx_t_8) < 0) __PYX_ERR(0, 2024, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_copy, __pyx_t_7) < 0) __PYX_ERR(0, 2110, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":2030 + /* "collisions.py":2116 * return Arc(self.x, self.y, self.r, self.startAng, self.endAng, self.precision, self.bounciness) * * def __getitem__(self, item: int) -> Union[Number, pointLike]: # <<<<<<<<<<<<<< * if item == 0: * return self.x */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2030, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 2030, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Union_Number_pointLike) < 0) __PYX_ERR(0, 2030, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_29__getitem__, 0, __pyx_n_s_Arc___getitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__238)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2030, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2116, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 2116, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Union_Number_pointLike) < 0) __PYX_ERR(0, 2116, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_29__getitem__, 0, __pyx_n_s_Arc___getitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__251)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2116, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_8); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_getitem, __pyx_t_10) < 0) __PYX_ERR(0, 2030, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_getitem, __pyx_t_10) < 0) __PYX_ERR(0, 2116, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2046 + /* "collisions.py":2132 * ) * * def __setitem__(self, item: int, new: Union[Number, pointLike]) -> None: # <<<<<<<<<<<<<< * if item == 0: * self.x = new */ - __pyx_t_10 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2046, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 2046, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_new, __pyx_kp_s_Union_Number_pointLike) < 0) __PYX_ERR(0, 2046, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 2046, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_31__setitem__, 0, __pyx_n_s_Arc___setitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__239)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2046, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 2132, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_new, __pyx_kp_s_Union_Number_pointLike) < 0) __PYX_ERR(0, 2132, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 2132, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_31__setitem__, 0, __pyx_n_s_Arc___setitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__252)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2132, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_10); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_setitem, __pyx_t_8) < 0) __PYX_ERR(0, 2046, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_setitem, __pyx_t_7) < 0) __PYX_ERR(0, 2132, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":2062 + /* "collisions.py":2148 * ) * * def __iter__(self): # <<<<<<<<<<<<<< * return iter((self.x, self.y, self.r, self.startAng, self.endAng)) * */ - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_33__iter__, 0, __pyx_n_s_Arc___iter, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__240)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2062, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_iter, __pyx_t_8) < 0) __PYX_ERR(0, 2062, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_33__iter__, 0, __pyx_n_s_Arc___iter, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__253)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2148, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_iter, __pyx_t_7) < 0) __PYX_ERR(0, 2148, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":2065 + /* "collisions.py":2151 * return iter((self.x, self.y, self.r, self.startAng, self.endAng)) * * def __str__(self): # <<<<<<<<<<<<<< * return f'' * */ - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_35__str__, 0, __pyx_n_s_Arc___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__241)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2065, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_str, __pyx_t_8) < 0) __PYX_ERR(0, 2065, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_3Arc_35__str__, 0, __pyx_n_s_Arc___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__254)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2151, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__Pyx_SetNameInClass(__pyx_t_12, __pyx_n_s_str, __pyx_t_7) < 0) __PYX_ERR(0, 2151, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":1748 + /* "collisions.py":1832 * return f'' * * class Arc(Circle): # <<<<<<<<<<<<<< * """A section of a circle's circumfrance. This is in the 'lines' group because it can be used as the outer edge of another shape. * This is defined as an x, y and radius just like a circle, but also with a start and end angle which is used to define the portion of the circle to take. */ - __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_Arc, __pyx_t_2, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1748, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Arc, __pyx_t_8) < 0) __PYX_ERR(0, 1748, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_Arc, __pyx_t_2, __pyx_t_12, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1832, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Arc, __pyx_t_7) < 0) __PYX_ERR(0, 1832, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2068 + /* "collisions.py":2154 * return f'' * * class ClosedShape(Shape): # <<<<<<<<<<<<<< * """These are shapes like rects and polygons; if you split them into a list of lines all the lines join with one another. * Please do not use this class as it is just a building block for subclasses and to provide them with some basic methods.""" */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2068, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2068, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 2068, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2)) __PYX_ERR(0, 2154, __pyx_L1_error); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2068, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2068, __pyx_L1_error) + __pyx_t_12 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_12, __pyx_t_2, __pyx_n_s_ClosedShape, __pyx_n_s_ClosedShape, (PyObject *) NULL, __pyx_n_s_collisions, __pyx_kp_s_These_are_shapes_like_rects_and); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2154, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_2, __pyx_n_s_ClosedShape, __pyx_n_s_ClosedShape, (PyObject *) NULL, __pyx_n_s_collisions, __pyx_kp_s_These_are_shapes_like_rects_and); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2068, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_2 != __pyx_t_3) { - if (unlikely((PyDict_SetItemString(__pyx_t_8, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 2068, __pyx_L1_error) + if (unlikely((PyDict_SetItemString(__pyx_t_7, "__orig_bases__", __pyx_t_3) < 0))) __PYX_ERR(0, 2154, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2071 + /* "collisions.py":2157 * """These are shapes like rects and polygons; if you split them into a list of lines all the lines join with one another. * Please do not use this class as it is just a building block for subclasses and to provide them with some basic methods.""" - * GROUPS = {ShpGroups.CLOSED} # <<<<<<<<<<<<<< + * GROUPS = {ShpGroups.CLOSED, ShpGroups.SPLITTABLE} # <<<<<<<<<<<<<< * def _where(self, othershape: Shape) -> Iterable[pointLike]: * if not self.check_rects(othershape): */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2071, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CLOSED); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2071, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_CLOSED); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2071, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpGroups); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PySet_Add(__pyx_t_3, __pyx_t_10) < 0) __PYX_ERR(0, 2071, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_SPLITTABLE); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2157, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (PySet_Add(__pyx_t_3, __pyx_t_10) < 0) __PYX_ERR(0, 2157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_GROUPS, __pyx_t_3) < 0) __PYX_ERR(0, 2071, __pyx_L1_error) + if (PySet_Add(__pyx_t_3, __pyx_t_11) < 0) __PYX_ERR(0, 2157, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_GROUPS, __pyx_t_3) < 0) __PYX_ERR(0, 2157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2072 + /* "collisions.py":2158 * Please do not use this class as it is just a building block for subclasses and to provide them with some basic methods.""" - * GROUPS = {ShpGroups.CLOSED} + * GROUPS = {ShpGroups.CLOSED, ShpGroups.SPLITTABLE} * def _where(self, othershape: Shape) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * if not self.check_rects(othershape): * return [] */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2072, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 2072, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 2072, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_1_where, 0, __pyx_n_s_ClosedShape__where, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__243)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2072, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 2158, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 2158, __pyx_L1_error) + __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_1_where, 0, __pyx_n_s_ClosedShape__where, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__256)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2158, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_where, __pyx_t_10) < 0) __PYX_ERR(0, 2072, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_where, __pyx_t_11) < 0) __PYX_ERR(0, 2158, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2086 + /* "collisions.py":2172 * return points * * def tangent(self, point: pointLike, vel: pointLike) -> Number: # <<<<<<<<<<<<<< * """ * Finds the tangent on this surface to a point with a given velocity. */ - __pyx_t_10 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2086, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2086, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2086, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2086, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_3tangent, 0, __pyx_n_s_ClosedShape_tangent, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__245)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2086, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2172, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2172, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2172, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2172, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_3tangent, 0, __pyx_n_s_ClosedShape_tangent, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__258)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_tangent, __pyx_t_3) < 0) __PYX_ERR(0, 2086, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_11); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_tangent, __pyx_t_3) < 0) __PYX_ERR(0, 2172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2120 + /* "collisions.py":2206 * return ps[0][0] * * def closestPointTo(self, othershape: Shape, returnAll: bool = False) -> Union[pointLike, Iterable[pointLike]]: # <<<<<<<<<<<<<< * """ * Find the closest point ON this object TO another object. */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2120, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 2120, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_returnAll, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2120, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Union_pointLike_Iterable_pointLi) < 0) __PYX_ERR(0, 2120, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_5closestPointTo, 0, __pyx_n_s_ClosedShape_closestPointTo, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__247)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2120, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_10, __pyx_tuple__77); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 2206, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_returnAll, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2206, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Union_pointLike_Iterable_pointLi) < 0) __PYX_ERR(0, 2206, __pyx_L1_error) + __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_5closestPointTo, 0, __pyx_n_s_ClosedShape_closestPointTo, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__260)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2206, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_11, __pyx_tuple__81); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_closestPointTo, __pyx_t_10) < 0) __PYX_ERR(0, 2120, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_closestPointTo, __pyx_t_11) < 0) __PYX_ERR(0, 2206, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2200 + /* "collisions.py":2286 * return tries[0][0] * * def handleCollisionsPos(self, # <<<<<<<<<<<<<< * oldShp: 'ClosedShape', * newShp: 'ClosedShape', */ - __pyx_t_10 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2200, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_oldShp, __pyx_kp_s_ClosedShape_2) < 0) __PYX_ERR(0, 2200, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_newShp, __pyx_kp_s_ClosedShape_2) < 0) __PYX_ERR(0, 2200, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_objs, __pyx_kp_s_Union_Shapes_Iterable_Shape_2) < 0) __PYX_ERR(0, 2200, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2200, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2200, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2200, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2200, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_tuple_ClosedShape_pointLike_verb) < 0) __PYX_ERR(0, 2200, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_7handleCollisionsPos, 0, __pyx_n_s_ClosedShape_handleCollisionsPos_2, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__249)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2200, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyDict_NewPresized(8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2286, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_oldShp, __pyx_kp_s_ClosedShape_2) < 0) __PYX_ERR(0, 2286, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_newShp, __pyx_kp_s_ClosedShape_2) < 0) __PYX_ERR(0, 2286, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_objs, __pyx_kp_s_Union_Shapes_Iterable_Shape_2) < 0) __PYX_ERR(0, 2286, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2286, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2286, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2286, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2286, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_kp_s_tuple_ClosedShape_pointLike_verb) < 0) __PYX_ERR(0, 2286, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_7handleCollisionsPos, 0, __pyx_n_s_ClosedShape_handleCollisionsPos_2, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__262)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults18), 2)) __PYX_ERR(0, 2200, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults19), 2)) __PYX_ERR(0, 2286, __pyx_L1_error) - /* "collisions.py":2204 + /* "collisions.py":2290 * newShp: 'ClosedShape', * objs: Union[Shapes, Iterable[Shape]], * vel: pointLike = [0, 0], # <<<<<<<<<<<<<< * replaceSelf: bool = True, * precision: Number = BASEPRECISION, */ - __pyx_t_11 = PyList_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2204, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = PyList_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2290, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 0, __pyx_int_0)) __PYX_ERR(0, 2204, __pyx_L1_error); + if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 0, __pyx_int_0)) __PYX_ERR(0, 2290, __pyx_L1_error); __Pyx_INCREF(__pyx_int_0); __Pyx_GIVEREF(__pyx_int_0); - if (__Pyx_PyList_SET_ITEM(__pyx_t_11, 1, __pyx_int_0)) __PYX_ERR(0, 2204, __pyx_L1_error); - __Pyx_CyFunction_Defaults(__pyx_defaults18, __pyx_t_3)->__pyx_arg_vel = __pyx_t_11; - __Pyx_GIVEREF(__pyx_t_11); - __pyx_t_11 = 0; + if (__Pyx_PyList_SET_ITEM(__pyx_t_10, 1, __pyx_int_0)) __PYX_ERR(0, 2290, __pyx_L1_error); + __Pyx_CyFunction_Defaults(__pyx_defaults19, __pyx_t_3)->__pyx_arg_vel = __pyx_t_10; + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; - /* "collisions.py":2206 + /* "collisions.py":2292 * vel: pointLike = [0, 0], * replaceSelf: bool = True, * precision: Number = BASEPRECISION, # <<<<<<<<<<<<<< * verbose: bool = False * ) -> tuple['ClosedShape', pointLike, verboseOutput]: */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2206, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_CyFunction_Defaults(__pyx_defaults18, __pyx_t_3)->__pyx_arg_precision = __pyx_t_11; - __Pyx_GIVEREF(__pyx_t_11); - __pyx_t_11 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_10collisions_54__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_handleCollisionsPos, __pyx_t_3) < 0) __PYX_ERR(0, 2200, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_CyFunction_Defaults(__pyx_defaults19, __pyx_t_3)->__pyx_arg_precision = __pyx_t_10; + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_10collisions_56__defaults__); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_11); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_handleCollisionsPos, __pyx_t_3) < 0) __PYX_ERR(0, 2286, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2353 + /* "collisions.py":2439 * return out, outvel * * def handleCollisionsVel(self, # <<<<<<<<<<<<<< * vel: pointLike, * objs: Union[Shapes, Iterable[Shape]], */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2353, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2439, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2353, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_objs, __pyx_kp_s_Union_Shapes_Iterable_Shape_2) < 0) __PYX_ERR(0, 2353, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2353, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2353, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2353, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_tuple_ClosedShape_pointLike_verb) < 0) __PYX_ERR(0, 2353, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_9handleCollisionsVel, 0, __pyx_n_s_ClosedShape_handleCollisionsVel, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__251)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2353, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_10, sizeof(__pyx_defaults19), 1)) __PYX_ERR(0, 2353, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_vel, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2439, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_objs, __pyx_kp_s_Union_Shapes_Iterable_Shape_2) < 0) __PYX_ERR(0, 2439, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_replaceSelf, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2439, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2439, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verbose, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2439, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_tuple_ClosedShape_pointLike_verb) < 0) __PYX_ERR(0, 2439, __pyx_L1_error) + __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_9handleCollisionsVel, 0, __pyx_n_s_ClosedShape_handleCollisionsVel, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__264)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2439, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_11, sizeof(__pyx_defaults20), 1)) __PYX_ERR(0, 2439, __pyx_L1_error) - /* "collisions.py":2357 + /* "collisions.py":2443 * objs: Union[Shapes, Iterable[Shape]], * replaceSelf: bool = True, * precision: Number = BASEPRECISION, # <<<<<<<<<<<<<< * verbose: bool = False * ) -> tuple['ClosedShape', pointLike, verboseOutput]: */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2357, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_CyFunction_Defaults(__pyx_defaults19, __pyx_t_10)->__pyx_arg_precision = __pyx_t_11; - __Pyx_GIVEREF(__pyx_t_11); - __pyx_t_11 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_10, __pyx_pf_10collisions_56__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2443, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_CyFunction_Defaults(__pyx_defaults20, __pyx_t_11)->__pyx_arg_precision = __pyx_t_10; + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_11, __pyx_pf_10collisions_58__defaults__); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_handleCollisionsVel, __pyx_t_10) < 0) __PYX_ERR(0, 2353, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_handleCollisionsVel, __pyx_t_11) < 0) __PYX_ERR(0, 2439, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2387 + /* "collisions.py":2473 * return out, outvel * * def _containsPoint(self, point: Point) -> bool: # <<<<<<<<<<<<<< * return self._collides(point) and self.whereCollides(point) == [] * */ - __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2387, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_point, __pyx_n_s_Point) < 0) __PYX_ERR(0, 2387, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2387, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_11_containsPoint, 0, __pyx_n_s_ClosedShape__containsPoint, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__253)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2387, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2473, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_point, __pyx_n_s_Point) < 0) __PYX_ERR(0, 2473, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2473, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_11_containsPoint, 0, __pyx_n_s_ClosedShape__containsPoint, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__266)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_containsPoint, __pyx_t_3) < 0) __PYX_ERR(0, 2387, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_11); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_containsPoint, __pyx_t_3) < 0) __PYX_ERR(0, 2473, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2390 + /* "collisions.py":2476 * return self._collides(point) and self.whereCollides(point) == [] * * def _contains(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * if checkShpType(othershape, ShpTyps.Point): * return self._containsPoint(othershape) */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2390, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 2390, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2390, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_13_contains, 0, __pyx_n_s_ClosedShape__contains, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__255)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2390, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 2476, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2476, __pyx_L1_error) + __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_13_contains, 0, __pyx_n_s_ClosedShape__contains, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__268)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2476, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_contains, __pyx_t_10) < 0) __PYX_ERR(0, 2390, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_contains, __pyx_t_11) < 0) __PYX_ERR(0, 2476, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2400 + /* "collisions.py":2486 * return all(self._contains(Point(*p)) for p in othershape.toPoints()) * * def isCorner(self, point: pointLike, precision: Number = BASEPRECISION) -> bool: # <<<<<<<<<<<<<< * """ * Finds whether a point is on a corner of this shape. */ - __pyx_t_10 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2400, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2400, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2400, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2400, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_15isCorner, 0, __pyx_n_s_ClosedShape_isCorner, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__257)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2400, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults20), 1)) __PYX_ERR(0, 2400, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2400, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2486, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __Pyx_CyFunction_Defaults(__pyx_defaults20, __pyx_t_3)->__pyx_arg_precision = __pyx_t_11; - __Pyx_GIVEREF(__pyx_t_11); - __pyx_t_11 = 0; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_10collisions_58__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_isCorner, __pyx_t_3) < 0) __PYX_ERR(0, 2400, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_point, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2486, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_precision, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2486, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2486, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_15isCorner, 0, __pyx_n_s_ClosedShape_isCorner, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__270)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2486, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults21), 1)) __PYX_ERR(0, 2486, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_BASEPRECISION); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2486, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_CyFunction_Defaults(__pyx_defaults21, __pyx_t_3)->__pyx_arg_precision = __pyx_t_10; + __Pyx_GIVEREF(__pyx_t_10); + __pyx_t_10 = 0; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_10collisions_60__defaults__); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_11); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_isCorner, __pyx_t_3) < 0) __PYX_ERR(0, 2486, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2416 + /* "collisions.py":2502 * return False * * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2416, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_Line_2) < 0) __PYX_ERR(0, 2416, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_17toLines, 0, __pyx_n_s_ClosedShape_toLines, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__258)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2416, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_Line_2) < 0) __PYX_ERR(0, 2502, __pyx_L1_error) + __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_17toLines, 0, __pyx_n_s_ClosedShape_toLines, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__271)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2502, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_toLines, __pyx_t_10) < 0) __PYX_ERR(0, 2416, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_toLines, __pyx_t_11) < 0) __PYX_ERR(0, 2502, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2423 + /* "collisions.py":2509 * return [] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2423, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 2423, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_19toPoints, 0, __pyx_n_s_ClosedShape_toPoints, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__259)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2423, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2509, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 2509, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_19toPoints, 0, __pyx_n_s_ClosedShape_toPoints, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__272)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_toPoints, __pyx_t_3) < 0) __PYX_ERR(0, 2423, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_11); + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_toPoints, __pyx_t_3) < 0) __PYX_ERR(0, 2509, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2430 + /* "collisions.py":2516 * return [] * * def __getitem__(self, item: int) -> pointLike: # <<<<<<<<<<<<<< * return self.toPoints()[item] * */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2430, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 2430, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2430, __pyx_L1_error) - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_21__getitem__, 0, __pyx_n_s_ClosedShape___getitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__260)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2430, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 2516, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2516, __pyx_L1_error) + __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_21__getitem__, 0, __pyx_n_s_ClosedShape___getitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__273)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2516, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_getitem, __pyx_t_10) < 0) __PYX_ERR(0, 2430, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_getitem, __pyx_t_11) < 0) __PYX_ERR(0, 2516, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2433 + /* "collisions.py":2519 * return self.toPoints()[item] * * def __iter__(self): # <<<<<<<<<<<<<< * return iter(self.toPoints()) * */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_23__iter__, 0, __pyx_n_s_ClosedShape___iter, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__261)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2433, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_iter, __pyx_t_10) < 0) __PYX_ERR(0, 2433, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_23__iter__, 0, __pyx_n_s_ClosedShape___iter, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__274)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2519, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_iter, __pyx_t_11) < 0) __PYX_ERR(0, 2519, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2436 + /* "collisions.py":2522 * return iter(self.toPoints()) * * def __str__(self): # <<<<<<<<<<<<<< * return '' * */ - __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_25__str__, 0, __pyx_n_s_ClosedShape___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__262)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2436, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_n_s_str, __pyx_t_10) < 0) __PYX_ERR(0, 2436, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11ClosedShape_25__str__, 0, __pyx_n_s_ClosedShape___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__275)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2522, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_n_s_str, __pyx_t_11) < 0) __PYX_ERR(0, 2522, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "collisions.py":2068 + /* "collisions.py":2154 * return f'' * * class ClosedShape(Shape): # <<<<<<<<<<<<<< * """These are shapes like rects and polygons; if you split them into a list of lines all the lines join with one another. * Please do not use this class as it is just a building block for subclasses and to provide them with some basic methods.""" */ - __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_ClosedShape, __pyx_t_2, __pyx_t_8, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2068, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ClosedShape, __pyx_t_10) < 0) __PYX_ERR(0, 2068, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_12, __pyx_n_s_ClosedShape, __pyx_t_2, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2154, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ClosedShape, __pyx_t_11) < 0) __PYX_ERR(0, 2154, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2439 + /* "collisions.py":2525 * return '' * * class Rect(ClosedShape): # <<<<<<<<<<<<<< * """A Rectangle. It is defined with an x, y, width and height.""" * TYPE = ShpTyps.Rect */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ClosedShape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2439, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ClosedShape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2525, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2)) __PYX_ERR(0, 2439, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2)) __PYX_ERR(0, 2525, __pyx_L1_error); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2439, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_8, __pyx_t_2, __pyx_n_s_Rect, __pyx_n_s_Rect, (PyObject *) NULL, __pyx_n_s_collisions, __pyx_kp_s_A_Rectangle_It_is_defined_with_a); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2439, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - if (__pyx_t_2 != __pyx_t_7) { - if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_t_7) < 0))) __PYX_ERR(0, 2439, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2439, __pyx_L1_error) + __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); + __pyx_t_11 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_2, __pyx_n_s_Rect, __pyx_n_s_Rect, (PyObject *) NULL, __pyx_n_s_collisions, __pyx_kp_s_A_Rectangle_It_is_defined_with_a); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2525, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + if (__pyx_t_2 != __pyx_t_12) { + if (unlikely((PyDict_SetItemString(__pyx_t_11, "__orig_bases__", __pyx_t_12) < 0))) __PYX_ERR(0, 2525, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = PyList_New(0); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2525, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); - /* "collisions.py":2441 + /* "collisions.py":2527 * class Rect(ClosedShape): * """A Rectangle. It is defined with an x, y, width and height.""" * TYPE = ShpTyps.Rect # <<<<<<<<<<<<<< * def __init__(self, x: Number, y: Number, w: Number, h: Number, bounciness: float = BASEBOUNCINESS): * """ */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2441, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2441, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Rect); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2527, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_TYPE, __pyx_t_11) < 0) __PYX_ERR(0, 2441, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_TYPE, __pyx_t_10) < 0) __PYX_ERR(0, 2527, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2442 + /* "collisions.py":2528 * """A Rectangle. It is defined with an x, y, width and height.""" * TYPE = ShpTyps.Rect * def __init__(self, x: Number, y: Number, w: Number, h: Number, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< * """ * Args: */ - __pyx_t_11 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2442, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_x, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2442, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_y, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2442, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_w, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2442, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_h, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2442, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 2442, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Rect_1__init__, 0, __pyx_n_s_Rect___init, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__264)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2442, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2528, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_x, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2528, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_y, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2528, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_w, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2528, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_h, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2528, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 2528, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Rect_1__init__, 0, __pyx_n_s_Rect___init, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__277)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_t_3); - PyList_Append(__pyx_t_7, __pyx_t_3); + PyList_Append(__pyx_t_12, __pyx_t_3); __Pyx_GIVEREF(__pyx_t_3); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults21), 0)) __PYX_ERR(0, 2442, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2442, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2442, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_CyFunction_Defaults(__pyx_defaults21, __pyx_t_3)->__pyx_arg_bounciness = __pyx_t_9; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_10collisions_60__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_11); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 2442, __pyx_L1_error) + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults22), 0)) __PYX_ERR(0, 2528, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2528, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2528, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_CyFunction_Defaults(__pyx_defaults22, __pyx_t_3)->__pyx_arg_bounciness = __pyx_t_9; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_3, __pyx_pf_10collisions_62__defaults__); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 2528, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2454 + /* "collisions.py":2540 * self.x, self.y, self.w, self.h = x, y, w, h * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ * Returns the rectangle bounding box surrounding this rectangle, which is virtually just the rectangle itself in a different form. */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2454, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2540, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 2454, __pyx_L1_error) - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Rect_3rect, 0, __pyx_n_s_Rect_rect, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__265)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2454, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 2540, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Rect_3rect, 0, __pyx_n_s_Rect_rect, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__278)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2540, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_rect, __pyx_t_11) < 0) __PYX_ERR(0, 2454, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_rect, __pyx_t_10) < 0) __PYX_ERR(0, 2540, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2463 + /* "collisions.py":2549 * return min(self.x, self.x + self.w), min(self.y, self.y + self.h), max(self.x, self.x + self.w), max(self.y, self.y + self.h) * * def area(self) -> Number: # <<<<<<<<<<<<<< * """ * Gets the area of the shape; width * height. */ - __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2463, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2463, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Rect_5area, 0, __pyx_n_s_Rect_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__266)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2463, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2549, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2549, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Rect_5area, 0, __pyx_n_s_Rect_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__279)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2549, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_11); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_area, __pyx_t_3) < 0) __PYX_ERR(0, 2463, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_area, __pyx_t_3) < 0) __PYX_ERR(0, 2549, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2472 + /* "collisions.py":2558 * return self.w * self.h * * def _containsPoint(self, point: Point) -> bool: # <<<<<<<<<<<<<< * x, y, mx, my = self.rect() * return x < point.x < mx and y < point.y and my > point.y */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2472, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_point, __pyx_n_s_Point) < 0) __PYX_ERR(0, 2472, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2472, __pyx_L1_error) - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Rect_7_containsPoint, 0, __pyx_n_s_Rect__containsPoint, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__268)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2472, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_point, __pyx_n_s_Point) < 0) __PYX_ERR(0, 2558, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2558, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Rect_7_containsPoint, 0, __pyx_n_s_Rect__containsPoint, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__281)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2558, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_containsPoint, __pyx_t_11) < 0) __PYX_ERR(0, 2472, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_containsPoint, __pyx_t_10) < 0) __PYX_ERR(0, 2558, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2476 + /* "collisions.py":2562 * return x < point.x < mx and y < point.y and my > point.y * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * x, y, mx, my = self.rect() * if checkShpType(othershape, ShpTyps.Point): */ - __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2476, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 2476, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2476, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Rect_9_collides, 0, __pyx_n_s_Rect__collides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__270)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2476, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2562, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 2562, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2562, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Rect_9_collides, 0, __pyx_n_s_Rect__collides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__283)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_11); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_collides, __pyx_t_3) < 0) __PYX_ERR(0, 2476, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_collides, __pyx_t_3) < 0) __PYX_ERR(0, 2562, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2507 + /* "collisions.py":2593 * return othershape._collides(self) * * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2507, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_Line_2) < 0) __PYX_ERR(0, 2507, __pyx_L1_error) - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Rect_11toLines, 0, __pyx_n_s_Rect_toLines, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__271)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2507, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Iterable_Line_2) < 0) __PYX_ERR(0, 2593, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Rect_11toLines, 0, __pyx_n_s_Rect_toLines, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__284)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_toLines, __pyx_t_11) < 0) __PYX_ERR(0, 2507, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_toLines, __pyx_t_10) < 0) __PYX_ERR(0, 2593, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2519 + /* "collisions.py":2605 * ] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2519, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 2519, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Rect_13toPoints, 0, __pyx_n_s_Rect_toPoints, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__272)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2519, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2605, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 2605, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Rect_13toPoints, 0, __pyx_n_s_Rect_toPoints, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__285)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2605, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_11); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_toPoints, __pyx_t_3) < 0) __PYX_ERR(0, 2519, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_toPoints, __pyx_t_3) < 0) __PYX_ERR(0, 2605, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2531 + /* "collisions.py":2617 * ] * * def copy(self) -> 'Rect': # <<<<<<<<<<<<<< * """ * Clone this object using the latest cloning technology. */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2531, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2617, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Rect_3) < 0) __PYX_ERR(0, 2531, __pyx_L1_error) - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Rect_15copy, 0, __pyx_n_s_Rect_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__273)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2531, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_kp_s_Rect_3) < 0) __PYX_ERR(0, 2617, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Rect_15copy, 0, __pyx_n_s_Rect_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__286)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2617, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_copy, __pyx_t_11) < 0) __PYX_ERR(0, 2531, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_copy, __pyx_t_10) < 0) __PYX_ERR(0, 2617, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2537 + /* "collisions.py":2623 * return Rect(self.x, self.y, self.w, self.h, self.bounciness) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< * if item == 0: * self.x, self.y = new[0], new[1] */ - __pyx_t_11 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2537, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 2537, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_new, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2537, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 2537, __pyx_L1_error) - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Rect_17__setitem__, 0, __pyx_n_s_Rect___setitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__274)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2537, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2623, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 2623, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_new, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2623, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 2623, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Rect_17__setitem__, 0, __pyx_n_s_Rect___setitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__287)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2623, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_11); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_setitem, __pyx_t_3) < 0) __PYX_ERR(0, 2537, __pyx_L1_error) + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_3, __pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_setitem, __pyx_t_3) < 0) __PYX_ERR(0, 2623, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2551 + /* "collisions.py":2637 * ) * * def __str__(self): # <<<<<<<<<<<<<< * return f'' * */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Rect_19__str__, 0, __pyx_n_s_Rect___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__275)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2551, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_4Rect_19__str__, 0, __pyx_n_s_Rect___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__288)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2637, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_str, __pyx_t_3) < 0) __PYX_ERR(0, 2551, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_str, __pyx_t_3) < 0) __PYX_ERR(0, 2637, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2439 + /* "collisions.py":2525 * return '' * * class Rect(ClosedShape): # <<<<<<<<<<<<<< * """A Rectangle. It is defined with an x, y, width and height.""" * TYPE = ShpTyps.Rect */ - __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_8, __pyx_n_s_Rect, __pyx_t_2, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2439, __pyx_L1_error) + __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_Rect, __pyx_t_2, __pyx_t_11, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2525, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_CyFunction_InitClassCell(__pyx_t_7, __pyx_t_3) < 0) __PYX_ERR(0, 2439, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rect, __pyx_t_3) < 0) __PYX_ERR(0, 2439, __pyx_L1_error) + if (__Pyx_CyFunction_InitClassCell(__pyx_t_12, __pyx_t_3) < 0) __PYX_ERR(0, 2525, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Rect, __pyx_t_3) < 0) __PYX_ERR(0, 2525, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2554 + /* "collisions.py":2640 * return f'' * * class RotatedRect(ClosedShape): # <<<<<<<<<<<<<< * """A rectangle...... That is rotated. * It is rotated around it's x and y coordinates. */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ClosedShape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2554, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ClosedShape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2554, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2)) __PYX_ERR(0, 2554, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2)) __PYX_ERR(0, 2640, __pyx_L1_error); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2554, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2554, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_10, __pyx_t_2, __pyx_n_s_RotatedRect, __pyx_n_s_RotatedRect, (PyObject *) NULL, __pyx_n_s_collisions, __pyx_kp_s_A_rectangle_That_is_rotated_It_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2554, __pyx_L1_error) + __pyx_t_11 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); + __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_11, __pyx_t_2, __pyx_n_s_RotatedRect, __pyx_n_s_RotatedRect, (PyObject *) NULL, __pyx_n_s_collisions, __pyx_kp_s_A_rectangle_That_is_rotated_It_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2640, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__pyx_t_2 != __pyx_t_8) { - if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_8) < 0))) __PYX_ERR(0, 2554, __pyx_L1_error) + if (__pyx_t_2 != __pyx_t_7) { + if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_7) < 0))) __PYX_ERR(0, 2640, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2554, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); - /* "collisions.py":2558 + /* "collisions.py":2644 * It is rotated around it's x and y coordinates. * Defined as an x, y, width, height and rotation.""" * TYPE = ShpTyps.RotRect # <<<<<<<<<<<<<< * def __init__(self, x: Number, y: Number, w: Number, h: Number, rotation: Number, bounciness: float = BASEBOUNCINESS): * """ */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2558, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_RotRect); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2558, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_TYPE, __pyx_t_11) < 0) __PYX_ERR(0, 2558, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_RotRect); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2644, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_TYPE, __pyx_t_10) < 0) __PYX_ERR(0, 2644, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2559 + /* "collisions.py":2645 * Defined as an x, y, width, height and rotation.""" * TYPE = ShpTyps.RotRect * def __init__(self, x: Number, y: Number, w: Number, h: Number, rotation: Number, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< * """ * Args: */ - __pyx_t_11 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2559, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_x, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2559, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_y, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2559, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_w, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2559, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_h, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2559, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_rotation, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2559, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 2559, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_1__init__, 0, __pyx_n_s_RotatedRect___init, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__277)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2559, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_INCREF(__pyx_t_7); - PyList_Append(__pyx_t_8, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_7); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_7, sizeof(__pyx_defaults22), 0)) __PYX_ERR(0, 2559, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2559, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2645, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_x, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2645, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_y, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2645, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_w, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2645, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_h, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2645, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_rotation, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2645, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 2645, __pyx_L1_error) + __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_1__init__, 0, __pyx_n_s_RotatedRect___init, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__290)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2645, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2559, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_12); + PyList_Append(__pyx_t_7, __pyx_t_12); + __Pyx_GIVEREF(__pyx_t_12); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_12, sizeof(__pyx_defaults23), 0)) __PYX_ERR(0, 2645, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2645, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2645, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_CyFunction_Defaults(__pyx_defaults23, __pyx_t_12)->__pyx_arg_bounciness = __pyx_t_9; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_12, __pyx_pf_10collisions_64__defaults__); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_12) < 0) __PYX_ERR(0, 2645, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_CyFunction_Defaults(__pyx_defaults22, __pyx_t_7)->__pyx_arg_bounciness = __pyx_t_9; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_7, __pyx_pf_10collisions_62__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_11); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_7) < 0) __PYX_ERR(0, 2559, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":2574 + /* "collisions.py":2660 * self.cacheRequirements = [] * * def getCache(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Specifically for the rotatedRect. This is a utility function to cache the rotated points so it doesn't have to re-rotate them every time. */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2574, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 2574, __pyx_L1_error) - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_3getCache, 0, __pyx_n_s_RotatedRect_getCache, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__279)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2574, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_getCache, __pyx_t_11) < 0) __PYX_ERR(0, 2574, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2660, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 2660, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_3getCache, 0, __pyx_n_s_RotatedRect_getCache, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__292)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2660, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_getCache, __pyx_t_10) < 0) __PYX_ERR(0, 2660, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2598 + /* "collisions.py":2684 * return [[i[0]+self.x, i[1]+self.y] for i in self.cache] * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ * Returns the rectangle bounding box surrounding this rectangle. */ - __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 2598, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_5rect, 0, __pyx_n_s_RotatedRect_rect, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__281)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2598, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_11); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rect, __pyx_t_7) < 0) __PYX_ERR(0, 2598, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 2684, __pyx_L1_error) + __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_5rect, 0, __pyx_n_s_RotatedRect_rect, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__294)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2684, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_rect, __pyx_t_12) < 0) __PYX_ERR(0, 2684, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":2608 + /* "collisions.py":2694 * return min([i[0] for i in ps]), min([i[1] for i in ps]), max([i[0] for i in ps]), max([i[1] for i in ps]) * * def area(self) -> Number: # <<<<<<<<<<<<<< * """ * Gets the area of the shape; width * height. */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2608, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2608, __pyx_L1_error) - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_7area, 0, __pyx_n_s_RotatedRect_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__282)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2608, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_area, __pyx_t_11) < 0) __PYX_ERR(0, 2608, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2694, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2694, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_7area, 0, __pyx_n_s_RotatedRect_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__295)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2694, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_area, __pyx_t_10) < 0) __PYX_ERR(0, 2694, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2617 + /* "collisions.py":2703 * return self.w * self.h * * def _containsPoint(self, point: Point) -> bool: # <<<<<<<<<<<<<< * newp = rotate((self.x, self.y), point, -self.rot) * return self.x < newp[0] < (self.x+self.w) and self.y < newp[1] < (self.y+self.h) */ - __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2617, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_point, __pyx_n_s_Point) < 0) __PYX_ERR(0, 2617, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2617, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_9_containsPoint, 0, __pyx_n_s_RotatedRect__containsPoint, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__284)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2617, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_11); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_containsPoint, __pyx_t_7) < 0) __PYX_ERR(0, 2617, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_point, __pyx_n_s_Point) < 0) __PYX_ERR(0, 2703, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2703, __pyx_L1_error) + __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_9_containsPoint, 0, __pyx_n_s_RotatedRect__containsPoint, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__297)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2703, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_containsPoint, __pyx_t_12) < 0) __PYX_ERR(0, 2703, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":2621 + /* "collisions.py":2707 * return self.x < newp[0] < (self.x+self.w) and self.y < newp[1] < (self.y+self.h) * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * if not self.check_rects(othershape): * return False */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2621, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 2621, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2621, __pyx_L1_error) - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_11_collides, 0, __pyx_n_s_RotatedRect__collides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__286)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2621, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_collides, __pyx_t_11) < 0) __PYX_ERR(0, 2621, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2707, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 2707, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2707, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_11_collides, 0, __pyx_n_s_RotatedRect__collides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__299)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2707, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_collides, __pyx_t_10) < 0) __PYX_ERR(0, 2707, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2655 + /* "collisions.py":2741 * return othershape._collides(self) * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2655, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 2655, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_13toPoints, 0, __pyx_n_s_RotatedRect_toPoints, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__287)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2655, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_11); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_toPoints, __pyx_t_7) < 0) __PYX_ERR(0, 2655, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 2741, __pyx_L1_error) + __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_13toPoints, 0, __pyx_n_s_RotatedRect_toPoints, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__300)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2741, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_toPoints, __pyx_t_12) < 0) __PYX_ERR(0, 2741, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":2662 + /* "collisions.py":2748 * return self.getCache() * * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2662, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Iterable_Line_2) < 0) __PYX_ERR(0, 2662, __pyx_L1_error) - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_15toLines, 0, __pyx_n_s_RotatedRect_toLines, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__289)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2662, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_toLines, __pyx_t_11) < 0) __PYX_ERR(0, 2662, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2748, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_kp_s_Iterable_Line_2) < 0) __PYX_ERR(0, 2748, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_15toLines, 0, __pyx_n_s_RotatedRect_toLines, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__302)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2748, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_toLines, __pyx_t_10) < 0) __PYX_ERR(0, 2748, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2673 + /* "collisions.py":2759 * ] + [Line(ps[len(ps)-1], ps[0])] * * def copy(self) -> 'RotatedRect': # <<<<<<<<<<<<<< * """ * Spawn in a duplicate object */ - __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2673, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_kp_s_RotatedRect_3) < 0) __PYX_ERR(0, 2673, __pyx_L1_error) - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_17copy, 0, __pyx_n_s_RotatedRect_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__290)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2673, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_11); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_copy, __pyx_t_7) < 0) __PYX_ERR(0, 2673, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2759, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_RotatedRect_3) < 0) __PYX_ERR(0, 2759, __pyx_L1_error) + __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_17copy, 0, __pyx_n_s_RotatedRect_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__303)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2759, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_copy, __pyx_t_12) < 0) __PYX_ERR(0, 2759, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":2679 + /* "collisions.py":2765 * return RotatedRect(self.x, self.y, self.w, self.h, self.rot, self.bounciness) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< * def rot(x, y): * return rotate([self.x, self.y], [x, y], self.rot) */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 2679, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_new, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2679, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 2679, __pyx_L1_error) - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_19__setitem__, 0, __pyx_n_s_RotatedRect___setitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__292)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2679, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_7); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_setitem, __pyx_t_11) < 0) __PYX_ERR(0, 2679, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_12 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2765, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 2765, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_new, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2765, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 2765, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_19__setitem__, 0, __pyx_n_s_RotatedRect___setitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__305)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2765, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_12); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_setitem, __pyx_t_10) < 0) __PYX_ERR(0, 2765, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2699 + /* "collisions.py":2785 * ) * * def __str__(self): # <<<<<<<<<<<<<< * return f'' * */ - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_21__str__, 0, __pyx_n_s_RotatedRect___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__293)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2699, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_str, __pyx_t_11) < 0) __PYX_ERR(0, 2699, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_11RotatedRect_21__str__, 0, __pyx_n_s_RotatedRect___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__306)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2785, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_str, __pyx_t_10) < 0) __PYX_ERR(0, 2785, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2554 + /* "collisions.py":2640 * return f'' * * class RotatedRect(ClosedShape): # <<<<<<<<<<<<<< * """A rectangle...... That is rotated. * It is rotated around it's x and y coordinates. */ - __pyx_t_11 = __Pyx_Py3ClassCreate(__pyx_t_10, __pyx_n_s_RotatedRect, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2554, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (__Pyx_CyFunction_InitClassCell(__pyx_t_8, __pyx_t_11) < 0) __PYX_ERR(0, 2554, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_RotatedRect, __pyx_t_11) < 0) __PYX_ERR(0, 2554, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_10 = __Pyx_Py3ClassCreate(__pyx_t_11, __pyx_n_s_RotatedRect, __pyx_t_2, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2640, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (__Pyx_CyFunction_InitClassCell(__pyx_t_7, __pyx_t_10) < 0) __PYX_ERR(0, 2640, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_RotatedRect, __pyx_t_10) < 0) __PYX_ERR(0, 2640, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2702 + /* "collisions.py":2788 * return f'' * * class Polygon(ClosedShape): # <<<<<<<<<<<<<< * """A convex or concave polygon. It is defined with a list of points.""" * TYPE = ShpTyps.Polygon */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ClosedShape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2702, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ClosedShape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); __Pyx_GIVEREF(__pyx_t_2); - if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2)) __PYX_ERR(0, 2702, __pyx_L1_error); + if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2)) __PYX_ERR(0, 2788, __pyx_L1_error); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2702, __pyx_L1_error) + __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2702, __pyx_L1_error) + __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_n_s_Polygon, __pyx_n_s_Polygon, (PyObject *) NULL, __pyx_n_s_collisions, __pyx_kp_s_A_convex_or_concave_polygon_It_i); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (__pyx_t_2 != __pyx_t_10) { - if (unlikely((PyDict_SetItemString(__pyx_t_11, "__orig_bases__", __pyx_t_10) < 0))) __PYX_ERR(0, 2702, __pyx_L1_error) - } - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = PyList_New(0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2702, __pyx_L1_error) + __pyx_t_10 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_n_s_Polygon, __pyx_n_s_Polygon, (PyObject *) NULL, __pyx_n_s_collisions, __pyx_kp_s_A_convex_or_concave_polygon_It_i); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2788, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); + if (__pyx_t_2 != __pyx_t_11) { + if (unlikely((PyDict_SetItemString(__pyx_t_10, "__orig_bases__", __pyx_t_11) < 0))) __PYX_ERR(0, 2788, __pyx_L1_error) + } + __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_11); - /* "collisions.py":2704 + /* "collisions.py":2790 * class Polygon(ClosedShape): * """A convex or concave polygon. It is defined with a list of points.""" * TYPE = ShpTyps.Polygon # <<<<<<<<<<<<<< * def __init__(self, *points: pointLike, errorOnLT3: bool = True, bounciness: float = BASEBOUNCINESS): * """ */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2704, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2704, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_ShpTyps); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2790, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_TYPE, __pyx_t_7) < 0) __PYX_ERR(0, 2704, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_Polygon); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2790, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_TYPE, __pyx_t_12) < 0) __PYX_ERR(0, 2790, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":2705 + /* "collisions.py":2791 * """A convex or concave polygon. It is defined with a list of points.""" * TYPE = ShpTyps.Polygon * def __init__(self, *points: pointLike, errorOnLT3: bool = True, bounciness: float = BASEBOUNCINESS): # <<<<<<<<<<<<<< * """ * Args: */ - __pyx_t_7 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2705, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2791, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_errorOnLT3, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2791, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 2791, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_points_2, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2791, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_1__init__, 0, __pyx_n_s_Polygon___init, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__308)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_errorOnLT3, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2705, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 2705, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_points_2, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2705, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_1__init__, 0, __pyx_n_s_Polygon___init, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__295)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2705, __pyx_L1_error) + __Pyx_INCREF(__pyx_t_7); + PyList_Append(__pyx_t_11, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_7); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_7, sizeof(__pyx_defaults24), 0)) __PYX_ERR(0, 2791, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2791, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_INCREF(__pyx_t_8); - PyList_Append(__pyx_t_10, __pyx_t_8); - __Pyx_GIVEREF(__pyx_t_8); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_8, sizeof(__pyx_defaults23), 0)) __PYX_ERR(0, 2705, __pyx_L1_error) - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2705, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2705, __pyx_L1_error) + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2791, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_CyFunction_Defaults(__pyx_defaults24, __pyx_t_7)->__pyx_arg_bounciness = __pyx_t_9; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_7, __pyx_pf_10collisions_66__defaults__); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_12); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_CyFunction_Defaults(__pyx_defaults23, __pyx_t_8)->__pyx_arg_bounciness = __pyx_t_9; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_8, __pyx_pf_10collisions_64__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7); + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_init, __pyx_t_7) < 0) __PYX_ERR(0, 2791, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_init, __pyx_t_8) < 0) __PYX_ERR(0, 2705, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":2723 + /* "collisions.py":2809 * self.points = list(points) * * @property # <<<<<<<<<<<<<< * def x(self): * """One of this object's points' x value. Changing this will move the other points by the difference!""" */ - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_3x, 0, __pyx_n_s_Polygon_x, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__297)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2723, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2723, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_3x, 0, __pyx_n_s_Polygon_x, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__310)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2809, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_x, __pyx_t_7) < 0) __PYX_ERR(0, 2723, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2809, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_x, __pyx_t_12) < 0) __PYX_ERR(0, 2809, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":2727 + /* "collisions.py":2813 * """One of this object's points' x value. Changing this will move the other points by the difference!""" * return min([i[0] for i in self.points]) * @x.setter # <<<<<<<<<<<<<< * def x(self, new): * diff = new - self.x */ - __pyx_t_8 = PyObject_GetItem(__pyx_t_11, __pyx_n_s_x); - if (unlikely(!__pyx_t_8)) { + __pyx_t_7 = PyObject_GetItem(__pyx_t_10, __pyx_n_s_x); + if (unlikely(!__pyx_t_7)) { PyErr_Clear(); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_x); + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_x); } - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2727, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_setter); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2727, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_5x, 0, __pyx_n_s_Polygon_x, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__299)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2727, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_setter); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2813, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_5x, 0, __pyx_n_s_Polygon_x, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__312)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); __pyx_t_13 = NULL; __pyx_t_14 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12); + if (unlikely(PyMethod_Check(__pyx_t_8))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_8); if (likely(__pyx_t_13)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_12, function); + __Pyx_DECREF_SET(__pyx_t_8, function); __pyx_t_14 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_8}; - __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14); + PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_7}; + __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2813, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2727, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_x, __pyx_t_7) < 0) __PYX_ERR(0, 2727, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_x, __pyx_t_12) < 0) __PYX_ERR(0, 2813, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":2731 + /* "collisions.py":2817 * diff = new - self.x * self.points = [[i[0]+diff, i[1]] for i in self.points] * @property # <<<<<<<<<<<<<< * def y(self): * """One of this object's points' y value. Changing this will move the other points by the difference!""" */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_7y, 0, __pyx_n_s_Polygon_y, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__300)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2731, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_12 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2731, __pyx_L1_error) + __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_7y, 0, __pyx_n_s_Polygon_y, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__313)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2817, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_y, __pyx_t_12) < 0) __PYX_ERR(0, 2731, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_property, __pyx_t_12); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2817, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_y, __pyx_t_8) < 0) __PYX_ERR(0, 2817, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":2735 + /* "collisions.py":2821 * """One of this object's points' y value. Changing this will move the other points by the difference!""" * return min([i[1] for i in self.points]) * @y.setter # <<<<<<<<<<<<<< * def y(self, new): * diff = new - self.y */ - __pyx_t_7 = PyObject_GetItem(__pyx_t_11, __pyx_n_s_y); - if (unlikely(!__pyx_t_7)) { + __pyx_t_12 = PyObject_GetItem(__pyx_t_10, __pyx_n_s_y); + if (unlikely(!__pyx_t_12)) { PyErr_Clear(); - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_y); + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_y); } - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2735, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_setter); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2735, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_9y, 0, __pyx_n_s_Polygon_y, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__301)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2735, __pyx_L1_error) + if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_setter); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2821, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_9y, 0, __pyx_n_s_Polygon_y, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__314)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); __pyx_t_13 = NULL; __pyx_t_14 = 0; #if CYTHON_UNPACK_METHODS - if (unlikely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_8); + if (unlikely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_7); if (likely(__pyx_t_13)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); __Pyx_INCREF(__pyx_t_13); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_14 = 1; } } #endif { - PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_7}; - __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14); + PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_12}; + __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14); __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0; + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2821, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2735, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_y, __pyx_t_12) < 0) __PYX_ERR(0, 2735, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_y, __pyx_t_8) < 0) __PYX_ERR(0, 2821, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "collisions.py":2740 + /* "collisions.py":2826 * self.points = [[i[0], i[1]+diff] for i in self.points] * * def rect(self) -> Iterable[Number]: # <<<<<<<<<<<<<< * """ * Returns the rectangle bounding box surrounding this polygon. */ - __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2740, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 2740, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_11rect, 0, __pyx_n_s_Polygon_rect, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__303)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2740, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2826, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_12); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_rect, __pyx_t_8) < 0) __PYX_ERR(0, 2740, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Iterable_Number) < 0) __PYX_ERR(0, 2826, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_11rect, 0, __pyx_n_s_Polygon_rect, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__316)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2826, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_rect, __pyx_t_7) < 0) __PYX_ERR(0, 2826, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":2749 + /* "collisions.py":2835 * return min([i[0] for i in self.points]), min([i[1] for i in self.points]), max([i[0] for i in self.points]), max([i[1] for i in self.points]) * * def area(self) -> Number: # <<<<<<<<<<<<<< * """ * Gets the area of the shape. */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2749, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2835, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2835, __pyx_L1_error) + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_13area, 0, __pyx_n_s_Polygon_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__317)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2835, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_Number) < 0) __PYX_ERR(0, 2749, __pyx_L1_error) - __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_13area, 0, __pyx_n_s_Polygon_area, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__304)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2749, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_8); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_area, __pyx_t_8) < 0) __PYX_ERR(0, 2835, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_area, __pyx_t_12) < 0) __PYX_ERR(0, 2749, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":2761 + /* "collisions.py":2847 * ) + (self.points[len(self.points)-1][0] * self.points[0][1] - self.points[0][0] * self.points[len(self.points)-1][1])) / 2 * * def _collides(self, othershape: Shape) -> bool: # <<<<<<<<<<<<<< * if not self.check_rects(othershape): * return False */ - __pyx_t_12 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2761, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 2761, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2761, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_15_collides, 0, __pyx_n_s_Polygon__collides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__306)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2761, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2847, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_12); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_collides, __pyx_t_8) < 0) __PYX_ERR(0, 2761, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_othershape, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 2847, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_bool) < 0) __PYX_ERR(0, 2847, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_15_collides, 0, __pyx_n_s_Polygon__collides, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__319)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2847, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_collides, __pyx_t_7) < 0) __PYX_ERR(0, 2847, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":2807 + /* "collisions.py":2893 * return othershape._collides(self) * * def toLines(self) -> Iterable[Line]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2807, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2893, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Iterable_Line_2) < 0) __PYX_ERR(0, 2893, __pyx_L1_error) + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_17toLines, 0, __pyx_n_s_Polygon_toLines, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__320)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2893, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Iterable_Line_2) < 0) __PYX_ERR(0, 2807, __pyx_L1_error) - __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_17toLines, 0, __pyx_n_s_Polygon_toLines, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__307)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2807, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_8); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_toLines, __pyx_t_8) < 0) __PYX_ERR(0, 2893, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_toLines, __pyx_t_12) < 0) __PYX_ERR(0, 2807, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":2817 + /* "collisions.py":2903 * ] + [Line(self.points[len(self.points)-1], self.points[0])] * * def toPoints(self) -> Iterable[pointLike]: # <<<<<<<<<<<<<< * """ * Returns: */ - __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2817, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 2817, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_19toPoints, 0, __pyx_n_s_Polygon_toPoints, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__308)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2817, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2903, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_12); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_toPoints, __pyx_t_8) < 0) __PYX_ERR(0, 2817, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 2903, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_19toPoints, 0, __pyx_n_s_Polygon_toPoints, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__321)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2903, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_toPoints, __pyx_t_7) < 0) __PYX_ERR(0, 2903, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":2824 + /* "collisions.py":2910 * return [list(i) for i in self.points] * * def copy(self) -> 'Polygon': # <<<<<<<<<<<<<< * """ * And then he lifted his arms and said, 'LET THERE BE ANOTHER!' */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2824, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2910, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_return, __pyx_kp_s_Polygon_2) < 0) __PYX_ERR(0, 2910, __pyx_L1_error) + __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_21copy, 0, __pyx_n_s_Polygon_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__322)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2910, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_kp_s_Polygon_2) < 0) __PYX_ERR(0, 2824, __pyx_L1_error) - __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_21copy, 0, __pyx_n_s_Polygon_copy, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__309)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2824, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_12, __pyx_t_8); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_copy, __pyx_t_8) < 0) __PYX_ERR(0, 2910, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_copy, __pyx_t_12) < 0) __PYX_ERR(0, 2824, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "collisions.py":2830 + /* "collisions.py":2916 * return Polygon(*self.points, errorOnLT3=False, bounciness=self.bounciness) * * def __setitem__(self, item: int, new: pointLike) -> None: # <<<<<<<<<<<<<< * self.points[item] = new * */ - __pyx_t_12 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2830, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 2830, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_new, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2830, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 2830, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_23__setitem__, 0, __pyx_n_s_Polygon___setitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__310)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2830, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2916, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_12); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_setitem, __pyx_t_8) < 0) __PYX_ERR(0, 2830, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_item, __pyx_n_s_int) < 0) __PYX_ERR(0, 2916, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_new, __pyx_n_s_pointLike) < 0) __PYX_ERR(0, 2916, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_return, __pyx_n_s_None) < 0) __PYX_ERR(0, 2916, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_23__setitem__, 0, __pyx_n_s_Polygon___setitem, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__323)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2916, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_8); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_setitem, __pyx_t_7) < 0) __PYX_ERR(0, 2916, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":2833 + /* "collisions.py":2919 * self.points[item] = new * * def __str__(self): # <<<<<<<<<<<<<< * return f'' * */ - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_25__str__, 0, __pyx_n_s_Polygon___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__311)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_SetNameInClass(__pyx_t_11, __pyx_n_s_str, __pyx_t_8) < 0) __PYX_ERR(0, 2833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_7Polygon_25__str__, 0, __pyx_n_s_Polygon___str, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__324)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2919, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__Pyx_SetNameInClass(__pyx_t_10, __pyx_n_s_str, __pyx_t_7) < 0) __PYX_ERR(0, 2919, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "collisions.py":2702 + /* "collisions.py":2788 * return f'' * * class Polygon(ClosedShape): # <<<<<<<<<<<<<< * """A convex or concave polygon. It is defined with a list of points.""" * TYPE = ShpTyps.Polygon */ - __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_Polygon, __pyx_t_2, __pyx_t_11, NULL, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2702, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - if (__Pyx_CyFunction_InitClassCell(__pyx_t_10, __pyx_t_8) < 0) __PYX_ERR(0, 2702, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Polygon, __pyx_t_8) < 0) __PYX_ERR(0, 2702, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_Polygon, __pyx_t_2, __pyx_t_10, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2788, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + if (__Pyx_CyFunction_InitClassCell(__pyx_t_11, __pyx_t_7) < 0) __PYX_ERR(0, 2788, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Polygon, __pyx_t_7) < 0) __PYX_ERR(0, 2788, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "collisions.py":2836 + /* "collisions.py":2922 * return f'' * * class ShapeCombiner: # <<<<<<<<<<<<<< * """A class to combine shapes together. You do not actually need to create an object of this as all the methods are static. * Instead you just run things like `ShapeCombiner.combineRects(rect1, rect2, rect3)`.""" */ - __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_ShapeCombiner, __pyx_n_s_ShapeCombiner, (PyObject *) NULL, __pyx_n_s_collisions, __pyx_kp_s_A_class_to_combine_shapes_togeth); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2836, __pyx_L1_error) + __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_ShapeCombiner, __pyx_n_s_ShapeCombiner, (PyObject *) NULL, __pyx_n_s_collisions, __pyx_kp_s_A_class_to_combine_shapes_togeth); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2922, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - /* "collisions.py":2839 + /* "collisions.py":2925 * """A class to combine shapes together. You do not actually need to create an object of this as all the methods are static. * Instead you just run things like `ShapeCombiner.combineRects(rect1, rect2, rect3)`.""" * @staticmethod # <<<<<<<<<<<<<< * def boundingBox(*shapes: Rect) -> Shapes: * """ */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2839, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2925, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_shapes, __pyx_n_s_Rect) < 0) __PYX_ERR(0, 2839, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_Shapes) < 0) __PYX_ERR(0, 2839, __pyx_L1_error) - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_13ShapeCombiner_1boundingBox, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_ShapeCombiner_boundingBox, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__313)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_shapes, __pyx_n_s_Rect) < 0) __PYX_ERR(0, 2925, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_Shapes) < 0) __PYX_ERR(0, 2925, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_13ShapeCombiner_1boundingBox, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_ShapeCombiner_boundingBox, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__326)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2925, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2839, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2925, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_boundingBox, __pyx_t_3) < 0) __PYX_ERR(0, 2839, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_boundingBox, __pyx_t_3) < 0) __PYX_ERR(0, 2925, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2863 + /* "collisions.py":2949 * )) * * @staticmethod # <<<<<<<<<<<<<< * def combineRects(*shapes: Rect) -> Shapes: * """ */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2863, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_shapes, __pyx_n_s_Rect) < 0) __PYX_ERR(0, 2863, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_Shapes) < 0) __PYX_ERR(0, 2863, __pyx_L1_error) - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_13ShapeCombiner_3combineRects, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_ShapeCombiner_combineRects, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__315)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2863, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_shapes, __pyx_n_s_Rect) < 0) __PYX_ERR(0, 2949, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_Shapes) < 0) __PYX_ERR(0, 2949, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_13ShapeCombiner_3combineRects, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_ShapeCombiner_combineRects, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__328)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2949, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2863, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2949, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_combineRects, __pyx_t_3) < 0) __PYX_ERR(0, 2863, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_combineRects, __pyx_t_3) < 0) __PYX_ERR(0, 2949, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2917 + /* "collisions.py":3003 * return Shapes(*shapes, *others) * * @staticmethod # <<<<<<<<<<<<<< * def union(*shapes: Shape) -> Shapes: # FIXME * """ */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2917, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_shapes, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 2917, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_Shapes) < 0) __PYX_ERR(0, 2917, __pyx_L1_error) - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_13ShapeCombiner_5union, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_ShapeCombiner_union, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__317)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2917, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_3); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_shapes, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 3003, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_Shapes) < 0) __PYX_ERR(0, 3003, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_13ShapeCombiner_5union, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_ShapeCombiner_union, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__330)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3003, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2917, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3003, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_union, __pyx_t_3) < 0) __PYX_ERR(0, 2917, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_union, __pyx_t_3) < 0) __PYX_ERR(0, 3003, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2986 + /* "collisions.py":3072 * return Shapes(*outshps) * * @staticmethod # <<<<<<<<<<<<<< * def pointsToShape(*points: Iterable[pointLike], bounciness: float = BASEBOUNCINESS) -> Shape: * """ */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2986, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3072, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 2986, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_points_2, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 2986, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 2986, __pyx_L1_error) - __pyx_t_11 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_13ShapeCombiner_7pointsToShape, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_ShapeCombiner_pointsToShape, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__319)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2986, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (!__Pyx_CyFunction_InitDefaults(__pyx_t_11, sizeof(__pyx_defaults24), 0)) __PYX_ERR(0, 2986, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_bounciness, __pyx_n_s_float) < 0) __PYX_ERR(0, 3072, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_points_2, __pyx_kp_s_Iterable_pointLike) < 0) __PYX_ERR(0, 3072, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_return, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 3072, __pyx_L1_error) + __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_13ShapeCombiner_7pointsToShape, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_ShapeCombiner_pointsToShape, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__332)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3072, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (!__Pyx_CyFunction_InitDefaults(__pyx_t_10, sizeof(__pyx_defaults25), 0)) __PYX_ERR(0, 3072, __pyx_L1_error) - /* "collisions.py":2987 + /* "collisions.py":3073 * * @staticmethod * def pointsToShape(*points: Iterable[pointLike], bounciness: float = BASEBOUNCINESS) -> Shape: # <<<<<<<<<<<<<< * """ * Converts a list of points to a shape object. */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2987, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_8); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 2987, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __Pyx_CyFunction_Defaults(__pyx_defaults24, __pyx_t_11)->__pyx_arg_bounciness = __pyx_t_9; - __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_11, __pyx_pf_10collisions_66__defaults__); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_11, __pyx_t_3); + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_BASEBOUNCINESS); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3073, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 3073, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_CyFunction_Defaults(__pyx_defaults25, __pyx_t_10)->__pyx_arg_bounciness = __pyx_t_9; + __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_10, __pyx_pf_10collisions_68__defaults__); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_10, __pyx_t_3); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":2986 + /* "collisions.py":3072 * return Shapes(*outshps) * * @staticmethod # <<<<<<<<<<<<<< * def pointsToShape(*points: Iterable[pointLike], bounciness: float = BASEBOUNCINESS) -> Shape: * """ */ - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2986, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3072, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_pointsToShape, __pyx_t_3) < 0) __PYX_ERR(0, 2986, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_pointsToShape, __pyx_t_3) < 0) __PYX_ERR(0, 3072, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "collisions.py":3025 + /* "collisions.py":3111 * return Polygon(*points, bounciness=bounciness) * * @staticmethod # <<<<<<<<<<<<<< * def pointsToPoly(*points: list[Point], ratio: Number = 0.1) -> Union[Shape, Shapes]: * """ */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3025, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3111, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ratio, ((PyObject*)__pyx_float_0_1)) < 0) __PYX_ERR(0, 3025, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3025, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_ratio, __pyx_n_s_Number) < 0) __PYX_ERR(0, 3025, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_points_2, __pyx_kp_s_list_Point) < 0) __PYX_ERR(0, 3025, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_kp_s_Union_Shape_Shapes_3) < 0) __PYX_ERR(0, 3025, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_13ShapeCombiner_9pointsToPoly, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_ShapeCombiner_pointsToPoly, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__321)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3025, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_8, __pyx_t_3); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_11); + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ratio, ((PyObject*)__pyx_float_0_1)) < 0) __PYX_ERR(0, 3111, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_ratio, __pyx_n_s_Number) < 0) __PYX_ERR(0, 3111, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_points_2, __pyx_kp_s_list_Point) < 0) __PYX_ERR(0, 3111, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_kp_s_Union_Shape_Shapes_3) < 0) __PYX_ERR(0, 3111, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_13ShapeCombiner_9pointsToPoly, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_ShapeCombiner_pointsToPoly, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__334)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_7, __pyx_t_3); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_10); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3025, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_pointsToPoly, __pyx_t_11) < 0) __PYX_ERR(0, 3025, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_pointsToPoly, __pyx_t_10) < 0) __PYX_ERR(0, 3111, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":3041 + /* "collisions.py":3127 * return shapelyToColl(shapely.concave_hull(shapelyGeom.MultiPoint([tuple(i) for i in points]), ratio=ratio)) * * @staticmethod # <<<<<<<<<<<<<< * def shapelyUnion(*shapes: Shape) -> Shape: * """ */ - __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3041, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_shapes, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 3041, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_return, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 3041, __pyx_L1_error) - __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_13ShapeCombiner_11shapelyUnion, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_ShapeCombiner_shapelyUnion, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__323)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3041, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_8, __pyx_t_11); - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_8); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 3041, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_shapelyUnion, __pyx_t_11) < 0) __PYX_ERR(0, 3041, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_10 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_shapes, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 3127, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_return, __pyx_n_s_Shape) < 0) __PYX_ERR(0, 3127, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_10collisions_13ShapeCombiner_11shapelyUnion, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_ShapeCombiner_shapelyUnion, NULL, __pyx_n_s_collisions, __pyx_d, ((PyObject *)__pyx_codeobj__336)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_CyFunction_SetAnnotationsDict(__pyx_t_7, __pyx_t_10); + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 3127, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_shapelyUnion, __pyx_t_10) < 0) __PYX_ERR(0, 3127, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "collisions.py":2836 + /* "collisions.py":2922 * return f'' * * class ShapeCombiner: # <<<<<<<<<<<<<< * """A class to combine shapes together. You do not actually need to create an object of this as all the methods are static. * Instead you just run things like `ShapeCombiner.combineRects(rect1, rect2, rect3)`.""" */ - __pyx_t_11 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_ShapeCombiner, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_ShapeCombiner, __pyx_t_11) < 0) __PYX_ERR(0, 2836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; + __pyx_t_10 = __Pyx_Py3ClassCreate(((PyObject*)&PyType_Type), __pyx_n_s_ShapeCombiner, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2922, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + if (PyDict_SetItem(__pyx_d, __pyx_n_s_ShapeCombiner, __pyx_t_10) < 0) __PYX_ERR(0, 2922, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "collisions.py":1 * import math # <<<<<<<<<<<<<< * from enum import IntEnum - * from typing import Union, Iterable, Any, Dict + * from typing import Union, Iterable, Any */ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -119358,81 +122821,6 @@ static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, in return unlikely(result < 0) ? result : (result == (eq == Py_EQ)); } -/* JoinPyUnicode */ -static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, - Py_UCS4 max_char) { -#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - PyObject *result_uval; - int result_ukind, kind_shift; - Py_ssize_t i, char_pos; - void *result_udata; - CYTHON_MAYBE_UNUSED_VAR(max_char); -#if CYTHON_PEP393_ENABLED - result_uval = PyUnicode_New(result_ulength, max_char); - if (unlikely(!result_uval)) return NULL; - result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; - kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1; - result_udata = PyUnicode_DATA(result_uval); -#else - result_uval = PyUnicode_FromUnicode(NULL, result_ulength); - if (unlikely(!result_uval)) return NULL; - result_ukind = sizeof(Py_UNICODE); - kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1; - result_udata = PyUnicode_AS_UNICODE(result_uval); -#endif - assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); - char_pos = 0; - for (i=0; i < value_count; i++) { - int ukind; - Py_ssize_t ulength; - void *udata; - PyObject *uval = PyTuple_GET_ITEM(value_tuple, i); - if (unlikely(__Pyx_PyUnicode_READY(uval))) - goto bad; - ulength = __Pyx_PyUnicode_GET_LENGTH(uval); - if (unlikely(!ulength)) - continue; - if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos)) - goto overflow; - ukind = __Pyx_PyUnicode_KIND(uval); - udata = __Pyx_PyUnicode_DATA(uval); - if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) { - memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); - } else { - #if PY_VERSION_HEX >= 0x030d0000 - if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad; - #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters) - _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); - #else - Py_ssize_t j; - for (j=0; j < ulength; j++) { - Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j); - __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar); - } - #endif - } - char_pos += ulength; - } - return result_uval; -overflow: - PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); -bad: - Py_DECREF(result_uval); - return NULL; -#else - CYTHON_UNUSED_VAR(max_char); - CYTHON_UNUSED_VAR(result_ulength); - CYTHON_UNUSED_VAR(value_count); - return PyUnicode_Join(__pyx_empty_unicode, value_tuple); -#endif -} - -/* PyObjectCallOneArg */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *args[2] = {NULL, arg}; - return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); -} - /* ArgTypeTest */ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) { @@ -119607,6 +122995,12 @@ static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long int } #endif +/* PyObjectCallOneArg */ +static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *args[2] = {NULL, arg}; + return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET); +} + /* PyObjectSetAttrStr */ #if CYTHON_USE_TYPE_SLOTS static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) { @@ -120009,216 +123403,6 @@ static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) { return 0; } -/* RaiseUnboundLocalError */ -static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { - PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); -} - -/* GetException */ -#if CYTHON_FAST_THREAD_STATE -static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) -#else -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) -#endif -{ - PyObject *local_type = NULL, *local_value, *local_tb = NULL; -#if CYTHON_FAST_THREAD_STATE - PyObject *tmp_type, *tmp_value, *tmp_tb; - #if PY_VERSION_HEX >= 0x030C00A6 - local_value = tstate->current_exception; - tstate->current_exception = 0; - if (likely(local_value)) { - local_type = (PyObject*) Py_TYPE(local_value); - Py_INCREF(local_type); - local_tb = PyException_GetTraceback(local_value); - } - #else - local_type = tstate->curexc_type; - local_value = tstate->curexc_value; - local_tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; - #endif -#else - PyErr_Fetch(&local_type, &local_value, &local_tb); -#endif - PyErr_NormalizeException(&local_type, &local_value, &local_tb); -#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 - if (unlikely(tstate->current_exception)) -#elif CYTHON_FAST_THREAD_STATE - if (unlikely(tstate->curexc_type)) -#else - if (unlikely(PyErr_Occurred())) -#endif - goto bad; - #if PY_MAJOR_VERSION >= 3 - if (local_tb) { - if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) - goto bad; - } - #endif - Py_XINCREF(local_tb); - Py_XINCREF(local_type); - Py_XINCREF(local_value); - *type = local_type; - *value = local_value; - *tb = local_tb; -#if CYTHON_FAST_THREAD_STATE - #if CYTHON_USE_EXC_INFO_STACK - { - _PyErr_StackItem *exc_info = tstate->exc_info; - #if PY_VERSION_HEX >= 0x030B00a4 - tmp_value = exc_info->exc_value; - exc_info->exc_value = local_value; - tmp_type = NULL; - tmp_tb = NULL; - Py_XDECREF(local_type); - Py_XDECREF(local_tb); - #else - tmp_type = exc_info->exc_type; - tmp_value = exc_info->exc_value; - tmp_tb = exc_info->exc_traceback; - exc_info->exc_type = local_type; - exc_info->exc_value = local_value; - exc_info->exc_traceback = local_tb; - #endif - } - #else - tmp_type = tstate->exc_type; - tmp_value = tstate->exc_value; - tmp_tb = tstate->exc_traceback; - tstate->exc_type = local_type; - tstate->exc_value = local_value; - tstate->exc_traceback = local_tb; - #endif - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -#else - PyErr_SetExcInfo(local_type, local_value, local_tb); -#endif - return 0; -bad: - *type = 0; - *value = 0; - *tb = 0; - Py_XDECREF(local_type); - Py_XDECREF(local_value); - Py_XDECREF(local_tb); - return -1; -} - -/* pep479 */ -static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { - PyObject *exc, *val, *tb, *cur_exc; - __Pyx_PyThreadState_declare - #ifdef __Pyx_StopAsyncIteration_USED - int is_async_stopiteration = 0; - #endif - CYTHON_MAYBE_UNUSED_VAR(in_async_gen); - cur_exc = PyErr_Occurred(); - if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) { - #ifdef __Pyx_StopAsyncIteration_USED - if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, __Pyx_PyExc_StopAsyncIteration))) { - is_async_stopiteration = 1; - } else - #endif - return; - } - __Pyx_PyThreadState_assign - __Pyx_GetException(&exc, &val, &tb); - Py_XDECREF(exc); - Py_XDECREF(val); - Py_XDECREF(tb); - PyErr_SetString(PyExc_RuntimeError, - #ifdef __Pyx_StopAsyncIteration_USED - is_async_stopiteration ? "async generator raised StopAsyncIteration" : - in_async_gen ? "async generator raised StopIteration" : - #endif - "generator raised StopIteration"); -} - -/* ObjectGetItem */ -#if CYTHON_USE_TYPE_SLOTS -static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { - PyObject *runerr = NULL; - Py_ssize_t key_value; - key_value = __Pyx_PyIndex_AsSsize_t(index); - if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { - return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); - } - if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { - __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); - PyErr_Clear(); - PyErr_Format(PyExc_IndexError, - "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); - __Pyx_DECREF_TypeName(index_type_name); - } - return NULL; -} -static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { - __Pyx_TypeName obj_type_name; - if (likely(PyType_Check(obj))) { - PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); - if (!meth) { - PyErr_Clear(); - } else { - PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); - Py_DECREF(meth); - return result; - } - } - obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); - PyErr_Format(PyExc_TypeError, - "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); - __Pyx_DECREF_TypeName(obj_type_name); - return NULL; -} -static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { - PyTypeObject *tp = Py_TYPE(obj); - PyMappingMethods *mm = tp->tp_as_mapping; - PySequenceMethods *sm = tp->tp_as_sequence; - if (likely(mm && mm->mp_subscript)) { - return mm->mp_subscript(obj, key); - } - if (likely(sm && sm->sq_item)) { - return __Pyx_PyObject_GetIndex(obj, key); - } - return __Pyx_PyObject_GetItem_Slow(obj, key); -} -#endif - -/* py_abs */ -#if CYTHON_USE_PYLONG_INTERNALS -static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) { -#if PY_VERSION_HEX >= 0x030C00A7 - if (likely(__Pyx_PyLong_IsCompact(n))) { - return PyLong_FromSize_t(__Pyx_PyLong_CompactValueUnsigned(n)); - } -#else - if (likely(Py_SIZE(n) == -1)) { - return PyLong_FromUnsignedLong(__Pyx_PyLong_Digits(n)[0]); - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 - { - PyObject *copy = _PyLong_Copy((PyLongObject*)n); - if (likely(copy)) { - #if PY_VERSION_HEX >= 0x030C00A7 - ((PyLongObject*)copy)->long_value.lv_tag = ((PyLongObject*)copy)->long_value.lv_tag & ~_PyLong_SIGN_MASK; - #else - __Pyx_SET_SIZE(copy, -Py_SIZE(copy)); - #endif - } - return copy; - } -#else - return PyNumber_Negative(n); -#endif -} -#endif - /* RaiseClosureNameError */ static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) { PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname); @@ -121477,6 +124661,285 @@ static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qual return op; } +/* RaiseUnboundLocalError */ +static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) { + PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname); +} + +/* GetException */ +#if CYTHON_FAST_THREAD_STATE +static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) +#else +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) +#endif +{ + PyObject *local_type = NULL, *local_value, *local_tb = NULL; +#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; + #if PY_VERSION_HEX >= 0x030C00A6 + local_value = tstate->current_exception; + tstate->current_exception = 0; + if (likely(local_value)) { + local_type = (PyObject*) Py_TYPE(local_value); + Py_INCREF(local_type); + local_tb = PyException_GetTraceback(local_value); + } + #else + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; + #endif +#else + PyErr_Fetch(&local_type, &local_value, &local_tb); +#endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +#if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6 + if (unlikely(tstate->current_exception)) +#elif CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) +#else + if (unlikely(PyErr_Occurred())) +#endif + goto bad; + #if PY_MAJOR_VERSION >= 3 + if (local_tb) { + if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0)) + goto bad; + } + #endif + Py_XINCREF(local_tb); + Py_XINCREF(local_type); + Py_XINCREF(local_value); + *type = local_type; + *value = local_value; + *tb = local_tb; +#if CYTHON_FAST_THREAD_STATE + #if CYTHON_USE_EXC_INFO_STACK + { + _PyErr_StackItem *exc_info = tstate->exc_info; + #if PY_VERSION_HEX >= 0x030B00a4 + tmp_value = exc_info->exc_value; + exc_info->exc_value = local_value; + tmp_type = NULL; + tmp_tb = NULL; + Py_XDECREF(local_type); + Py_XDECREF(local_tb); + #else + tmp_type = exc_info->exc_type; + tmp_value = exc_info->exc_value; + tmp_tb = exc_info->exc_traceback; + exc_info->exc_type = local_type; + exc_info->exc_value = local_value; + exc_info->exc_traceback = local_tb; + #endif + } + #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; + #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +#else + PyErr_SetExcInfo(local_type, local_value, local_tb); +#endif + return 0; +bad: + *type = 0; + *value = 0; + *tb = 0; + Py_XDECREF(local_type); + Py_XDECREF(local_value); + Py_XDECREF(local_tb); + return -1; +} + +/* pep479 */ +static void __Pyx_Generator_Replace_StopIteration(int in_async_gen) { + PyObject *exc, *val, *tb, *cur_exc; + __Pyx_PyThreadState_declare + #ifdef __Pyx_StopAsyncIteration_USED + int is_async_stopiteration = 0; + #endif + CYTHON_MAYBE_UNUSED_VAR(in_async_gen); + cur_exc = PyErr_Occurred(); + if (likely(!__Pyx_PyErr_GivenExceptionMatches(cur_exc, PyExc_StopIteration))) { + #ifdef __Pyx_StopAsyncIteration_USED + if (in_async_gen && unlikely(__Pyx_PyErr_GivenExceptionMatches(cur_exc, __Pyx_PyExc_StopAsyncIteration))) { + is_async_stopiteration = 1; + } else + #endif + return; + } + __Pyx_PyThreadState_assign + __Pyx_GetException(&exc, &val, &tb); + Py_XDECREF(exc); + Py_XDECREF(val); + Py_XDECREF(tb); + PyErr_SetString(PyExc_RuntimeError, + #ifdef __Pyx_StopAsyncIteration_USED + is_async_stopiteration ? "async generator raised StopAsyncIteration" : + in_async_gen ? "async generator raised StopIteration" : + #endif + "generator raised StopIteration"); +} + +/* ObjectGetItem */ +#if CYTHON_USE_TYPE_SLOTS +static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) { + PyObject *runerr = NULL; + Py_ssize_t key_value; + key_value = __Pyx_PyIndex_AsSsize_t(index); + if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { + return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); + } + if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { + __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index)); + PyErr_Clear(); + PyErr_Format(PyExc_IndexError, + "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name); + __Pyx_DECREF_TypeName(index_type_name); + } + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { + __Pyx_TypeName obj_type_name; + if (likely(PyType_Check(obj))) { + PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem); + if (!meth) { + PyErr_Clear(); + } else { + PyObject *result = __Pyx_PyObject_CallOneArg(meth, key); + Py_DECREF(meth); + return result; + } + } + obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj)); + PyErr_Format(PyExc_TypeError, + "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name); + __Pyx_DECREF_TypeName(obj_type_name); + return NULL; +} +static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { + PyTypeObject *tp = Py_TYPE(obj); + PyMappingMethods *mm = tp->tp_as_mapping; + PySequenceMethods *sm = tp->tp_as_sequence; + if (likely(mm && mm->mp_subscript)) { + return mm->mp_subscript(obj, key); + } + if (likely(sm && sm->sq_item)) { + return __Pyx_PyObject_GetIndex(obj, key); + } + return __Pyx_PyObject_GetItem_Slow(obj, key); +} +#endif + +/* JoinPyUnicode */ +static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength, + Py_UCS4 max_char) { +#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS + PyObject *result_uval; + int result_ukind, kind_shift; + Py_ssize_t i, char_pos; + void *result_udata; + CYTHON_MAYBE_UNUSED_VAR(max_char); +#if CYTHON_PEP393_ENABLED + result_uval = PyUnicode_New(result_ulength, max_char); + if (unlikely(!result_uval)) return NULL; + result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND; + kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1; + result_udata = PyUnicode_DATA(result_uval); +#else + result_uval = PyUnicode_FromUnicode(NULL, result_ulength); + if (unlikely(!result_uval)) return NULL; + result_ukind = sizeof(Py_UNICODE); + kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1; + result_udata = PyUnicode_AS_UNICODE(result_uval); +#endif + assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0); + char_pos = 0; + for (i=0; i < value_count; i++) { + int ukind; + Py_ssize_t ulength; + void *udata; + PyObject *uval = PyTuple_GET_ITEM(value_tuple, i); + if (unlikely(__Pyx_PyUnicode_READY(uval))) + goto bad; + ulength = __Pyx_PyUnicode_GET_LENGTH(uval); + if (unlikely(!ulength)) + continue; + if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos)) + goto overflow; + ukind = __Pyx_PyUnicode_KIND(uval); + udata = __Pyx_PyUnicode_DATA(uval); + if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) { + memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift)); + } else { + #if PY_VERSION_HEX >= 0x030d0000 + if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad; + #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters) + _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength); + #else + Py_ssize_t j; + for (j=0; j < ulength; j++) { + Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j); + __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar); + } + #endif + } + char_pos += ulength; + } + return result_uval; +overflow: + PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string"); +bad: + Py_DECREF(result_uval); + return NULL; +#else + CYTHON_UNUSED_VAR(max_char); + CYTHON_UNUSED_VAR(result_ulength); + CYTHON_UNUSED_VAR(value_count); + return PyUnicode_Join(__pyx_empty_unicode, value_tuple); +#endif +} + +/* py_abs */ +#if CYTHON_USE_PYLONG_INTERNALS +static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) { +#if PY_VERSION_HEX >= 0x030C00A7 + if (likely(__Pyx_PyLong_IsCompact(n))) { + return PyLong_FromSize_t(__Pyx_PyLong_CompactValueUnsigned(n)); + } +#else + if (likely(Py_SIZE(n) == -1)) { + return PyLong_FromUnsignedLong(__Pyx_PyLong_Digits(n)[0]); + } +#endif +#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 + { + PyObject *copy = _PyLong_Copy((PyLongObject*)n); + if (likely(copy)) { + #if PY_VERSION_HEX >= 0x030C00A7 + ((PyLongObject*)copy)->long_value.lv_tag = ((PyLongObject*)copy)->long_value.lv_tag & ~_PyLong_SIGN_MASK; + #else + __Pyx_SET_SIZE(copy, -Py_SIZE(copy)); + #endif + } + return copy; + } +#else + return PyNumber_Negative(n); +#endif +} +#endif + /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { @@ -122159,6 +125622,101 @@ static CYTHON_INLINE int __Pyx_PyInt_BoolEqObjC(PyObject *op1, PyObject *op2, lo PyObject_RichCompare(op1, op2, Py_EQ)); } +/* PyIntBinop */ +#if !CYTHON_COMPILING_IN_PYPY +static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { + CYTHON_MAYBE_UNUSED_VAR(intval); + CYTHON_MAYBE_UNUSED_VAR(inplace); + CYTHON_UNUSED_VAR(zerodivision_check); + #if PY_MAJOR_VERSION < 3 + if (likely(PyInt_CheckExact(op1))) { + const long b = intval; + long a = PyInt_AS_LONG(op1); + + if (8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53))) { + return PyFloat_FromDouble((double)a / (double)b); + } + return PyInt_Type.tp_as_number->nb_true_divide(op1, op2); + } + #endif + #if CYTHON_USE_PYLONG_INTERNALS + if (likely(PyLong_CheckExact(op1))) { + const long b = intval; + long a, x; + if (unlikely(__Pyx_PyLong_IsZero(op1))) { + } + if (likely(__Pyx_PyLong_IsCompact(op1))) { + a = __Pyx_PyLong_CompactValue(op1); + } else { + const digit* digits = __Pyx_PyLong_Digits(op1); + const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); + switch (size) { + case -2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) { + a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + } + CYTHON_FALLTHROUGH; + case 2: + if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) { + a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + } + CYTHON_FALLTHROUGH; + case -3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) { + a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + } + CYTHON_FALLTHROUGH; + case 3: + if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) { + a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); + break; + } + CYTHON_FALLTHROUGH; + case -4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) { + 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; + } + CYTHON_FALLTHROUGH; + case 4: + if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) { + 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; + } + CYTHON_FALLTHROUGH; + default: return PyLong_Type.tp_as_number->nb_true_divide(op1, op2); + } + } + if ((8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53))) + || __Pyx_PyLong_DigitCount(op1) <= 52 / PyLong_SHIFT) { + return PyFloat_FromDouble((double)a / (double)b); + } + return PyLong_Type.tp_as_number->nb_true_divide(op1, op2); + return PyLong_FromLong(x); + + } + #endif + if (PyFloat_CheckExact(op1)) { + const long b = intval; +#if CYTHON_COMPILING_IN_LIMITED_API + double a = __pyx_PyFloat_AsDouble(op1); +#else + double a = PyFloat_AS_DOUBLE(op1); +#endif + double result; + + PyFPE_START_PROTECT("divide", return NULL) + result = ((double)a) / (double)b; + PyFPE_END_PROTECT(result) + return PyFloat_FromDouble(result); + } + return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2); +} +#endif + /* PyIntBinop */ #if !CYTHON_COMPILING_IN_PYPY static PyObject* __Pyx_PyInt_MultiplyCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { @@ -122306,101 +125864,6 @@ static PyObject* __Pyx_PyInt_MultiplyCObj(PyObject *op1, PyObject *op2, long int } #endif -/* PyIntBinop */ -#if !CYTHON_COMPILING_IN_PYPY -static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) { - CYTHON_MAYBE_UNUSED_VAR(intval); - CYTHON_MAYBE_UNUSED_VAR(inplace); - CYTHON_UNUSED_VAR(zerodivision_check); - #if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(op1))) { - const long b = intval; - long a = PyInt_AS_LONG(op1); - - if (8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53))) { - return PyFloat_FromDouble((double)a / (double)b); - } - return PyInt_Type.tp_as_number->nb_true_divide(op1, op2); - } - #endif - #if CYTHON_USE_PYLONG_INTERNALS - if (likely(PyLong_CheckExact(op1))) { - const long b = intval; - long a, x; - if (unlikely(__Pyx_PyLong_IsZero(op1))) { - } - if (likely(__Pyx_PyLong_IsCompact(op1))) { - a = __Pyx_PyLong_CompactValue(op1); - } else { - const digit* digits = __Pyx_PyLong_Digits(op1); - const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(op1); - switch (size) { - case -2: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) { - a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } - CYTHON_FALLTHROUGH; - case 2: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) { - a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } - CYTHON_FALLTHROUGH; - case -3: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) { - a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } - CYTHON_FALLTHROUGH; - case 3: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) { - a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])); - break; - } - CYTHON_FALLTHROUGH; - case -4: - if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) { - 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; - } - CYTHON_FALLTHROUGH; - case 4: - if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) { - 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; - } - CYTHON_FALLTHROUGH; - default: return PyLong_Type.tp_as_number->nb_true_divide(op1, op2); - } - } - if ((8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53))) - || __Pyx_PyLong_DigitCount(op1) <= 52 / PyLong_SHIFT) { - return PyFloat_FromDouble((double)a / (double)b); - } - return PyLong_Type.tp_as_number->nb_true_divide(op1, op2); - return PyLong_FromLong(x); - - } - #endif - if (PyFloat_CheckExact(op1)) { - const long b = intval; -#if CYTHON_COMPILING_IN_LIMITED_API - double a = __pyx_PyFloat_AsDouble(op1); -#else - double a = PyFloat_AS_DOUBLE(op1); -#endif - double result; - - PyFPE_START_PROTECT("divide", return NULL) - result = ((double)a) / (double)b; - PyFPE_END_PROTECT(result) - return PyFloat_FromDouble(result); - } - return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2); -} -#endif - /* CallUnboundCMethod0 */ static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) { PyObject *args, *result = NULL; @@ -123125,7 +126588,7 @@ static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject * #endif static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) { #if PY_MAJOR_VERSION < 3 - PyObject *module, *from_list, *star = __pyx_n_s__36; + PyObject *module, *from_list, *star = __pyx_n_s__40; CYTHON_UNUSED_VAR(parts_tuple); from_list = PyList_New(1); if (unlikely(!from_list)) @@ -123188,7 +126651,7 @@ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { if (unlikely(!module_name_str)) { goto modbad; } module_name = PyUnicode_FromString(module_name_str); if (unlikely(!module_name)) { goto modbad; } - module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__37); + module_dot = PyUnicode_Concat(module_name, __pyx_kp_u__41); if (unlikely(!module_dot)) { goto modbad; } full_name = PyUnicode_Concat(module_dot, name); if (unlikely(!full_name)) { goto modbad; } @@ -124078,7 +127541,7 @@ __Pyx_PyType_GetName(PyTypeObject* tp) if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) { PyErr_Clear(); Py_XDECREF(name); - name = __Pyx_NewRef(__pyx_n_s__324); + name = __Pyx_NewRef(__pyx_n_s__337); } return name; }